-
Notifications
You must be signed in to change notification settings - Fork 105
test: permit system design validation #1419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2542,3 +2542,279 @@ pub fn init_omnipol() { | |||||||||||||||||||
| TREASURY_ACCOUNT_INIT_BALANCE, | ||||||||||||||||||||
| )); | ||||||||||||||||||||
| } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| // Tests validating that the CALLPERMIT precompile and dispatch_permit share | ||||||||||||||||||||
| // a single permit domain by design. dispatch_permit is a self-relay mechanism: | ||||||||||||||||||||
| // the user signs one permit and submits it as an unsigned extrinsic to pay fees | ||||||||||||||||||||
| // in a non-native currency. The shared EIP-712 digest and nonce space are intentional. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| #[test] | ||||||||||||||||||||
| fn permit_is_accepted_by_both_callpermit_and_dispatch_permit_by_design() { | ||||||||||||||||||||
| // The CALLPERMIT precompile and dispatch_permit share the same EIP-712 domain | ||||||||||||||||||||
| // and nonce space. A permit signed once can be submitted via either interface. | ||||||||||||||||||||
| // This is by design — dispatch_permit is a self-relay path, not a separate trust domain. | ||||||||||||||||||||
|
Comment on lines
+2552
to
+2555
|
||||||||||||||||||||
| fn permit_is_accepted_by_both_callpermit_and_dispatch_permit_by_design() { | |
| // The CALLPERMIT precompile and dispatch_permit share the same EIP-712 domain | |
| // and nonce space. A permit signed once can be submitted via either interface. | |
| // This is by design — dispatch_permit is a self-relay path, not a separate trust domain. | |
| fn callpermit_domain_permit_is_accepted_by_dispatch_permit_by_design() { | |
| // The CALLPERMIT precompile and dispatch_permit share the same EIP-712 domain | |
| // and nonce space. This test verifies that a permit signed for that shared | |
| // domain is accepted by dispatch_permit, which is a self-relay path rather | |
| // than a separate trust domain. |
Copilot
AI
Apr 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test description says it prevents permit reuse “across submission paths”, but it only checks replay rejection within the dispatch_permit unsigned validation path (no CALLPERMIT submission is attempted). Either rename to match the current coverage, or add an assertion that the same signed permit is also rejected when routed through the CALLPERMIT precompile (to truly validate the shared nonce space across both interfaces).
| fn shared_nonce_prevents_permit_reuse_across_submission_paths() { | |
| // The shared nonce space ensures a permit can only be used once, regardless | |
| // of which interface it was submitted through. This is the intended replay protection. | |
| fn shared_nonce_prevents_dispatch_permit_replay() { | |
| // The shared nonce space ensures the same signed permit cannot be replayed | |
| // through the dispatch_permit submission path. This validates replay protection here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pallet-proxywas removed from this crate’s dependencies, butintegration-tests/src/evm.rsstill referencespallet_proxy::Call::proxy(e.g. around lines ~5318 and ~5448). This will fail to compile unless the dependency is restored (or the tests are refactored to avoid directpallet_proxyreferences).