feat(protocol): add immutable ejector manager role to preconf whitelist#21382
feat(protocol): add immutable ejector manager role to preconf whitelist#21382ggonzalez94 wants to merge 5 commits intotaiko-alethia-protocol-v3.0.0from
Conversation
|
Claude finished @ggonzalez94's task in 1m 54s —— View job PR Review:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e16e708a7f
ℹ️ 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".
|
|
||
| function _loadConfig() private view returns (DeploymentConfig memory config) { | ||
| config.contractOwner = vm.envAddress("CONTRACT_OWNER"); | ||
| config.ejectorManager = vm.envOr("EJECTOR_MANAGER", config.contractOwner); |
There was a problem hiding this comment.
Preserve existing ejector manager on upgrades
When PRECONF_WHITELIST points to an existing proxy, this script upgrades it using new PreconfWhitelist(config.ejectorManager), but _loadConfig defaults ejectorManager to CONTRACT_OWNER whenever EJECTOR_MANAGER is unset. That means any upgrade run that forgets EJECTOR_MANAGER will silently overwrite a previously configured dedicated manager and revoke its ability to call setEjecter, which can break operational ejection workflows; consider requiring EJECTOR_MANAGER for upgrade flows or reading/persisting the current manager explicitly.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1cd379786a
ℹ️ 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".
| TimestampMaxOffset = 12 * 1800 | ||
| // AnchorMinOffset The minimum anchor block number offset from the proposal origin block number, refer to LibManifest.MIN_ANCHOR_OFFSET. | ||
| AnchorMinOffset = 2 | ||
| // AnchorMaxOffset The maximum anchor block number offset from the proposal origin block number, refer to LibManifest.MAX_ANCHOR_OFFSET. | ||
| AnchorMaxOffset = 128 | ||
| AnchorMaxOffset = 1800 |
There was a problem hiding this comment.
Synchronize manifest offsets across client implementations
Update the companion Rust Shasta constants in packages/taiko-client-rs/crates/protocol/src/shasta/constants.rs when changing these Go offsets, otherwise mixed Go/Rust deployments will validate different payload windows (1800/21600 here vs 128/1536 in Rust) and can disagree on proposal validity during derivation. This commit introduces that cross-client mismatch by changing only the Go binding values.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable autofix in the Cursor dashboard.
packages/protocol/docs/Derivation.md
Outdated
| | Constant | Value | Description | | ||
| | -------------------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | **DERIVATION_SOURCE_MAX_BLOCKS** | `192` | The per-derivation-source block limit. If we assume block times of seconds,192 blocks will cover an Ethereum epoch. | | ||
| | **MAX_ANCHOR_OFFSET** | `1800` | The maximum anchor block number offset from the proposal origin block number (6 hours of L1 blocks). | |
There was a problem hiding this comment.
Is there any specific reason we need such a large anchor offset? It introduces significant overhead for the prover/Raiko, since we have to walk back block-by-block to the anchor. In the worst case, that’s ~1800 steps, which means tens of network I/O operations and ~1800 additional block-hash calculations.
Summary
_ejectorManagertoPreconfWhitelistand wire it via constructorsetEjecterto be called by either owner or ejector managerPreconfWhitelistconstructor callsites in protocol scripts/testsValidation
forge test --match-path test/layer1/preconf/whitelist/PreconfWhitelist.t.solforge test --match-path test/layer1/core/inbox/InboxWhitelistProver.t.solNote
Medium Risk
Changes access control on
PreconfWhitelist.setEjecterand introduces a new constructor parameter that must be wired correctly during deployment/upgrade; misconfiguration could block or broaden ejecter administration.Overview
Adds an immutable
_ejectorManagerrole toPreconfWhitelist(constructor-enforced non-zero) and expandssetEjecterauthorization from owner-only to owner or ejector manager via a newonlyOwnerOrEjectorManagermodifier, with new revert errors.Updates deployment/upgrade scripts and tests to pass the new constructor arg (including
EJECTOR_MANAGERenv var defaulting toCONTRACT_OWNER), and adds coverage for manager access and unauthorized caller reverts. Also updatesDerivation.mdto document chain-specificMAX_ANCHOR_OFFSET/TIMESTAMP_MAX_OFFSETvalues and refreshes gas report snapshots.Written by Cursor Bugbot for commit 531729d. This will update automatically on new commits. Configure here.