Commit 54140ae
Add support for EIP-7702 (polkadot-evm#1693)
* feat: ✨ add support for EIP-7702
* chore: ⬆️ use temporary fork of ethereum crate
* feat: ✨ update to ethereum crate v3 structs
* feat: ⬆️ upgrade evm crate
* feat: ✨ add EIP-7702 support to RPC
* fix: ⬆️ upgrade evm crate
* feat: ✨ upgrade evm crate
* feat: ✨ add EIP-7702 support to EthDevSigner
* test: 🔥 temporarily remove EIP-7702 tests
* feat: ⬆️ upgrade ethereum and evm crates
* fix: 🐛 properly convert authorization list to evm's data type
* fix: 🔥 fix logic
* fix: 🐛 fix usage of authorization list throughout the codebase
* style: 🎨 fmt
* fix: ⬆️ upgrade evm
* refactor: 🚨 silence lint error
* style: 🎨 fmt
* refactor: 🔥 remove unused imports
* fix: ⬆️ upgrade config to pectra
* fix: 🐛 manage API v6 case in Eth::call
* fix: 🐛 manage API v6 case in Eth::estimate_gas
* chore: 🔥 remove unused dependencies
* test: ✅ add unit tests for EIP-7702
* test: ✅ add integration tests for EIP-7702
* style: 🎨 fmt
* refactor: ⬆️ upgrade evm crate
* fix: 🐛 propagate std feature to ethereum-ext
* refactor: ♻️ use upstream evm crate
* refactor: 🔥 remove ethereum-ext temporary dependency
* style: 🎨 format TS code
* refactor: ♻️ ignore lint warning
* feat: ⬆️ upgrade evm/ethereum dependencies
* feat: ✨ add validation error for EIP-7702 empty authorization list
* style: 🎨 format code
* refactor: 🔥 remove unused const
* test: 🧪 add failing test for EIP-7702 authoriations
* fix: 🐛 fix authorization creation in tests
* refactor: ⬆️ use evm release on crates.io
* style: 🎨 format code
* feat: ✨ record delegation resolution external operation
* revert: 🔥 remove old TODOs
* fix: 🐛 add missing semicolon
* feat: add comprehensive EIP-7702 validation at Substrate level
- Add chain ID validation for authorization tuples
- Add maximum authorization list size validation (255 items)
- Add new error types: InvalidAuthorizationChainId, AuthorizationListTooLarge
- Map new validation errors to appropriate EVM pallet errors
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: add documentation for EIP-7702 gas costs and improve error handling
- Add documentation about EIP-7702 gas costs in runtime estimation
- Add error handling for new validation errors in Ethereum pallet
- Add user-friendly error messages for EIP-7702 validation failures in RPC
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: 🐛 add missing case in error conversion
* fix: correct authorization signature format in TypeScript tests
- Fix EIP-7702 authorization signature creation to use proper spec format
- Use magic byte 0x05 and RLP encoding as per EIP-7702 specification
- Rust tests already used correct format, only TS tests needed fixing
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* test: add comprehensive EIP-7702 validation tests
- Add tests for empty authorization list validation
- Add tests for authorization list size limits (max 255 items)
- Add tests for chain ID validation (must be 0 or match transaction chain ID)
- Add tests for valid authorization list scenarios
- Add tests for non-EIP-7702 transaction validation skipping
- Add missing InvalidAuthorizationChainId error variant and mapping
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: add comprehensive documentation for EIP-7702 validation functions
- Add detailed documentation for with_eip7702_authorization_list function
- Document validation rules and responsibilities split between Substrate/EVM levels
- Add comprehensive error type documentation with security rationale
- Include usage examples and parameter descriptions
- Clarify the distinction between Substrate and EVM-level validation
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* revert: 🔥 remove InvalidAuthorizationChainId validation error
* docs: 📝 digest docs
* style: 🎨 format
* fix: 🐛 account for authentication list items in the proof size base cost
* refactor: ♻️ return error for unsupported API version
* refactor: ♻️ refactor TransactionRequest to TransactionMessage conversion
* style: 🎨 format
* refactor: ♻️ reduce code duplication
* fix: 🐛 fix delegation code length in test
* test: ✅ actually check gas consumption in EIP-7702
* fix: 🐛 treat DelegationResolution just as a second AddressCodeRead
* refactor: 🎨 use serde rename_all directive
* docs: 📝 improve AuthorizationListTooLarge docs
* fix: 🐛 add EIP7702 variant to TxType
* feat: ⬆️ upgrade ethers.js
* test: 🐛 first revision of the integration tests for EIP-7702
* fix: 🐛 second revision of the integration tests for EIP-7702
* fix: 🐛 upgrade evm
* fix: 🐛 fix authorization nonce in test
* feat: ✨ add EthereumBlockWrapper
* refactor: 🔥 remove CurrentBlock v0 to v2 migrations
* refactor: ♻️ clippy
* refactor: ♻️ refactor EthereumBlockWrapper decoding
* revert: ⏪ restore block migration functions
* Revert "refactor: ♻️ refactor EthereumBlockWrapper decoding"
This reverts commit c0923c7.
* Revert "refactor: ♻️ clippy"
This reverts commit 6521a03.
* Revert "feat: ✨ add EthereumBlockWrapper"
This reverts commit 88b8fbc.
* feat: ✨ add block v2 to v3 migration methods
* fix: 🐛 fix typo in post_migrate_block_v3
* refactor: ♻️ rename size_limit to create_contract_limit
* fix: 🐛 account for empty authorization list cost in template
* fix: 🐛 the base cost for the authorization list is already accounted for in the encoding
* revert: ⏪ block v2 is still a valid block v3
* fix: 🔒 validate authorizations signatures on extrinsic call
* fix: 🐛 add ethereum/std to std feature
* fix: 🔒 properly validate authorization list
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 0d0db7b commit 54140ae
49 files changed
Lines changed: 2399 additions & 333 deletions
File tree
- client
- db/src/sql
- mapping-sync/src/sql
- rpc-core/src/types
- rpc-v2/types/src/transaction
- rpc/src
- cache
- eth
- storage/src
- overrides
- frame
- ethereum/src
- tests
- evm
- src
- runner
- precompiles/src/testing
- primitives
- consensus/src
- ethereum/src
- evm/src
- rpc/src
- template/runtime
- src
- ts-tests
- contracts
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
520 | | - | |
521 | | - | |
522 | | - | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
523 | 524 | | |
524 | 525 | | |
525 | 526 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
528 | | - | |
| 528 | + | |
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
| |||
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
599 | | - | |
| 599 | + | |
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | | - | |
| 609 | + | |
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
| |||
829 | 829 | | |
830 | 830 | | |
831 | 831 | | |
832 | | - | |
| 832 | + | |
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
| |||
839 | 839 | | |
840 | 840 | | |
841 | 841 | | |
842 | | - | |
| 842 | + | |
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
| 114 | + | |
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
| |||
132 | 138 | | |
133 | 139 | | |
134 | 140 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
139 | 146 | | |
140 | 147 | | |
141 | 148 | | |
| |||
159 | 166 | | |
160 | 167 | | |
161 | 168 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
166 | 201 | | |
167 | 202 | | |
168 | 203 | | |
| |||
0 commit comments