-
Notifications
You must be signed in to change notification settings - Fork 51
feat: add interop access list FMA #252
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
Merged
mds1
merged 6 commits into
ethereum-optimism:main
from
defi-wonderland:feat/interop-access-list-fma
Apr 15, 2025
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
698e475
feat: add interop access list FMA
agusduha 073c7d8
fix: merge FM1 and FM5, remove FM3 and FM4
agusduha 344a3a0
feat: add new unexpected storage warming FM
agusduha f82e5e6
fix: add initial reviewer
agusduha 42eefed
fix: FM2
agusduha eceb66a
fix: change status
agusduha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| # Interop Access List: Failure Modes and Recovery Path Analysis | ||
|
|
||
| | Author | Agusduha, Skeletor-spaceman | | ||
| | ------------------- | ---------------------------- | | ||
| | Created at | 2025-02-05 | | ||
| | Initial Reviewers | [Initial Reviewer Names] | | ||
| | Needs Approval From | Matt Solomon, Kelvin Fichter | | ||
| | Status | Draft | | ||
|
|
||
| ## Introduction | ||
|
|
||
| This document covers the failure modes and recovery paths for the access list validation mechanism in cross-chain message processing. The access list enhancement aims to prevent denial of service (DoS) attacks and enable cheap pre-validation of cross-chain messages. | ||
|
|
||
| The following components are included: | ||
|
|
||
| - **Contracts**: | ||
| - Updates to `CrossL2Inbox`: Implements gas introspection to validate `ExecutingMessage` transactions | ||
| - Storage slot warming mechanism for message validation | ||
| - Checksum calculation and verification logic | ||
|
|
||
| Below are references for this project: | ||
|
|
||
| - Design PR: [Access List design](https://github.com/ethereum-optimism/design-docs/pull/214) | ||
| - Specs PR: [Access List Validation](https://github.com/ethereum-optimism/specs/pull/612) | ||
|
|
||
| ## Failure Modes and Recovery Paths | ||
|
|
||
| ### FM1: Gas Schedule Changes Break Validation | ||
|
|
||
| - **Description:** The validation mechanism relies on gas introspection to determine if storage slots are warm. If the EVM's gas schedule changes, particularly around storage access costs, it could break the validation logic. | ||
| - **Risk Assessment:** High | ||
| - Potential Impact: Critical. Changes to gas costs could cause all cross-chain message validation to fail or allow invalid messages to pass. | ||
| - Likelihood: Low. While gas schedule changes are rare, they do occur during network upgrades. | ||
| - **Mitigations:** | ||
| - Set `WARM_READ_THRESHOLD` conservatively to account for potential fluctuations | ||
| - Add tests that verify validation works across different gas cost scenarios | ||
| - Document gas schedule dependencies clearly for future upgrades | ||
| - **Detection:** Monitor for network upgrades that modify storage access gas costs. Run validation tests before accepting upgrades. | ||
| - **Recovery Path(s):** Deploy contract upgrade with adjusted thresholds if gas schedule changes significantly. | ||
|
|
||
| ### FM2: Storage Slot Collision | ||
|
|
||
| - **Description:** The checksum calculation for message validation uses storage slots that could potentially collide with other slots from the access list, leading to false validation of messages. | ||
| - **Risk Assessment:** High | ||
| - Potential Impact: Critical. Storage collisions could allow unauthorized messages to be validated. | ||
|
tynes marked this conversation as resolved.
Outdated
|
||
| - Likelihood: Low. Storage slots are carefully calculated using Identifier and message hash parameter. The way both are encoded in the contract’s logic needs to be flawed for this case to happen. | ||
|
tynes marked this conversation as resolved.
Outdated
|
||
| - **Mitigations** | ||
| - Implement robust checksum calculation that minimizes collision risk | ||
| - Add tests verifying no collisions occur with expected storage patterns | ||
| - Document storage layout and slot calculation methodology | ||
| - **Detection:** Monitor for unexpected message validations that could indicate storage collisions. | ||
| - **Recovery Path(s):** Deploy contract upgrade with revised storage slot calculation if collisions are detected and update ALL off-chain tools and SDKs that generate these hashes on the access list. | ||
|
|
||
| ### FM3: Access List Manipulation | ||
|
|
||
| - **Description:** Malicious actors could attempt to manipulate transaction access lists to force validation of unauthorized messages. | ||
|
tynes marked this conversation as resolved.
Outdated
|
||
| - **Risk Assessment:** High | ||
| - Potential Impact: High. Could allow unauthorized message execution. | ||
| - Likelihood: Medium. Access lists are user-controlled transaction parameters. | ||
| - **Mitigations:** | ||
| - Ensure checksum calculation is cryptographically sound | ||
| - Implement proper validation of access list entries | ||
| - Add checks for maximum access list size | ||
|
tynes marked this conversation as resolved.
Outdated
|
||
| - **Detection:** Monitor for unusual patterns in access list usage and message validation attempts. | ||
| - **Recovery Path(s):** Pause message processing if manipulation is detected. Deploy fixes for validation logic. | ||
|
|
||
| ### FM4: Relayer Implementation Errors | ||
|
|
||
| - **Description:** Relayers may implement access list construction incorrectly, leading to failed message validation even for valid messages. One possible cause for this could be the checksum calculation not matching between clients and on-chain logic. | ||
| - **Risk Assessment:** Medium | ||
| - Potential Impact: Medium. Could cause temporary disruption of cross-chain messaging. | ||
| - Likelihood: Medium. Relayers need to adopt new patterns for access list construction. | ||
| - **Mitigations:** | ||
| - Provide clear documentation and examples for relayer implementations | ||
| - Create reference implementations and test suites | ||
| - Add monitoring for failed validation attempts | ||
| - **Detection:** Track validation failure rates and patterns across relayers. | ||
| - **Recovery Path(s):** Work with relayer implementations to fix access list construction. | ||
|
|
||
| ### FM5: Compiler Optimizations Break Gas Introspection | ||
|
tynes marked this conversation as resolved.
Outdated
|
||
|
|
||
| - **Description:** Future changes in the Solidity compiler, via-IR pipeline, or optimizer settings could eliminate or modify the `SLOAD` operation used for gas introspection. This could cause the contract to incorrectly determine that a cold storage slot is warm, as the gas cost check would be optimized away. | ||
| - **Risk Assessment:** High | ||
| - Potential Impact: Critical. Could allow validation of unauthorized messages by bypassing the access list check entirely. | ||
| - Likelihood: Medium. Compiler optimizations regularly evolve and could unexpectedly affect low-level gas introspection. | ||
| - **Mitigations:** | ||
| - Lock compiler version and optimization settings | ||
| - Document compiler dependencies and optimization constraints | ||
| - **Detection:** | ||
| - Regular bytecode verification to ensure `SLOAD` operations remain in place | ||
| - Test suite that verifies gas costs match expectations | ||
| - **Recovery Path(s):** | ||
| - Deploy contract upgrade with revised gas introspection implementation that cannot be optimized away | ||
| - Roll back to previous compiler version if optimization cannot be disabled | ||
|
|
||
| ### Generic items we need to take into account: | ||
|
|
||
| See [fma-generic-contracts.md](https://github.com/ethereum-optimism/design-docs/blob/main/security/fma-generic-contracts.md). | ||
|
|
||
| - [x] Check this box to confirm that these items have been considered and updated if necessary. | ||
|
|
||
| ## Action Items | ||
|
|
||
| - [ ] FM1: Implement comprehensive gas schedule testing | ||
| - [ ] FM1: Document gas schedule dependencies | ||
| - [ ] FM2: Create storage layout documentation | ||
| - [ ] FM2: Implement slots collision tests | ||
| - [ ] FM3: Add access list validation tests | ||
| - [ ] FM3: Document security considerations for access list handling | ||
| - [ ] FM4: Create relayer implementation guide | ||
| - [ ] FM4: Develop relayer test suite | ||
| - [ ] FM5: Document compiler version and optimization constraints | ||
|
|
||
| ## Audit Requirements | ||
|
|
||
| The access list validation mechanism in `CrossL2Inbox` requires an audit before production deployment, with particular focus on: | ||
|
|
||
| - Gas introspection implementation | ||
| - Storage slot calculation and collision resistance | ||
| - Access list validation logic | ||
| - Integration with existing message passing system | ||
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.
Uh oh!
There was an error while loading. Please reload this page.