Skip to content

Commit 48882e7

Browse files
committed
update configs
1 parent 449cea8 commit 48882e7

4 files changed

Lines changed: 64 additions & 54 deletions

File tree

init/3_config.jsonnet

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33

44
local config = std.extVar("config");
55

6-
// if the key is not present in the config, throw an error
6+
// if not exist conf, throw an error
77
local require(key, conf) =
88
if std.objectHas(config, conf) then
99
{ [key]: config[conf] }
1010
else
1111
error "required field not found :" + conf;
1212

13-
// if the key is not present in the config, use the default value
13+
// if not exist conf, return the default value
1414
local default(key, conf, default) =
1515
if std.objectHas(config, conf) then
1616
{ [key]: config[conf] }
1717
else
1818
{ [key]: default };
1919

20-
// if the key is not present in the config, use empty object
20+
// if not exist conf, return empty
2121
local optional(key, conf) =
2222
if std.objectHas(config, conf) then
2323
{ [key]: config[conf] }
@@ -63,7 +63,7 @@ local GovernanceDeployConfig =
6363
default("enableGovernance", "enableGovernance", false)
6464
+ default("governanceTokenSymbol", "governanceTokenSymbol", "NA")
6565
+ default("governanceTokenName", "governanceTokenName", "NotApplicable")
66-
+ optional("governanceTokenOwner", "governanceTokenOwner");
66+
+ require("governanceTokenOwner", "ADMIN_ADDRESS");
6767

6868
local GasPriceOracleDeployConfig =
6969
default("gasPriceOracleOverhead", "gasPriceOracleOverhead", 2100)
@@ -101,8 +101,8 @@ local L2CoreDeployConfig =
101101
+ default("finalizationPeriodSeconds", "finalizationPeriodSeconds", 12)
102102
+ default("maxSequencerDrift", "maxSequencerDrift", 600)
103103
+ default("sequencerWindowSize", "sequencerWindowSize", 3600)
104-
+ default("channelTimeoutBedrock", "channelTimeoutBedrock", 300)
105-
+ default("channelTimeoutGranite", "channelTimeoutGranite", 0)
104+
+ default("channelTimeout", "channelTimeout", 300)
105+
+ optional("channelTimeoutGranite", "channelTimeoutGranite")
106106
+ default("batchInboxAddress", "batchInboxAddress", "0xff00000000000000000000000000000000000000")
107107
+ default("systemConfigStartBlock", "systemConfigStartBlock", 0);
108108

@@ -114,28 +114,33 @@ local AltDADeployConfig =
114114
+ default("daBondSize", "daBondSize", 1000000)
115115
+ default("daResolverRefundPercentage", "daResolverRefundPercentage", 0);
116116

117+
local SuperchainL1DeployConfig =
118+
require("superchainConfigGuardian", "ADMIN_ADDRESS")
119+
+ default("requiredProtocolVersion", "requiredProtocolVersion", "0x0000000000000000000000000000000000000000000000000000000000000000")
120+
+ default("recommendedProtocolVersion", "recommendedProtocolVersion", "0x0000000000000000000000000000000000000000000000000000000000000000");
121+
117122
local OutputOracleDeployConfig =
118123
default("l2OutputOracleSubmissionInterval", "l2OutputOracleSubmissionInterval", 1800)
119-
+ default("l2OutputOracleStartingTimestamp", "l2OutputOracleStartingTimestamp", 0)
120-
+ require("l2OutputOracleStartingBlockNumber", "TIMESTAMP")
124+
+ require("l2OutputOracleStartingTimestamp", "TIMESTAMP")
125+
+ default("l2OutputOracleStartingBlockNumber", "l2OutputOracleStartingBlockNumber", 0)
121126
+ require("l2OutputOracleProposer", "PROPOSER_ADDRESS")
122127
+ require("l2OutputOracleChallenger", "ADMIN_ADDRESS");
123128

124129
local FaultProofDeployConfig =
125-
default("useFaultProof", "useFaultProof", false)
126-
+ optional("faultGameAbsolutePrestate", "faultGameAbsolutePrestate")
127-
+ optional("faultGameMaxDepth", "faultGameMaxDepth")
128-
+ optional("faultGameClockExtension", "faultGameClockExtension")
129-
+ optional("faultGameMaxClockDuration", "faultGameMaxClockDuration")
130-
+ optional("faultGameGenesisBlock", "faultGameGenesisBlock")
131-
+ optional("faultGameGenesisOutputRoot", "faultGameGenesisOutputRoot")
132-
+ optional("faultGameSplitDepth", "faultGameSplitDepth")
133-
+ optional("faultGameWithdrawalDelay", "faultGameWithdrawalDelay")
134-
+ optional("preimageOracleMinProposalSize", "preimageOracleMinProposalSize")
135-
+ optional("preimageOracleChallengePeriod", "preimageOracleChallengePeriod")
136-
+ optional("proofMaturityDelaySeconds", "proofMaturityDelaySeconds")
137-
+ optional("disputeGameFinalityDelaySeconds", "disputeGameFinalityDelaySeconds")
138-
+ optional("respectedGameType", "respectedGameType");
130+
default("useFaultProof", "useFaultProof", true)
131+
+ default("faultGameAbsolutePrestate", "faultGameAbsolutePrestate", "0x0000000000000000000000000000000000000000000000000000000000000000")
132+
+ default("faultGameMaxDepth", "faultGameMaxDepth", 73)
133+
+ default("faultGameClockExtension", "faultGameClockExtension", 18000)
134+
+ default("faultGameMaxClockDuration", "faultGameMaxClockDuration", 302400)
135+
+ default("faultGameGenesisBlock", "faultGameGenesisBlock", 0)
136+
+ default("faultGameGenesisOutputRoot", "faultGameGenesisOutputRoot", "0x0000000000000000000000000000000000000000000000000000000000000000")
137+
+ default("faultGameSplitDepth", "faultGameSplitDepth", 30)
138+
+ default("faultGameWithdrawalDelay", "faultGameWithdrawalDelay", 604800)
139+
+ default("preimageOracleMinProposalSize", "preimageOracleMinProposalSize", 126000)
140+
+ default("preimageOracleChallengePeriod", "preimageOracleChallengePeriod", 86400)
141+
+ default("proofMaturityDelaySeconds", "proofMaturityDelaySeconds", 604800)
142+
+ default("disputeGameFinalityDelaySeconds", "disputeGameFinalityDelaySeconds", 302400)
143+
+ default("respectedGameType", "respectedGameType", 0);
139144

140145
//-----------------------------------------------------------------------//
141146
// output
@@ -153,5 +158,6 @@ L1StartingBlockTag
153158
+ UpgradeScheduleDeployConfig
154159
+ L2CoreDeployConfig
155160
+ AltDADeployConfig
161+
+ SuperchainL1DeployConfig
156162
+ OutputOracleDeployConfig
157163
+ FaultProofDeployConfig

init/3_generate_config.sh

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -eu
23

34
echo "[3/5] : generate config"
45

@@ -7,43 +8,46 @@ block=$(cast block finalized --rpc-url "$L1_RPC_URL")
78
timestamp=$(echo "$block" | awk '/timestamp/ { print $2 }')
89
blockhash=$(echo "$block" | awk '/hash/ { print $2 }')
910

10-
# make necessary args
11-
extCode="{"
12-
extCode+="ADMIN_ADDRESS: \"$ADMIN_ADDRESS\", "
13-
extCode+="BATCHER_ADDRESS: \"$BATCHER_ADDRESS\", "
14-
extCode+="SEQUENCER_ADDRESS: \"$SEQUENCER_ADDRESS\", "
15-
extCode+="PROPOSER_ADDRESS: \"$PROPOSER_ADDRESS\", "
16-
extCode+="TIMESTAMP: \"$timestamp\", "
17-
extCode+="l1StartingBlockTag: \"$blockhash\", "
18-
extCode+="l1ChainID: $L1_CHAIN_ID, "
19-
extCode+="l2ChainID: $L2_CHAIN_ID"
20-
21-
# Governance
11+
base_address="0xff00000000000000000000000000000000000000"
12+
BatchInboxAddress="${base_address%${base_address: -${#L2_CHAIN_ID}}}$L2_CHAIN_ID"
13+
14+
# basic config
15+
config="{"
16+
config+="ADMIN_ADDRESS: \"$ADMIN_ADDRESS\", "
17+
config+="BATCHER_ADDRESS: \"$BATCHER_ADDRESS\", "
18+
config+="SEQUENCER_ADDRESS: \"$SEQUENCER_ADDRESS\", "
19+
config+="PROPOSER_ADDRESS: \"$PROPOSER_ADDRESS\", "
20+
config+="TIMESTAMP: $timestamp, "
21+
config+="l1StartingBlockTag: \"$blockhash\", "
22+
config+="l1ChainID: $L1_CHAIN_ID, "
23+
config+="l2ChainID: $L2_CHAIN_ID"
24+
config+="batchInboxAddress: \"$BatchInboxAddress\""
25+
26+
# Governance config
2227
if [ -n "$GOVERNANCE_TOKEN_SYMBOL" ]; then
23-
extCode+=", "
24-
extCode+="enableGovernance: true, "
25-
extCode+="governanceTokenSymbol: \"$GOVERNANCE_TOKEN_SYMBOL\", "
26-
extCode+="governanceTokenName: \"$GOVERNANCE_TOKEN_SYMBOL\", "
27-
extCode+="governanceTokenOwner: \"$ADMIN_ADDRESS\""
28+
config+=", "
29+
config+="enableGovernance: true, "
30+
config+="governanceTokenSymbol: \"$GOVERNANCE_TOKEN_SYMBOL\", "
31+
config+="governanceTokenName: \"$GOVERNANCE_TOKEN_SYMBOL\", "
32+
config+="governanceTokenOwner: \"$ADMIN_ADDRESS\""
2833
fi
2934

30-
# Alt DA
35+
# Alt DA config
3136
if [ -n "${ALT_DA_SERVER}" ]; then
32-
extCode+=", "
33-
extCode+="altDAServer: \"$ALT_DA_SERVER\", "
34-
extCode+="usePlasma: true, "
35-
extCode+="daCommitmentType: \"KeccakCommitment\", ",
36-
extCode+="daChallengeWindow: 16, ",
37-
extCode+="daResolveWindow: 16, ",
38-
extCode+="daBondSize: 1000000, ",
39-
extCode+="daResolverRefundPercentage: 0"
37+
config+=", "
38+
config+="altDAServer: \"$ALT_DA_SERVER\", "
39+
config+="usePlasma: true, "
40+
config+="daCommitmentType: \"KeccakCommitment\", ",
41+
config+="daChallengeWindow: 16, ",
42+
config+="daResolveWindow: 16, ",
43+
config+="daBondSize: 1000000, ",
44+
config+="daResolverRefundPercentage: 0"
4045
fi
4146

42-
# Fault proof - TODO
43-
44-
extCode+="}"
47+
config+="}"
4548

4649
# Generate the configuration using Jsonnet
4750
cd ~/optimism/packages/contracts-bedrock && \
4851
mkdir -p ./deployments/$DEPLOYMENT_CONTEXT && \
49-
jsonnet /script/3_config.jsonnet --ext-code config="$extCode" > /config/.deploy
52+
jsonnet /script/3_config.jsonnet --ext-code config="$config" > ./deployments/$DEPLOYMENT_CONTEXT/.deploy && \
53+
cp ./deployments/$DEPLOYMENT_CONTEXT/.deploy /config/.deploy

init/4_deploy_contract.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ echo "[deploy contract done!]"
1515

1616
CONTRACT_ADDRESSES_PATH="./deployments/$L1_CHAIN_ID-deploy.json" \
1717
DEPLOY_CONFIG_PATH="./deployments/$DEPLOYMENT_CONTEXT/.deploy" \
18-
FORK="ecotone" \
18+
FORK="fjord" \
1919
forge script scripts/L2Genesis.s.sol:L2Genesis \
2020
--sig 'runWithStateDump()' \
2121
--rpc-url $L1_RPC_URL

init/5_export_genesis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cd ~/optimism/op-node
1010
--outfile.l2 /config/genesis.json \
1111
--outfile.rollup /config/rollup.json \
1212
--l1-rpc $L1_RPC_URL \
13-
--l2-allocs ../packages/contracts-bedrock/state-dump-$DEPLOYMENT_CONTEXT-ecotone.json
13+
--l2-allocs ../packages/contracts-bedrock/state-dump-$DEPLOYMENT_CONTEXT-fjord.json
1414

1515
cp ../packages/contracts-bedrock/deployments/$L1_CHAIN_ID-deploy.json /config/deploy.json
1616

0 commit comments

Comments
 (0)