feat(protocol): import sequential feeDataList in anchor#21360
feat(protocol): import sequential feeDataList in anchor#21360linoscope wants to merge 1 commit intol2_fee_vault_with_p_controllerfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e2ea92e32c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| feeVault.importProposalFeeList(_feeDataList); | ||
| _lastImportedFeeProposalId += uint48(listLength); |
There was a problem hiding this comment.
Validate feeDataList proposal-id continuity before import
_importFeeDataList now forwards _feeDataList without checking IDs and then advances _lastImportedFeeProposalId by list length only; if derivation/proving ever emits a non-contiguous or shifted list (for example starting above _lastImportedFeeProposalId + 1), the vault will reimburse those entries anyway and Anchor’s counter will drift, which can both skip reimbursements for missing proposal IDs and permit duplicate reimbursements later because L2FeeVault does not enforce ordering/deduplication. The previous implementation enforced sequential progression on-chain, so this is a regression in accounting safety.
Useful? React with 👍 / 👎.
Builds on top of the p-controller PR (#21350) which is build on top of the original L2 fee vault PR (#21214).
Problem
The original fee vault PR (#21214) tied fee-data import to proposal transitions: on the first block of each new proposal, the anchor had to import exactly one fee-data entry, and non-first blocks imported none. This coupling causes several issues:
Solution
Switch to range-based fee import via feeDataList:
lastImported + 1through the latest Inbox proposal visible in the anchor block, capped byMAX_FEE_DATA_LIST_LENGTH.MAX_FEE_DATA_LIST_LENGTHexists to keep anchor execution withinANCHOR_GAS_LIMITby bounding fee-data catch-up work (and payload size) per anchor transaction.This addresses each issue above:
Notes for Derivation/Proving
One implementation approach is to track each proposal's parent/ancestor link and its origin L1 block number. When an anchor advances past the origin block number of previously unimported proposals, those proposals are included in the anchor's feeDataList in order, up to MAX_FEE_DATA_LIST_LENGTH.