forked from ithacaxyz/account
-
Notifications
You must be signed in to change notification settings - Fork 1
# Sequence diagram for Merkle-backed wrapped signature verification in IthacaAccount #31
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentationduplicateThis issue or pull request already existsThis issue or pull request already existsenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededinvalidThis doesn't seem rightThis doesn't seem rightquestionFurther information is requestedFurther information is requestedwontfixThis will not be worked onThis will not be worked on
Description
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentationduplicateThis issue or pull request already existsThis issue or pull request already existsenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededinvalidThis doesn't seem rightThis doesn't seem rightquestionFurther information is requestedFurther information is requestedwontfixThis will not be worked onThis will not be worked on
Projects
StatusShow more project fields
Backlog
StatusShow more project fields
Todo
Reviewer's Guide
Adds Merkle tree–backed wrapped signature support to IthacaAccount, extends unwrapAndValidateSignature with a Merkle flag, fixes EIP712 domain handling in tests, and updates tests/benchmarks (including a new orchestrator benchmark) to use the extended wrapped signature format and cover Merkle verification paths.
Sequence diagram for Merkle-backed wrapped signature verification in IthacaAccount
sequenceDiagram actor User participant Orchestrator participant IthacaAccount participant MerkleProofLib User->>Orchestrator: submit_authorized_action(wrappedSignature) Orchestrator->>IthacaAccount: unwrapAndValidateSignature(digest, wrappedSignature) IthacaAccount->>IthacaAccount: detect_wrapped_signature() IthacaAccount->>IthacaAccount: parse_keyHash_prehash_flag_merkle_flag() alt merkle_flag_is_set IthacaAccount->>IthacaAccount: _verifyMerkleSig(digest, innerMerkleSignature) IthacaAccount->>MerkleProofLib: verifyCalldata(proof, root, digest) alt merkle_proof_valid MerkleProofLib-->>IthacaAccount: true IthacaAccount->>IthacaAccount: unwrapAndValidateSignature(root, rootSig) IthacaAccount-->>Orchestrator: isValid,keyHash else merkle_proof_invalid MerkleProofLib-->>IthacaAccount: false IthacaAccount-->>Orchestrator: false,0x0 end else merkle_flag_not_set IthacaAccount->>IthacaAccount: optional_prehash(digest) IthacaAccount->>IthacaAccount: load_key_by_keyHash() IthacaAccount-->>Orchestrator: isValid,keyHash end Orchestrator-->>User: action_resultUpdated class diagram for IthacaAccount Merkle signature support
classDiagram class IthacaAccount { +unwrapAndValidateSignature(digest_bytes32, signature_bytes_calldata) bool,bytes32 -_verifyMerkleSig(digest_bytes32, signature_bytes_calldata) bool,bytes32 +_eip712Version() string,string } class MerkleProofLib { +verifyCalldata(proof_bytes32_array_calldata, root_bytes32, leaf_bytes32) bool } class EfficientHashLib { +sha2(input_bytes32) bytes32 } class LibBytes { +loadCalldata(data_bytes_calldata, offset_uint256) bytes32 +truncatedCalldata(data_bytes_calldata, newLength_uint256) bytes_calldata } class IIthacaAccount class EIP712 class GuardedExecutor IthacaAccount --|> IIthacaAccount IthacaAccount --|> EIP712 IthacaAccount --|> GuardedExecutor IthacaAccount ..> MerkleProofLib : uses IthacaAccount ..> EfficientHashLib : uses IthacaAccount ..> LibBytes : usesFile-Level Changes
src/IthacaAccount.solsrc/IthacaAccount.soltest/Account.t.soltest/Base.t.soltest/Benchmark.t.soltest/Orchestrator.t.soltest/SimulateExecute.t.solsnapshots/BenchmarkTest.jsontest/Account.t.solTips and commands
Interacting with Sourcery
@sourcery-ai reviewon the pull request.issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it.@sourcery-aianywhere in the pullrequest title to generate a title at any time. You can also comment
@sourcery-ai titleon the pull request to (re-)generate the title at any time.@sourcery-ai summaryanywhere inthe pull request body to generate a PR summary at any time exactly where you
want it. You can also comment
@sourcery-ai summaryon the pull request to(re-)generate the summary at any time.
@sourcery-ai guideon the pullrequest to (re-)generate the reviewer's guide at any time.
@sourcery-ai resolveon thepull request to resolve all Sourcery comments. Useful if you've already
addressed all the comments and don't want to see them anymore.
@sourcery-ai dismisson the pullrequest to dismiss all existing Sourcery reviews. Especially useful if you
want to start fresh with a new review - don't forget to comment
@sourcery-ai reviewto trigger a new review!Customizing Your Experience
Access your dashboard to:
summary, the reviewer's guide, and others.
Getting Help
Originally posted by @sourcery-ai[bot] in #30 (comment)