refactor(inbox): remove activation mechanism#21475
Conversation
Remove the explicit inbox activation flow that required a separate owner call before the Inbox could accept proposals. The activation is now assumed to have occurred in a prior contract version, with state initialized during upgrade. - Remove activate() function and ActivationRequired guard check from Inbox.sol - Remove LibInboxSetup.activate() function and related error handling - Update deployment script to no longer call inbox.activate() - Update tests to simulate pre-activated state using vm.store cheatcodes - Keep activationTimestamp state variable (deprecated) for storage layout compatibility - Gas savings: ~17 gas per propose() call from removing the activation check
Rename to _activationTimestamp with internal visibility since it is deprecated and no longer part of the public API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
File no longer contains activation tests after removing the activation mechanism. Rename to reflect its current contents. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba1548b07e
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Instead of requiring a separate activation step, init() now sets up the core state (nextProposalId, lastProposalBlockId, genesis hash, etc.) directly. This removes the need for vm.store hacks in tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move validateConfig, its constant, and errors from the external library into the Inbox contract as a private function, removing the DELEGATECALL overhead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ation (#21493) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @dantaik's task in 1m 57s —— View job PR Review: refactor(inbox): remove activation mechanism
SummaryClean refactor that completes the activation removal. The initialization logic previously split across Issues1. Storage layout documentation mismatch ( The layout files (auto-generated) were updated to show uint48 public activationTimestamp; // Inbox.sol:127The layout files are inconsistent with the live code. If someone reads these layout docs during an upgrade safety review, they'll see a variable name that doesn't exist. The layout script should be re-run against the current code (or the layout files were generated from an intermediate version where the variable was briefly renamed). 2. The 3.
Minor
What's Good
|
|
@davidtaikocha please take another look |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 635d7ad4a8
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| activationTimestamp = _activationTimestamp; | ||
| _coreState.nextProposalId = 1; | ||
| _coreState.lastProposalBlockId = 1; | ||
| _coreState.lastFinalizedTimestamp = uint48(block.timestamp); | ||
| _coreState.lastFinalizedBlockHash = _genesisBlockHash; |
There was a problem hiding this comment.
Keep a way to reseed the fork parent hash after deploy
Checked the mainnet/Hoodi deployment flow in packages/protocol/script/layer1/core/DeployShastaContracts.s.sol:125-128: we still predeploy Shasta and only switch SignalService at shastaForkTimestamp. This refactor now stores _coreState.lastFinalizedBlockHash once during init() and removes the only post-deployment path that used to update it. If the Pacaya head reorgs after deployment but before the fork, the first Shasta proof will hit ParentBlockHashMismatch in Inbox.prove() (packages/protocol/contracts/layer1/core/impl/Inbox.sol:283-286) and the fork is stuck until the proxy is redeployed.
Useful? React with 👍 / 👎.
| ) | ||
| ), | ||
| data: abi.encodeCall(Inbox.init, config.activator) | ||
| data: abi.encodeCall(Inbox.init, (config.activator, config.l2GenesisHash, uint48(block.timestamp))) |
There was a problem hiding this comment.
Initialize activationTimestamp from the configured fork time
In the mainnet/Hoodi path, this passes block.timestamp into Inbox.init() even though the same script already has the real fork time in config.shastaForkTimestamp. taiko-client treats activationTimestamp as the L1 block where Shasta started (packages/taiko-client/pkg/rpc/methods.go:1139-1155) and uses it to reset L1Current for the first Shasta proposal (packages/taiko-client/driver/state/l1_current.go:76-79). If these contracts are deployed ahead of the scheduled fork, proposal 1 will be anchored to the deployment block instead of the actual fork block, which skews client bootstrap and reorg recovery around genesis.
Useful? React with 👍 / 👎.
Remove the explicit inbox activation flow that previously required a separate owner call before the Inbox could accept proposals. The activation is now assumed to have occurred in a prior contract version, with state properly initialized during contract upgrade.
This change simplifies the deployment flow and reduces gas consumption (~17 gas per proposal) by eliminating the activation check. The activationTimestamp state variable is retained but deprecated to maintain storage layout compatibility for proxy upgrades.