Repository navigation
feat!: spec 18 transfer across trees (merkle_roots, selector 0x63d0b9a0), unshield v3 recipient, busy proof RPC - #8
Merged
Conversation
…a0), unshield v3 recipient, busy proof RPC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings
@orbinum/protocolto node spec 18 / transaction version 6.Breaking: transfer across trees (circuit 1 v3)
PrivateTransferParams.merkleRoot→merkleRoots: [string, string]: the root each input is proven against, in input order.ShieldedPoolModule.privateTransfersendsmerkle_roots.privateTransfer(bytes,bytes32[],bytes32[],bytes32[],bytes[],uint32,uint256,uint32), selector0x63d0b9a0. The single-root0x66ed2cd4stays inKNOWN_PRECOMPILESonly to decode older blocks.roots, old calldata →root;mapExtrinsicArgs→merkle_rootsfor spec 18+ blocks,merkle_rootfor older ones.Also for spec 18
addressToFieldElementaccepts circuit version 3. Unshield v3 keeps v2's memo-bound recipient (blake2_256); only its spending-key rule changed. Without this, unshield v3 could not be proven. Unknown versions still throw.-32009) only past a full queue.isServerBusyError,SERVER_BUSY_CODE.PrivacyModule.getMerkleProof*retries a busy refusal with backoff (only busy, a few tries, jittered).classifyChainErrornever reads a busy refusal asghost-note. Before, a wrapped busy message matched the ghost-note pattern, and a wallet would have purged a real note.Hardening
assertMerkleRootsrefuses non-canonical field elements (≥ r)r + xis the same element asxbut no root it ever recorded, so the spend would fail after the proof was paid fordecodeRootsrefuses an offset into the ABI headmapExtrinsicArgsreads camelCase arg namesmerkleRoots,encryptedMemos…; the mapper only knew snake_case and positional names, and dropped those fields in silence. Found by the live test belowTesting
Unit: 927 tests, plus typecheck, lint, format and build. New:
2^200, past the data;2^255;r,2^256−1);addressToFieldElementwith versions0,4,1.5,-1,NaN,∞.0xcc…cc) were not field elements and are now refused.Live, against a dev node (8 leaves per tree): this package as the client,
@orbinum/proof-generator9.0.0 proving with the published@orbinum/circuits0.17.1 keys. 15/15:shieldthroughShieldedPoolModuleprivateTransfer, same tree, signedprivateTransfer, cross-tree, unsignedShieldedPoolPrecompile.privateTransfer(EVM)0x63d0b9a0, calldata decodes back to its two roots, landsmapExtrinsicArgson the real blockmerkle_rootsof the cross-tree transfer