Repository navigation
feat(protocol,taiko-client): raise inbox basefee sharing to 100% and rotate raiko2 to v0.9.0 (Proposal0026)
#22127
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
Merged
Changes from 34 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
0102df7
feat(protocol): Proposal0024 raises the inbox basefee sharing percent…
davidtaikocha 9deb5b5
chore(protocol): drop the comment on ZK_REQUIRED_VERIFIER
davidtaikocha 4dc19c4
feat(protocol): Proposal0024 points at the deployed MainnetInbox impl…
davidtaikocha d1d8823
docs(protocol): drop the status block from the Proposal0024 runbook
davidtaikocha 1514d5c
docs(protocol): shorten the Proposal0024 rationale TODO
davidtaikocha 4919198
docs(protocol): drop the Current State section from the Proposal0024 …
davidtaikocha c399fea
Update protocol generated artifacts
davidtaikocha fd6b3d3
docs(protocol): point the Proposal0024 preconfer note at the Catalyst…
davidtaikocha 617802a
docs(protocol): keep the Proposal0024 preconfer note free of PR refer…
davidtaikocha 08aedfc
fix(protocol): keep the Proposal0024 fork rehearsal within the via-IR…
davidtaikocha c4bde77
Apply suggestion from @dantaik
dantaik 993c55d
Update packages/protocol/script/layer1/mainnet/DeployInboxUpgradeL1.s…
dantaik a691e7d
docs(protocol): write the Proposal0024 rationale
claude bdc9206
feat(protocol): raise the devnet inbox basefee sharing percentage to …
claude 24dbb79
fix(protocol): finish the ZKEVM_VERIFIER rename
claude 9e580cc
revert(protocol): keep the verifier constant named ZK_REQUIRED_VERIFIER
claude e319834
fix(protocol): pin the live basefee sharing percentage in DeployInbox…
claude a1a7bda
Merge branch 'main' into claude/proposal0024-basefee-sharing-100
dantaik 8e6942d
Merge branch 'main' into claude/proposal0024-basefee-sharing-100
davidtaikocha 2447a95
refactor(protocol): renumber Proposal0023/0024 to match the DAO propo…
dantaik 91b7711
Merge branch 'main' into claude/proposal0024-basefee-sharing-100
dantaik 8bd58ad
refactor(protocol): renumber Proposal0023 to match the DAO proposal ID
dantaik 9e32a29
Revert "refactor(protocol): renumber Proposal0023/0024 to match the D…
dantaik 36b8a96
Merge branch 'refactor/proposal0023-to-0024' into claude/proposal0024…
dantaik 44e45e0
Merge branch 'main' into claude/proposal0024-basefee-sharing-100
dantaik 492d140
refactor(protocol): renumber Proposal0025 to Proposal0026
claude dee6446
Merge origin/main into Proposal0026 branch
davidtaikocha efe2619
docs(protocol): pin Proposal0026 bytecode verification to deployment
davidtaikocha 8070ec3
test(protocol): pin Proposal0026 fork rehearsal block
dd70fb0
Merge branch 'main' into claude/proposal0024-basefee-sharing-100
davidtaikocha 1d155df
feat(protocol): rotate raiko2 artifacts to v0.9.0-rc1 (Proposal0026) …
smtmfft d4bec46
refactor(protocol): move the Proposal0026 SGX MRENCLAVEs into LibSGXC…
davidtaikocha 1e6a874
docs(protocol): correct the MainnetInbox layout entry count in Propos…
claude 0f9e64b
Merge branch 'main' into claude/proposal0024-basefee-sharing-100
dantaik 6b1adef
feat(protocol): rotate Proposal0026 artifacts to raiko2 v0.9.0 (#22178)
smtmfft a3d4cdc
chore(protocol): drop the unused raiko2 v0.9.0-rc1 constants
davidtaikocha 4559c11
docs(protocol): add Proposal0026 artifact verification (#22182)
smtmfft 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
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
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
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
20 changes: 20 additions & 0 deletions
20
packages/protocol/contracts/layer1/verifiers/LibSGXConstants.sol
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,20 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.24; | ||
|
|
||
| /// @title LibSGXConstants | ||
| /// @custom:security-contact security@taiko.xyz | ||
| library LibSGXConstants { | ||
| bytes32 internal constant V0_8_0_RC1_SGXGETH_MR_ENCLAVE = | ||
| 0x5f7da556f3b75dcc71465030e1b7274e82df9e9120c0b3eaf5bb76246a514005; | ||
| bytes32 internal constant V0_8_0_RC1_SGXRETH_NON_EDMM_MR_ENCLAVE = | ||
| 0x3564b6a30089fcb3e2f69c19b22d23f84ce148387cd7a15f5c1df165b2ae5847; | ||
| bytes32 internal constant V0_8_0_RC1_SGXRETH_EDMM_MR_ENCLAVE = | ||
| 0xae2c7b92b2a71238226cb624ecd1171b66bf943cc372314affca0e6748ccecdf; | ||
|
|
||
| bytes32 internal constant V0_9_0_RC1_SGXGETH_MR_ENCLAVE = | ||
| 0x51701ed3fbd0bfdcea24a2e47ce9e30c5448ca9e4ad9b48bd1530d4a9c022fe4; | ||
| bytes32 internal constant V0_9_0_RC1_SGXRETH_NON_EDMM_MR_ENCLAVE = | ||
| 0xdc994928718200e16e0eb643486ea90e49970a897fd164e39b6ae11262b69ab9; | ||
| bytes32 internal constant V0_9_0_RC1_SGXRETH_EDMM_MR_ENCLAVE = | ||
| 0x7aaf74aaa95cf967844819e5e4504f28308541c0504e6642a12a75a4669f66a3; | ||
| } |
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
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
108 changes: 108 additions & 0 deletions
108
packages/protocol/script/layer1/mainnet/DeployInboxUpgradeL1.s.sol
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,108 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.24; | ||
|
|
||
| import { Script, console2 } from "forge-std/src/Script.sol"; | ||
| import { IInbox } from "src/layer1/core/iface/IInbox.sol"; | ||
| import { LibL1Addrs } from "src/layer1/mainnet/LibL1Addrs.sol"; | ||
| import { MainnetInbox } from "src/layer1/mainnet/MainnetInbox.sol"; | ||
|
|
||
| /// @title DeployInboxUpgradeL1 | ||
| /// @notice Deploys the `MainnetInbox` implementation that Proposal0026 upgrades the mainnet inbox | ||
| /// proxy to: the live configuration with `basefeeSharingPctg` raised from 75 to 100. | ||
| /// @dev Deploys a new implementation only. It does not upgrade the proxy and does not call any | ||
| /// initializer. | ||
| /// | ||
| /// The five constructor arguments reproduce the address immutables the live implementation | ||
| /// (`0x5253D4C91e80b880DdB54B78E74082Abe066F6b9`, deployed for Proposal0019) carries, and the | ||
| /// script reads them back from the live proxy before broadcasting so a drifted `LibL1Addrs` | ||
| /// constant aborts the run instead of baking into the new immutables. The numeric configuration is | ||
| /// hardcoded in `MainnetInbox`, so after deploying, the script compares the new implementation's | ||
| /// `getConfig()` with the live proxy's and aborts unless the basefee sharing percentage is the | ||
| /// only difference. | ||
| /// | ||
| /// Diffing the implementation's dependency tree from the commit the live implementation was built | ||
| /// from (`9078278909a43a83fc5bb2664f30b81eb5c967f6`) to `main` leaves `MainnetInbox.sol` and | ||
| /// `EssentialContract.sol`: #22058 folded the transient-storage reentry lock `MainnetInbox` | ||
| /// already used through `LibFasterReentryLock` into the base contract at the same slot constant. | ||
| /// So the only behavioural change this implementation ships is the sharing percentage. | ||
| /// | ||
| /// `MainnetInbox` links `LibForcedInclusion` and `LibInboxSetup` (both have `public` functions), | ||
| /// so the broadcast is three creates: the two libraries through CREATE2, then the implementation. | ||
| /// Verify all three landed before writing the logged address anywhere. | ||
| /// @custom:security-contact security@taiko.xyz | ||
| contract DeployInboxUpgradeL1 is Script { | ||
| /// @notice The basefee sharing percentage the new implementation must carry. | ||
| uint8 public constant NEW_BASEFEE_SHARING_PCTG = 100; | ||
|
|
||
| /// @notice The basefee sharing percentage the live proxy must still carry. `_checkConfig` | ||
| /// normalises this field away before comparing the new implementation with the live one, so | ||
| /// this constant is the only thing pinning what the upgrade moves away from. | ||
| uint8 public constant OLD_BASEFEE_SHARING_PCTG = 75; | ||
|
|
||
| error AlreadyUpgraded(); | ||
| error ConfigMismatch(); | ||
| error LiveProxyMismatch(); | ||
|
|
||
| /// @notice Deploys the implementation and logs the address Proposal0026 needs. | ||
| function run() external { | ||
| uint256 privateKey = vm.envUint("PRIVATE_KEY"); | ||
| require(privateKey != 0, "PRIVATE_KEY not set"); | ||
|
|
||
| IInbox.Config memory live = IInbox(LibL1Addrs.INBOX).getConfig(); | ||
| _checkLiveProxy(live); | ||
|
|
||
| vm.startBroadcast(privateKey); | ||
| MainnetInbox inboxImpl = new MainnetInbox( | ||
| LibL1Addrs.ZK_REQUIRED_VERIFIER, | ||
|
dantaik marked this conversation as resolved.
|
||
| LibL1Addrs.PRECONF_WHITELIST, | ||
| LibL1Addrs.PROVER_WHITELIST, | ||
| LibL1Addrs.SIGNAL_SERVICE, | ||
| LibL1Addrs.TAIKO_TOKEN | ||
| ); | ||
| vm.stopBroadcast(); | ||
|
|
||
| _checkConfig(inboxImpl.getConfig(), live); | ||
|
|
||
| console2.log("MAINNET_INBOX_NEW_IMPL:", address(inboxImpl)); | ||
| } | ||
|
|
||
| /// @dev Aborts unless the live proxy answers the five addresses this script is about to | ||
| /// compile into the new implementation — all five are reproduced from `LibL1Addrs`, and the | ||
| /// whole point of the upgrade is to keep them — and still shares exactly the old percentage, | ||
| /// so the script cannot be re-run to any effect once the proposal has executed. | ||
| /// @param _live The live proxy's configuration. | ||
| function _checkLiveProxy(IInbox.Config memory _live) private pure { | ||
| require( | ||
| _live.proofVerifier == LibL1Addrs.ZK_REQUIRED_VERIFIER | ||
| && _live.proposerChecker == LibL1Addrs.PRECONF_WHITELIST | ||
| && _live.proverWhitelist == LibL1Addrs.PROVER_WHITELIST | ||
| && _live.signalService == LibL1Addrs.SIGNAL_SERVICE | ||
| && _live.bondToken == LibL1Addrs.TAIKO_TOKEN, | ||
| LiveProxyMismatch() | ||
| ); | ||
| // The re-run case first, so it reports itself rather than as a generic mismatch. | ||
| require(_live.basefeeSharingPctg != NEW_BASEFEE_SHARING_PCTG, AlreadyUpgraded()); | ||
| require(_live.basefeeSharingPctg == OLD_BASEFEE_SHARING_PCTG, LiveProxyMismatch()); | ||
| } | ||
|
|
||
| /// @dev Aborts unless the new implementation's configuration equals the live one in every | ||
| /// field but the basefee sharing percentage, which must be the new value. Catches a | ||
| /// transposed constructor argument (all five are addresses, so a swapped pair compiles | ||
| /// cleanly) and any numeric constant in `MainnetInbox` that drifted from the live value. | ||
| /// @param _new The freshly deployed implementation's configuration. | ||
| /// @param _live The live proxy's configuration. | ||
| function _checkConfig( | ||
| IInbox.Config memory _new, | ||
| IInbox.Config memory _live | ||
| ) | ||
| private | ||
| pure | ||
| { | ||
| require(_new.basefeeSharingPctg == NEW_BASEFEE_SHARING_PCTG, ConfigMismatch()); | ||
|
|
||
| // Normalise the one field that is meant to differ, then compare the rest in one go. `_new` | ||
| // is the caller's own copy, so overwriting it here is local to this check. | ||
| _new.basefeeSharingPctg = _live.basefeeSharingPctg; | ||
| require(keccak256(abi.encode(_new)) == keccak256(abi.encode(_live)), ConfigMismatch()); | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.