fix(security): SC-01 paymaster sig_type, SC-02 AA reconciliation, H-4 hickory advisory#51
Merged
Conversation
… hickory advisory Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens AA security semantics by deriving paymaster signature algorithms from registered paymaster key/address bindings, enforcing AA outer-value budgets against inner call values, and explicitly tracking hickory advisories that remain transitively pulled in through libp2p.
Changes:
- Adds paymaster signature-type inference for mixed-algorithm sponsored AA validation.
- Enforces
Σ inner.value <= tx.valuein AA construction, validation, execution, and related tests/helpers. - Adds cargo-audit advisory ignores for unresolved hickory/libp2p transitive advisories.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.cargo/audit.toml |
Adds cargo-audit ignore entries for hickory advisories. |
Cargo.toml |
Adds workspace audit metadata ignores for the same advisories. |
crates/core/src/transaction.rs |
Adds AA inner value summing and constructor-level overspend rejection. |
crates/crypto/src/multi.rs |
Adds address-based signature type inference helper. |
crates/crypto/src/lib.rs |
Re-exports the new inference helper. |
crates/evm/src/executor.rs |
Adds execution-time AA outer-value reconciliation and tests. |
crates/evm/src/tx_validation.rs |
Updates AA balance checks, structural validation, and paymaster signature verification. |
crates/rpc/src/handler/mod.rs |
Updates an AA test transaction value to satisfy the new invariant. |
tests/e2e/aa_batch_test.rs |
Computes AA outer value from inner calls in batch test helper. |
tests/e2e/aa_sponsored_test.rs |
Computes AA outer value from inner calls in sponsored test helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+344
to
+350
| let declared_value = tx.value; | ||
| let inner_value_sum = bundle.inner_value_sum(); | ||
| if inner_value_sum > declared_value { | ||
| return Err(ExecutorError::Evm(format!( | ||
| "aa bundle inner value sum ({inner_value_sum}) exceeds outer value ({declared_value})" | ||
| ))); | ||
| } |
Comment on lines
+843
to
+846
| pub fn inner_value_sum(&self) -> U256 { | ||
| self.inner_calls | ||
| .iter() | ||
| .fold(U256::ZERO, |acc, c| acc.saturating_add(c.value)) |
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.
Summary
.cargo/audit.tomlbecause libp2p 0.56 still pulls hickory 0.25.x transitively with no compatible upgrade path in this workspaceValidation
cargo fmt --allcargo clippy --workspace -- -D warningscargo test --workspace(ran >10 minutes and exposedshell-e2e-tests --test aa_batch_test)cargo test -p shell-corecargo test -p shell-evmcargo test -p shell-rpccargo test -p shell-e2e-tests --test aa_batch_testcargo test -p shell-e2e-tests --test aa_sponsored_testcargo test -p shell-consensuscargo audit -qNotes
Impact-Deferred: shell-chain:
make e2ewas not run in this session.Impact-Deferred: shell-sdk: downstream SDK verification/build was not run in this shell-chain fix session.
Impact-Deferred: shell-chain-white-paper: white-paper wording review was not performed in this code fix session.
Impact-Deferred: shell-dex: downstream DEX build/smoke verification was not run in this shell-chain fix session.
Impact-Deferred: shell-explorer: downstream explorer smoke verification was not run in this shell-chain fix session.
Impact-Deferred: shella-chrome-wallet: downstream wallet verification was not run in this shell-chain fix session.
Impact-Deferred: shell-site: downstream site/docs verification was not run in this shell-chain fix session.