Skip to content
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

sep/027: upgrade and re-initialize SystemConfig #418

Open
wants to merge 44 commits into
base: main
Choose a base branch
from

Conversation

geoknee
Copy link
Contributor

@geoknee geoknee commented Dec 17, 2024

TODO

  • upgrade to a multi chain task when things are working for OP Sepolia
  • add some breadcrumbs to the previous task 020 to signify that it was incorrect and that this task supercedes it
  • Build on top of @sebastianst 's new validation framework 3591eec

Closes #394

@geoknee geoknee changed the title first pass at task sep 025 Sep 026: upgrade and re-initialize SystemConfig Dec 17, 2024
@geoknee geoknee changed the title Sep 026: upgrade and re-initialize SystemConfig Sep 027: upgrade and re-initialize SystemConfig Dec 18, 2024
@geoknee geoknee force-pushed the gk/025-holocene-sys-cfg branch 2 times, most recently from 50aeb48 to 2e881b4 Compare December 19, 2024 14:58
import {NestedMultisigBuilder} from "@base-contracts/script/universal/NestedMultisigBuilder.sol";
import {SystemConfigUpgrade} from "script/verification/SystemConfigUpgrade.s.sol";

contract SystemConfigUpgradeEcotoneScalars is SystemConfigUpgrade {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about adding explanatory code comments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +26 to +27
uint256 reencodedScalar =
(uint256(0x01) << 248) | (uint256(sysCfg.blobbasefeeScalar()) << 32) | sysCfg.basefeeScalar();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this only needed temporarily since we are upgrading the SystemConfig to a version that no longer needs encoding?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sysCfg.blobbasefeeScalar() and sysCfg.basefeeScalar() getters read from dedicated storage slots. When we did the upgrade incorrectly previously, these storage slots were not updated causing the getters to return 0. Now, we are checking they return values consistent with what you get if you call sysCfg.scalar() and decode them by hand.

Essentially we implicitly construct the expected values for the two new getters by reencoding what we get after the upgrade and checking it matches the previous scalar value.

I could try redesigning this so it is more explicit, and decode the expected values from the previous.scalar and compare the new getter's results with those?

Comment on lines 33 to 35
if (
uint8(previous.scalar >> 248) == 1 // most significant bit
) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this behind an if block? A code comment for what this method is testing would be helpful for people not familiar with this encoding

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tidied that up here 5253651 PTAL hopefully it is clear now.


contract NestedSignFromJson is OriginalNestedSignFromJson, CouncilFoundationNestedSign {
string constant l1ChainName = "sepolia";
string constant release = "v1.8.0-rc.4";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gov proposal has passed so we don't need to use the RC anymore and should be using the finalized release, which is what we want for mainnet also

Suggested change
string constant release = "v1.8.0-rc.4";
string constant release = "v1.8.0";

@@ -0,0 +1,30 @@
# Holocene Hardfork Upgrade - `SystemConfig`

Status: DRAFT, NOT READY TO SIGN
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do we need for this to become ready to sign?

Suggested change
Status: DRAFT, NOT READY TO SIGN
Status: DRAFT, NOT READY TO SIGN

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated it now, there are no blockers other than review of this PR.

Comment on lines +9 to +10
This upgrades the `SystemConfig` in the
[v1.8.0-rc.4](https://github.com/ethereum-optimism/optimism/tree/v1.8.0-rc.4) release.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should just use 1.8.0 now that it's passed

Suggested change
This upgrades the `SystemConfig` in the
[v1.8.0-rc.4](https://github.com/ethereum-optimism/optimism/tree/v1.8.0-rc.4) release.
This upgrades the `SystemConfig` in the
[v1.8.0](https://github.com/ethereum-optimism/optimism/tree/v1.8.0) release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that passing governance process is a prompt for us finalizing the release. We have some options on the ordering of next steps however:

  1. We can (should) make the final tag now in any case.
  2. We can update the superchain registry TOML files with the finalized tag, either
    a. by adding a new release to standard-versions-mainnet.toml and keeping the existing v1.8.0-rc.4 entry. We would then want to go back and remove the latter when all tasks referencing it have been executed.
    b. by modifying the existing release but waiting to do that until all tasks including this one are executed
    c. by modifying the existing release and modifying any existing tasks that reference it.

Curious what you think makes the most sense? I'd prefer if we can settle on a flow which is as clear and consistent as possible given we will go through this on each and every hard fork / upgrade. I'm inclined towards option b.


## Pre-deployments

- `SystemConfig` - `0x33b83E4C305c908B2Fc181dDa36e230213058d7d`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any messages you can link to so I can verify this address?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually the same address from the previous (incorrect) upgrade

- `SystemConfig` - `0x33b83E4C305c908B2Fc181dDa36e230213058d7d`
.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,85 @@
# Validation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not yet validated this file or run the simulation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in SystemConfig Holocene Upgrade
3 participants