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

chore: bold deploy script improvements #263

Merged
merged 24 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
62d2fbf
chore: use 2.1.0 for OldRollup
gzeoneth Nov 13, 2024
a6a03f5
fix: wait for deployment
gzeoneth Nov 13, 2024
fdc57f5
feat: allow excessStakeReceiver to be eoa
gzeoneth Nov 14, 2024
60392fb
wip: print action calldata
gzeoneth Nov 14, 2024
d37a3b8
wip: show executor perform call data
gzeoneth Nov 14, 2024
5250976
fix: testnode master rollup addr
gzeoneth Nov 14, 2024
d13ff1b
wip: add local testnode executor
gzeoneth Nov 14, 2024
054c29b
wip: testnode validator
gzeoneth Nov 14, 2024
74b1a06
wip: testnode validator wallet
gzeoneth Nov 14, 2024
980d2f8
fix: small range lookup
gzeoneth Nov 14, 2024
d766a61
chore: sample env for testnode
gzeoneth Nov 18, 2024
4806092
feat: bold upgrade execute and improved logging
gzeoneth Nov 18, 2024
6948823
fix: use nextInboxPosition at upgrade to verify
gzeoneth Nov 18, 2024
8d9e42e
Revert "fix: use nextInboxPosition at upgrade to verify"
gzeoneth Nov 18, 2024
716f3ef
fix: getlog range
gzeoneth Nov 18, 2024
d7cfe47
fix: nextInboxPosition
gzeoneth Nov 18, 2024
46f9e27
chore: print bold addresses
gzeoneth Nov 18, 2024
a6e2e59
chore: log more stuffs
gzeoneth Nov 18, 2024
4995461
chore: use 1000 range when searching log
gzeoneth Nov 18, 2024
ef08bac
fix: parse event to get nextInboxPosition and more logging
gzeoneth Nov 18, 2024
7d02843
feat: allow ROLLUP_ADDRESS override in bold upgrade
gzeoneth Nov 18, 2024
4d8ad8a
chore: whitelist npm audit issue
gzeoneth Nov 21, 2024
1581fb4
chore: remove excessStakeReceiver check
gzeoneth Nov 21, 2024
a1cfde6
chore: revert typo
gzeoneth Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .env.sample.goerli

This file was deleted.

5 changes: 5 additions & 0 deletions .env.sample.testnode
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
L1_RPC_URL="http://localhost:8545"
L1_PRIV_KEY="0xdc04c5399f82306ec4b4d654a342f40e2e0620fe39950d967e1e574b32d4dd36"
CONFIG_NETWORK_NAME="local"
DEPLOYED_CONTRACTS_DIR="./scripts/files/"
DISABLE_VERIFICATION=true
4 changes: 3 additions & 1 deletion audit-ci.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
// Valid ECDSA signatures erroneously rejected in Elliptic
"GHSA-fc9h-whq2-v747",
// secp256k1-node allows private key extraction over ECDH
"GHSA-584q-6j8j-r5pm"
"GHSA-584q-6j8j-r5pm",
// Regular Expression Denial of Service (ReDoS) in cross-spawn
"GHSA-3xgq-45jj-v275"
]
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"create-rollup-testnode": "hardhat run scripts/local-deployment/deployCreatorAndCreateRollup.ts",
"script:bold-prepare": "hardhat run ./scripts/prepareBoldUpgrade.ts",
"script:bold-populate-lookup": "hardhat run ./scripts/populateLookup.ts",
"script:bold-local-execute": "hardhat run ./scripts/testLocalExecuteBoldUpgrade.ts",
"script:bold-local-execute": "hardhat run ./scripts/executeBoldUpgrade.ts",
"deploy-cachemanager-testnode": "hardhat run scripts/local-deployment/deployCacheManager.ts"
},
"dependencies": {
Expand All @@ -64,7 +64,7 @@
},
"private": false,
"devDependencies": {
"@arbitrum/nitro-contracts-2.0.0": "npm:@arbitrum/nitro-contracts@2.0.0-beta.0",
"@arbitrum/nitro-contracts-2.1.0": "npm:@arbitrum/nitro-contracts@2.1.0",
"@arbitrum/sdk": "^3.4.1",
"@ethersproject/providers": "^5.7.2",
"@nomicfoundation/hardhat-verify": "^2.0.9",
Expand Down
8 changes: 4 additions & 4 deletions scripts/boldUpgradeCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export const getConfig = async (
if (!config) {
throw new Error('config not found')
}
if (process.env.ROLLUP_ADDRESS) {
console.log('Using ROLLUP_ADDRESS from env:', process.env.ROLLUP_ADDRESS)
config.contracts.rollup = process.env.ROLLUP_ADDRESS
}
await validateConfig(config, l1Rpc)
return config
}
Expand Down Expand Up @@ -93,10 +97,6 @@ export const validateConfig = async (
config: Config,
l1Rpc: providers.Provider
) => {
// check all the config.contracts exist
if ((await l1Rpc.getCode(config.contracts.excessStakeReceiver)).length <= 2) {
gzeoneth marked this conversation as resolved.
Show resolved Hide resolved
throw new Error('excessStakeReceiver address is not a contract')
}
if ((await l1Rpc.getCode(config.contracts.rollup)).length <= 2) {
throw new Error('rollup address is not a contract')
}
Expand Down
19 changes: 17 additions & 2 deletions scripts/boldUpgradeFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { AssertionStateStruct } from '../build/types/src/challengeV2/IAssertionC
import {
abi as OldRollupAbi,
bytecode as OldRollupBytecode,
} from '@arbitrum/nitro-contracts-2.0.0/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.json'
} from '@arbitrum/nitro-contracts-2.1.0/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.json'
import { verifyContract } from './deploymentUtils'

export const deployDependencies = async (
Expand All @@ -40,6 +40,7 @@ export const deployDependencies = async (
> => {
const bridgeFac = new Bridge__factory(signer)
const bridge = await bridgeFac.deploy()
await bridge.deployed()
if (log) {
console.log(`Bridge implementation deployed at: ${bridge.address}`)
}
Expand Down Expand Up @@ -69,6 +70,7 @@ export const deployDependencies = async (
isUsingFeeToken,
isDelayBufferable
)
await seqInbox.deployed()
if (log) {
console.log(
`Sequencer inbox implementation deployed at: ${seqInbox.address}`
Expand All @@ -86,6 +88,7 @@ export const deployDependencies = async (

const reiFac = new RollupEventInbox__factory(signer)
const rei = await reiFac.deploy()
await rei.deployed()
if (log) {
console.log(`Rollup event inbox implementation deployed at: ${rei.address}`)
}
Expand All @@ -96,6 +99,7 @@ export const deployDependencies = async (

const outboxFac = new Outbox__factory(signer)
const outbox = await outboxFac.deploy()
await outbox.deployed()
if (log) {
console.log(`Outbox implementation deployed at: ${outbox.address}`)
}
Expand All @@ -106,6 +110,7 @@ export const deployDependencies = async (

const inboxFac = new Inbox__factory(signer)
const inbox = await inboxFac.deploy(maxDataSize)
await inbox.deployed()
if (log) {
console.log(`Inbox implementation deployed at: ${inbox.address}`)
}
Expand All @@ -120,6 +125,7 @@ export const deployDependencies = async (
signer
)
const oldRollupUser = await oldRollupUserFac.deploy()
await oldRollupUser.deployed()
if (log) {
console.log(`Old rollup user logic deployed at: ${oldRollupUser.address}`)
}
Expand All @@ -130,6 +136,7 @@ export const deployDependencies = async (

const newRollupUserFac = new RollupUserLogic__factory(signer)
const newRollupUser = await newRollupUserFac.deploy()
await newRollupUser.deployed()
if (log) {
console.log(`New rollup user logic deployed at: ${newRollupUser.address}`)
}
Expand All @@ -140,6 +147,7 @@ export const deployDependencies = async (

const newRollupAdminFac = new RollupAdminLogic__factory(signer)
const newRollupAdmin = await newRollupAdminFac.deploy()
await newRollupAdmin.deployed()
if (log) {
console.log(`New rollup admin logic deployed at: ${newRollupAdmin.address}`)
}
Expand All @@ -150,6 +158,7 @@ export const deployDependencies = async (

const challengeManagerFac = new EdgeChallengeManager__factory(signer)
const challengeManager = await challengeManagerFac.deploy()
await challengeManager.deployed()
if (log) {
console.log(`Challenge manager deployed at: ${challengeManager.address}`)
}
Expand Down Expand Up @@ -303,15 +312,21 @@ export const populateLookup = async (
for (let i = 0; i < 100; i++) {
latestConfirmedLog = await wallet.provider!.getLogs({
address: rollupAddr,
fromBlock: toBlock - 1000,
fromBlock: toBlock >= 1000 ? toBlock - 1000 : 0,
toBlock: toBlock,
topics: [
oldRollup.interface.getEventTopic('NodeCreated'),
ethers.utils.hexZeroPad(ethers.utils.hexlify(latestConfirmed), 32),
],
})
if (latestConfirmedLog.length == 1) break
if (toBlock == 0) {
throw new Error('Could not find latest confirmed node')
}
toBlock -= 1000
if (toBlock < 0) {
toBlock = 0
}
}

if (!latestConfirmedLog || latestConfirmedLog.length != 1) {
Expand Down
Loading
Loading