Skip to content

Commit aaa556d

Browse files
Merge pull request #143 from OffchainLabs/release-master-sync
Sync release and master branches
2 parents c81ad20 + ca1e0fb commit aaa556d

File tree

12 files changed

+163
-153
lines changed

12 files changed

+163
-153
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- master
1111
- develop
1212
- release
13-
# run this job on the default branch daily
13+
# run this job on the default branch (release) daily
1414
# the docker compose file contains some images with tags like 'latest' and 'stable'
1515
# we nightly run here just to double check no bugs have been merged into those tags and are now on release
1616
schedule:
@@ -20,6 +20,7 @@ jobs:
2020
build_and_run:
2121
runs-on: ubuntu-8
2222
strategy:
23+
fail-fast: false
2324
matrix:
2425
pos: [pos, no-pos]
2526
l3node: [l3node, l3node-token-6, no-l3node]
@@ -46,20 +47,3 @@ jobs:
4647

4748
- name: Startup Nitro testnode
4849
run: ${{ github.workspace }}/.github/workflows/testnode.bash --init-force ${{ (matrix.l3node == 'l3node' && '--l3node') || (matrix.l3node == 'l3node-token-6' && '--l3node --l3-fee-token --l3-token-bridge --l3-fee-token-decimals 6') || '' }} ${{ matrix.tokenbridge == 'tokenbridge' && '--tokenbridge' || '--no-tokenbridge' }} --detach ${{ matrix.pos == 'pos' && '--pos' || '' }} --simple ${{ (matrix.simple == 'simple' && '--simple') || (matrix.simple == 'no-simple' && '--no-simple') || '' }}
49-
50-
bold_upgrade:
51-
runs-on: ubuntu-8
52-
53-
steps:
54-
- name: Checkout
55-
uses: actions/checkout@v4
56-
with:
57-
submodules: recursive
58-
59-
- name: Set up Docker Buildx
60-
uses: docker/setup-buildx-action@v3
61-
with:
62-
driver-opts: network=host
63-
64-
- name: Startup Nitro testnode
65-
run: ${{ github.workspace }}/.github/workflows/testnode.bash --init-force --bold-upgrade --simple --detach

boldupgrader/Dockerfile

Lines changed: 0 additions & 14 deletions
This file was deleted.

docker-compose-ci-cache.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@
2222
"type=docker"
2323
]
2424
},
25-
"boldupgrader": {
26-
"cache-from": [
27-
"type=local,src=/tmp/.buildx-cache"
28-
],
29-
"cache-to": [
30-
"type=local,dest=/tmp/.buildx-cache,mode=max"
31-
],
32-
"output": [
33-
"type=docker"
34-
]
35-
},
3625
"tokenbridge": {
3726
"cache-from": [
3827
"type=local,src=/tmp/.buildx-cache"

docker-compose.yaml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ services:
4747
- "127.0.0.1:6379:6379"
4848

4949
geth:
50-
image: ethereum/client-go:stable
50+
image: ethereum/client-go:v1.14.13
5151
ports:
5252
- "127.0.0.1:8545:8545"
5353
- "127.0.0.1:8551:8551"
@@ -370,26 +370,6 @@ services:
370370
- "tokenbridge-data:/workspace"
371371
- /var/run/docker.sock:/var/run/docker.sock
372372

373-
boldupgrader:
374-
depends_on:
375-
- geth
376-
- sequencer
377-
pid: host
378-
build:
379-
context: boldupgrader/
380-
args:
381-
BOLD_CONTRACTS_BRANCH: ${BOLD_CONTRACTS_BRANCH:-}
382-
environment:
383-
- L1_RPC_URL=http://geth:8545
384-
- L1_PRIV_KEY=0xdc04c5399f82306ec4b4d654a342f40e2e0620fe39950d967e1e574b32d4dd36
385-
- CONFIG_NETWORK_NAME=local
386-
- DEPLOYED_CONTRACTS_DIR=./scripts/files/
387-
- DISABLE_VERIFICATION=true
388-
volumes:
389-
- "config:/config"
390-
- "boldupgrader-data:/workspace"
391-
- /var/run/docker.sock:/var/run/docker.sock
392-
393373
rollupcreator:
394374
depends_on:
395375
- geth
@@ -502,4 +482,3 @@ volumes:
502482
das-committee-b-data:
503483
das-mirror-data:
504484
timeboost-auctioneer-data:
505-
boldupgrader-data:

rollupcreator/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ARG NITRO_CONTRACTS_BRANCH=main
55
WORKDIR /workspace
66
RUN git clone --no-checkout https://github.com/OffchainLabs/nitro-contracts.git ./
77
RUN git checkout ${NITRO_CONTRACTS_BRANCH}
8+
RUN git submodule update --init --recursive
89
RUN yarn install && yarn cache clean
910
RUN curl -L https://foundry.paradigm.xyz | bash
1011
ENV PATH="${PATH}:/root/.foundry/bin"

scripts/config.ts

Lines changed: 58 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,11 @@ function writeConfigs(argv: any) {
198198
"info-files": [chainInfoFile],
199199
},
200200
"node": {
201+
"bold": {
202+
"rpc-block-number": "latest",
203+
"strategy": "makeNodes",
204+
"assertion-posting-interval": "10s"
205+
},
201206
"staker": {
202207
"dangerous": {
203208
"without-block-validator": false
@@ -292,7 +297,7 @@ function writeConfigs(argv: any) {
292297
if (argv.simple) {
293298
let simpleConfig = JSON.parse(baseConfJSON)
294299
simpleConfig.node.staker.enable = true
295-
simpleConfig.node.staker["use-smart-contract-wallet"] = true
300+
simpleConfig.node.staker["use-smart-contract-wallet"] = false // TODO: set to true when fixed
296301
simpleConfig.node.staker.dangerous["without-block-validator"] = true
297302
simpleConfig.node.sequencer = true
298303
simpleConfig.node.dangerous["no-sequencer-coordinator"] = true
@@ -307,7 +312,7 @@ function writeConfigs(argv: any) {
307312
} else {
308313
let validatorConfig = JSON.parse(baseConfJSON)
309314
validatorConfig.node.staker.enable = true
310-
validatorConfig.node.staker["use-smart-contract-wallet"] = true
315+
validatorConfig.node.staker["use-smart-contract-wallet"] = false // TODO: set to true when fixed
311316
let validconfJSON = JSON.stringify(validatorConfig)
312317
fs.writeFileSync(path.join(consts.configpath, "validator_config.json"), validconfJSON)
313318

@@ -321,11 +326,11 @@ function writeConfigs(argv: any) {
321326
sequencerConfig.execution["sequencer"].enable = true
322327
sequencerConfig.node["delayed-sequencer"].enable = true
323328
if (argv.timeboost) {
324-
sequencerConfig.execution.sequencer.dangerous = {};
325-
sequencerConfig.execution.sequencer.dangerous.timeboost = {
326-
"enable": false, // Create it false initially, turn it on with sed in test-node.bash after contract setup.
327-
"redis-url": argv.redisUrl
328-
};
329+
sequencerConfig.execution.sequencer.dangerous = {};
330+
sequencerConfig.execution.sequencer.dangerous.timeboost = {
331+
"enable": false, // Create it false initially, turn it on with sed in test-node.bash after contract setup.
332+
"redis-url": argv.redisUrl
333+
};
329334
}
330335
fs.writeFileSync(path.join(consts.configpath, "sequencer_config.json"), JSON.stringify(sequencerConfig))
331336

@@ -340,13 +345,14 @@ function writeConfigs(argv: any) {
340345

341346
let l3Config = JSON.parse(baseConfJSON)
342347
l3Config["parent-chain"].connection.url = argv.l2url
343-
l3Config.node.staker["parent-chain-wallet"].account = namedAddress("l3owner")
348+
// use the same account for l2 and l3 staker
349+
// l3Config.node.staker["parent-chain-wallet"].account = namedAddress("l3owner")
344350
l3Config.node["batch-poster"]["parent-chain-wallet"].account = namedAddress("l3sequencer")
345351
l3Config.chain.id = 333333
346352
const l3ChainInfoFile = path.join(consts.configpath, "l3_chain_info.json")
347353
l3Config.chain["info-files"] = [l3ChainInfoFile]
348354
l3Config.node.staker.enable = true
349-
l3Config.node.staker["use-smart-contract-wallet"] = true
355+
l3Config.node.staker["use-smart-contract-wallet"] = false // TODO: set to true when fixed
350356
l3Config.node.sequencer = true
351357
l3Config.execution["sequencer"].enable = true
352358
l3Config.node["dangerous"]["no-sequencer-coordinator"] = true
@@ -403,7 +409,7 @@ function writeL2ChainConfig(argv: any) {
403409
"EnableArbOS": true,
404410
"AllowDebugPrecompiles": true,
405411
"DataAvailabilityCommittee": argv.anytrust,
406-
"InitialArbOSVersion": 32, // TODO For Timeboost, this still needs to be set to 31
412+
"InitialArbOSVersion": 40,
407413
"InitialChainOwner": argv.l2owner,
408414
"GenesisBlockNum": 0
409415
}
@@ -436,7 +442,7 @@ function writeL3ChainConfig(argv: any) {
436442
"EnableArbOS": true,
437443
"AllowDebugPrecompiles": true,
438444
"DataAvailabilityCommittee": false,
439-
"InitialArbOSVersion": 31,
445+
"InitialArbOSVersion": 40,
440446
"InitialChainOwner": argv.l2owner,
441447
"GenesisBlockNum": 0
442448
}
@@ -533,56 +539,56 @@ function dasBackendsJsonConfig(argv: any) {
533539
}
534540

535541
export const writeTimeboostConfigsCommand = {
536-
command: "write-timeboost-configs",
537-
describe: "writes configs for the timeboost autonomous auctioneer and bid validator",
538-
builder: {
539-
"auction-contract": {
540-
string: true,
541-
describe: "auction contract address",
542-
demandOption: true
542+
command: "write-timeboost-configs",
543+
describe: "writes configs for the timeboost autonomous auctioneer and bid validator",
544+
builder: {
545+
"auction-contract": {
546+
string: true,
547+
describe: "auction contract address",
548+
demandOption: true
549+
},
543550
},
544-
},
545-
handler: (argv: any) => {
546-
writeAutonomousAuctioneerConfig(argv)
547-
writeBidValidatorConfig(argv)
548-
}
551+
handler: (argv: any) => {
552+
writeAutonomousAuctioneerConfig(argv)
553+
writeBidValidatorConfig(argv)
554+
}
549555
}
550556

551557
function writeAutonomousAuctioneerConfig(argv: any) {
552-
const autonomousAuctioneerConfig = {
553-
"auctioneer-server": {
554-
"auction-contract-address": argv.auctionContract,
555-
"db-directory": "/data",
556-
"redis-url": "redis://redis:6379",
557-
"use-redis-coordinator": true,
558-
"redis-coordinator-url": "redis://redis:6379",
559-
"wallet": {
560-
"account": namedAddress("auctioneer"),
561-
"password": consts.l1passphrase,
562-
"pathname": consts.l1keystore
563-
},
564-
},
565-
"bid-validator": {
566-
"enable": false
558+
const autonomousAuctioneerConfig = {
559+
"auctioneer-server": {
560+
"auction-contract-address": argv.auctionContract,
561+
"db-directory": "/data",
562+
"redis-url": "redis://redis:6379",
563+
"use-redis-coordinator": true,
564+
"redis-coordinator-url": "redis://redis:6379",
565+
"wallet": {
566+
"account": namedAddress("auctioneer"),
567+
"password": consts.l1passphrase,
568+
"pathname": consts.l1keystore
569+
},
570+
},
571+
"bid-validator": {
572+
"enable": false
573+
}
567574
}
568-
}
569-
const autonomousAuctioneerConfigJSON = JSON.stringify(autonomousAuctioneerConfig)
570-
fs.writeFileSync(path.join(consts.configpath, "autonomous_auctioneer_config.json"), autonomousAuctioneerConfigJSON)
575+
const autonomousAuctioneerConfigJSON = JSON.stringify(autonomousAuctioneerConfig)
576+
fs.writeFileSync(path.join(consts.configpath, "autonomous_auctioneer_config.json"), autonomousAuctioneerConfigJSON)
571577
}
572578

573579
function writeBidValidatorConfig(argv: any) {
574-
const bidValidatorConfig = {
575-
"auctioneer-server": {
576-
"enable": false
577-
},
578-
"bid-validator": {
579-
"auction-contract-address": argv.auctionContract,
580-
"redis-url": "redis://redis:6379",
581-
"sequencer-endpoint": "http://sequencer:8547"
580+
const bidValidatorConfig = {
581+
"auctioneer-server": {
582+
"enable": false
583+
},
584+
"bid-validator": {
585+
"auction-contract-address": argv.auctionContract,
586+
"redis-url": "redis://redis:6379",
587+
"sequencer-endpoint": "http://sequencer:8547"
588+
}
582589
}
583-
}
584-
const bidValidatorConfigJSON = JSON.stringify(bidValidatorConfig)
585-
fs.writeFileSync(path.join(consts.configpath, "bid_validator_config.json"), bidValidatorConfigJSON)
590+
const bidValidatorConfigJSON = JSON.stringify(bidValidatorConfig)
591+
fs.writeFileSync(path.join(consts.configpath, "bid_validator_config.json"), bidValidatorConfigJSON)
586592
}
587593

588594
export const writeConfigCommand = {

scripts/ethcommands.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import * as fs from "fs";
1010
import { ARB_OWNER } from "./consts";
1111
import * as TransparentUpgradeableProxy from "@openzeppelin/contracts/build/contracts/TransparentUpgradeableProxy.json"
1212
import * as ExpressLaneAuctionContract from "@arbitrum/nitro-contracts/build/contracts/src/express-lane-auction/ExpressLaneAuction.sol/ExpressLaneAuction.json"
13+
import * as StylusDeployerContract from "@arbitrum/nitro-contracts/build/contracts/src/stylus/StylusDeployer.sol/StylusDeployer.json"
14+
1315
const path = require("path");
1416

1517
async function sendTransaction(argv: any, threadId: number) {
@@ -185,6 +187,36 @@ async function deployWETHContract(deployerWallet: Wallet): Promise<string> {
185187
return weth.address;
186188
}
187189

190+
async function createStylusDeployer(deployerWallet: Wallet): Promise<string> {
191+
// this factory should be deployed by the rollupcreator when deploy helper is used
192+
const create2factory = '0x4e59b44847b379578588920ca78fbf26c0b4956c'
193+
if (await deployerWallet.provider.getCode(create2factory) === '0x') {
194+
// wait for 30 seconds, check again before throwing an error
195+
await new Promise(resolve => setTimeout(resolve, 30000));
196+
if (await deployerWallet.provider.getCode(create2factory) === '0x') {
197+
throw new Error('Create2 factory not yet deployed')
198+
}
199+
}
200+
201+
const salt = ethers.constants.HashZero
202+
const stylusDeployerBytecode = StylusDeployerContract.bytecode
203+
const stylusDeployerAddress = ethers.utils.getCreate2Address(create2factory, salt, ethers.utils.keccak256(stylusDeployerBytecode))
204+
205+
// check if the address is already deployed
206+
const code = await deployerWallet.provider.getCode(stylusDeployerAddress)
207+
if (code !== '0x') {
208+
console.log("Stylus deployer already deployed")
209+
} else {
210+
const stylusDeployerTx = await deployerWallet.sendTransaction({
211+
to: create2factory,
212+
data: ethers.utils.concat([salt, stylusDeployerBytecode])
213+
})
214+
await stylusDeployerTx.wait()
215+
}
216+
217+
return stylusDeployerAddress
218+
}
219+
188220
export const bridgeFundsCommand = {
189221
command: "bridge-funds",
190222
describe: "sends funds from l1 to l2",
@@ -593,6 +625,30 @@ export const createWETHCommand = {
593625
},
594626
};
595627

628+
export const createStylusDeployerCommand = {
629+
command: "create-stylus-deployer",
630+
describe: "deploys the stylus deployer contract",
631+
builder: {
632+
deployer: { string: true, describe: "account (see general help)" },
633+
l3: { boolean: false, describe: "deploy on L3, otherwise deploy on L2" },
634+
},
635+
handler: async (argv: any) => {
636+
console.log("create-stylus-deployer");
637+
638+
const provider = new ethers.providers.WebSocketProvider(argv.l3 ? argv.l3url : argv.l2url);
639+
const deployerWallet = namedAccount(argv.deployer).connect(provider);
640+
641+
const stylusDeployerAddress = await createStylusDeployer(deployerWallet);
642+
if (argv.l3) {
643+
console.log("Stylus deployer deployed at L3 address:", stylusDeployerAddress);
644+
} else {
645+
console.log("Stylus deployer deployed at L2 address:", stylusDeployerAddress);
646+
}
647+
648+
provider.destroy();
649+
}
650+
};
651+
596652
export const sendL1Command = {
597653
command: "send-l1",
598654
describe: "sends funds between l1 accounts",

scripts/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
createERC20Command,
2727
deployExpressLaneAuctionContractCommand,
2828
createWETHCommand,
29+
createStylusDeployerCommand,
2930
transferERC20Command,
3031
sendL1Command,
3132
sendL2Command,
@@ -56,6 +57,7 @@ async function main() {
5657
.command(createFeeTokenPricerCommand)
5758
.command(deployExpressLaneAuctionContractCommand)
5859
.command(createWETHCommand)
60+
.command(createStylusDeployerCommand)
5961
.command(transferERC20Command)
6062
.command(sendL1Command)
6163
.command(sendL2Command)

0 commit comments

Comments
 (0)