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

feat: bold upgrader #98

Merged
merged 16 commits into from
Dec 6, 2024
Merged

feat: bold upgrader #98

merged 16 commits into from
Dec 6, 2024

Conversation

gzeoneth
Copy link
Member

@gzeoneth gzeoneth commented Nov 18, 2024

This PR introduce --bold-upgrade flag to perform BOLD upgrade on top of a nitro-contract v2.1 deployment.
Only L2 testnode is supported (i.e. --l3-node will not be upgraded).

$ ./test-node.bash --init-force --no-tokenbridge --bold-upgrade
...
upgrade executed
upgrade tx hash: 0x609083720b76357c30c8c9a56be80d9364ad742ccdbe1c09a27e35b51ed1af6d
verifying the upgrade...
Old Rollup: 0x3A052fF29EAFdd226Df1C4824d51A56a8Ad5D7A4
BOLD Rollup: 0x01C2d0aac633f35c99C675f85e7A0e11b1F8Ff8E
BOLD Challenge Manager: 0xF2aB168E46C4473424804D1d568548decA7faB95
BOLD AssertionCreated assertionHash: 0x47a95b5265fdf69ba6d268fb4001fb59cd68224c7038a1c8ff4d43945621bf89
BOLD AssertionCreated parentAssertionHash: 0x0000000000000000000000000000000000000000000000000000000000000000
BOLD AssertionCreated assertion: [["0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000",["0x0000000000000000000000000000000000000000000000000000000000000000",{"type":"BigNumber","hex":"0x00"},"0x0000000000000000000000000000000000000000",{"type":"BigNumber","hex":"0x00"},{"type":"BigNumber","hex":"0x00"}]],[[["0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000"],[{"type":"BigNumber","hex":"0x00"},{"type":"BigNumber","hex":"0x00"}]],0,"0x0000000000000000000000000000000000000000000000000000000000000000"],[[["0x8d8f824fc8de64f5c1d14bd4028c868df8022f41aba6c5baf2a9f48b68330349","0x0000000000000000000000000000000000000000000000000000000000000000"],[{"type":"BigNumber","hex":"0x02"},{"type":"BigNumber","hex":"0x00"}]],1,"0x0000000000000000000000000000000000000000000000000000000000000000"]]
BOLD AssertionCreated afterInboxBatchAcc: 0x0000000000000000000000000000000000000000000000000000000000000000
BOLD AssertionCreated inboxMaxCount: BigNumber { _hex: '0x03', _isBigNumber: true }
BOLD AssertionCreated wasmModuleRoot: 0x0581713e5c78e7b069e46f5ea128707459f49b88bd33a56cee78179b7424814b
BOLD AssertionCreated requiredStake: BigNumber { _hex: '0x0de0b6b3a7640000', _isBigNumber: true }
BOLD AssertionCreated challengeManager: 0xF2aB168E46C4473424804D1d568548decA7faB95
BOLD AssertionCreated confirmPeriodBlocks: BigNumber { _hex: '0x64', _isBigNumber: true }
oldLatestConfirmedStateHash 0xfd3ee9b525874822bd6661533e936d727cd3cec225abde0f5fef9e46b3a8a803
BOLD latest confirmed: 0x47a95b5265fdf69ba6d268fb4001fb59cd68224c7038a1c8ff4d43945621bf89
upgrade verified

run these command without using the --bold-upgrade flag to better control the upgrade timing

$ stakeTokenAddress=`docker compose run scripts create-weth --deployer l2owner --deposit 100 | tail -n 1 | awk '{ print $NF }'`
$ docker compose run scripts transfer-erc20 --token $stakeTokenAddress --l1 --amount 100 --from l2owner --to validator
$ rollupAddress=`docker compose run --entrypoint sh poster -c "jq -r '.[0].rollup.rollup' /config/deployed_chain_info.json | tail -n 1 | tr -d '\r\n'"`
$ docker compose run -e TESTNODE_MODE=true -e ROLLUP_ADDRESS=$rollupAddress -e STAKE_TOKEN=$stakeTokenAddress boldupgrader script:bold-prepare
$ docker compose run -e TESTNODE_MODE=true -e ROLLUP_ADDRESS=$rollupAddress -e STAKE_TOKEN=$stakeTokenAddress boldupgrader script:bold-populate-lookup
$ docker compose run -e TESTNODE_MODE=true -e ROLLUP_ADDRESS=$rollupAddress -e STAKE_TOKEN=$stakeTokenAddress boldupgrader script:bold-local-execute

during the BOLD upgrade, a new stakeToken weth would be deployed by l2owner and thevalidator address would start with a balance of 100

Depending on OffchainLabs/nitro-contracts#263

@cla-bot cla-bot bot added the s label Nov 18, 2024
yahgwai
yahgwai previously approved these changes Nov 20, 2024
@gzeoneth gzeoneth marked this pull request as ready for review November 21, 2024 13:50
@gzeoneth gzeoneth requested a review from yahgwai November 21, 2024 13:50
godzillaba
godzillaba previously approved these changes Nov 21, 2024
@PlasmaPower PlasmaPower merged commit 1c6a92f into release Dec 6, 2024
26 checks passed
@PlasmaPower PlasmaPower deleted the bold-upgrade branch December 6, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants