Skip to content

chore: Write U15 scripts #315

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 3 commits into from
Apr 16, 2025
Merged

chore: Write U15 scripts #315

merged 3 commits into from
Apr 16, 2025

Conversation

jackchuma
Copy link
Contributor

This task contains two scripts for our required onchain updates for the OP Stack's Upgrade 15. One for deploying new versions of the FaultDisputeGame and PermissionedDisputeGame contracts, and one for updating the DisputeGameFactory contract to reference the new dispute game contracts.

The contracts have been deployed to expedite the process, but please still do gut-check the deployment script.

The purpose of this task is to upgrade to new dispute game contracts that use the exact same config as our existing dispute game contracts except for the absolute prestate.

@jackchuma jackchuma requested a review from Copilot April 15, 2025 20:27
@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Apr 15, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 11 changed files in this pull request and generated 1 comment.

Files not reviewed (6)
  • sepolia/2025-04-14-upgrade-fault-proofs/.env: Language not supported
  • sepolia/2025-04-14-upgrade-fault-proofs/Makefile: Language not supported
  • sepolia/2025-04-14-upgrade-fault-proofs/addresses.json: Language not supported
  • sepolia/2025-04-14-upgrade-fault-proofs/records/DeployDisputeGames.s.sol/11155111/run-1744743721.json: Language not supported
  • sepolia/2025-04-14-upgrade-fault-proofs/script/DeployDisputeGames.s.sol: Language not supported
  • sepolia/2025-04-14-upgrade-fault-proofs/script/UpgradeDGF.s.sol: Language not supported

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 11 changed files in this pull request and generated no comments.

Files not reviewed (6)
  • sepolia/2025-04-14-upgrade-fault-proofs/.env: Language not supported
  • sepolia/2025-04-14-upgrade-fault-proofs/Makefile: Language not supported
  • sepolia/2025-04-14-upgrade-fault-proofs/addresses.json: Language not supported
  • sepolia/2025-04-14-upgrade-fault-proofs/records/DeployDisputeGames.s.sol/11155111/run-1744743721.json: Language not supported
  • sepolia/2025-04-14-upgrade-fault-proofs/script/DeployDisputeGames.s.sol: Language not supported
  • sepolia/2025-04-14-upgrade-fault-proofs/script/UpgradeDGF.s.sol: Language not supported
Comments suppressed due to low confidence (2)

sepolia/2025-04-14-upgrade-fault-proofs/validations/SafeB.md:18

  • The safe address is shown in all lowercase here but later appears with EIP-55 checksum capitalization (e.g. line 43). Consider using a consistent, checksummed format for clarity.
### Sepolia Safe B: `0x6af0674791925f767060dd52f7fb20984e8639d8`

sepolia/2025-04-14-upgrade-fault-proofs/validations/SafeB.md:51

  • [nitpick] The trailing '2' appears to be appended to the address and may cause confusion. Clarify whether it denotes a derivation index separate from the address or is a formatting artifact.
**Meaning**: This is owners[0xca11bde05977b3631167028862be2a173976ca11] -> 1, so the key can be derived from cast index address 0x0000000000000000000000000000000000000001 2.

@@ -0,0 +1,10 @@
OP_COMMIT=6f68dc35e103278e366d2b8ba178ca87bbaacb0c
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,10 @@
OP_COMMIT=6f68dc35e103278e366d2b8ba178ca87bbaacb0c
BASE_CONTRACTS_COMMIT=c17a305379423f022c54a3c240ef4120590109ae
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Latest Base contracts commit

OP_COMMIT=6f68dc35e103278e366d2b8ba178ca87bbaacb0c
BASE_CONTRACTS_COMMIT=c17a305379423f022c54a3c240ef4120590109ae

ABSOLUTE_PRESTATE=0x03682932cec7ce0a3874b19675a6bbc923054a7b321efc7d3835187b172494b6
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

@@ -0,0 +1,4 @@
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Newly deployed & verified addresses on Sepolia

broadcast = 'records'
fs_permissions = [{ access = "read-write", path = "./" }]
optimizer = true
optimizer_runs = 200
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Set runs value to 200 due to contract size issues when the value is higher

address challenger;

constructor() {
absolutePrestate = Claim.wrap(vm.envBytes32("ABSOLUTE_PRESTATE"));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Setting in constructor so absolutePrestate can be immutable and guaranteed to not be overwritten

@@ -0,0 +1,146 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using 0.8.24 because of unsupported opcode in our safe contracts

import {Simulation} from "@base-contracts/script/universal/Simulation.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";

interface IDisputeGameFactory {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Manually defined these interfaces because OP contracts require 0.8.15 so this allows us to avoid importing them directly and hitting compilation errors from 0.8.24.

string memory addresses = vm.readFile(path);

dgfProxy = IDisputeGameFactory(ISystemConfig(vm.envAddress("SYSTEM_CONFIG")).disputeGameFactory());
fdgImpl = addresses.readAddress(".faultDisputeGame");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Loads our newly deployed addresses directly from the json file

@jackchuma
Copy link
Contributor Author

I added separate validation files for each safe so signers don't need to spend any mental energy parsing a file that includes edge cases for specific safes

henridevieux
henridevieux previously approved these changes Apr 15, 2025
OP_COMMIT=6f68dc35e103278e366d2b8ba178ca87bbaacb0c
BASE_CONTRACTS_COMMIT=c17a305379423f022c54a3c240ef4120590109ae

ABSOLUTE_PRESTATE=0x03682932cec7ce0a3874b19675a6bbc923054a7b321efc7d3835187b172494b6
Copy link
Collaborator

Choose a reason for hiding this comment

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

SYSTEM_CONFIG=0xf272670eb55e895584501d564AfEB048bEd26194
OWNER_SAFE=0x0fe884546476dDd290eC46318785046ef68a0BA9
COORDINATOR_SAFE_ADDR=0x646132a1667ca7ad00d36616afba1a28116c770a
SAFE_A=0x5dfEB066334B67355A15dc9b67317fD2a2e1f77f
Copy link

Choose a reason for hiding this comment

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

BTW, I think this is missing in our internal docs (I know it's good though)

cbfyi
cbfyi previously approved these changes Apr 15, 2025
jjtny1
jjtny1 previously approved these changes Apr 15, 2025
mdehoog
mdehoog previously approved these changes Apr 15, 2025
@cb-heimdall cb-heimdall dismissed mdehoog’s stale review April 16, 2025 11:32

Approved review 2770158456 from mdehoog is now dismissed due to new commit. Re-request for approval.

@cb-heimdall cb-heimdall dismissed stale reviews from henridevieux, cbfyi, and jjtny1 April 16, 2025 11:32

Approved review 2769758844 from henridevieux is now dismissed due to new commit. Re-request for approval.

Copy link

@roger-bai-coinbase roger-bai-coinbase left a comment

Choose a reason for hiding this comment

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

For the future, the nonce may need to be overwritten since we require 2 transactions from SafeB, incrementing the nonce twice. Possibly the coordinator safe as well

@cb-heimdall
Copy link
Collaborator

Review Error for roger-bai-coinbase @ 2025-04-16 14:52:26 UTC
User failed mfa authentication, public email is not set on your github profile. see go/mfa-help

@jackchuma jackchuma merged commit c8c9b78 into main Apr 16, 2025
4 checks passed
@jackchuma jackchuma deleted the jack/update-sepolia-prestate branch April 16, 2025 15:33
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.

7 participants