Skip to content

Commit 449cea8

Browse files
committed
tidy jsonnet code
1 parent 51037d9 commit 449cea8

4 files changed

Lines changed: 46 additions & 84 deletions

File tree

init/.deploy

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

init/3_config.jsonnet

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ local L2VaultsDeployConfig =
5252
require("baseFeeVaultRecipient", "ADMIN_ADDRESS")
5353
+ require("l1FeeVaultRecipient", "ADMIN_ADDRESS")
5454
+ require("sequencerFeeVaultRecipient", "ADMIN_ADDRESS")
55-
+ default("baseFeeVaultMinimumWithdrawalAmount", "baseFeeVaultMinimumWithdrawalAmount", "0x8ac7230489e80000") # 10000000000000000000
56-
+ default("l1FeeVaultMinimumWithdrawalAmount", "l1FeeVaultMinimumWithdrawalAmount", "0x8ac7230489e80000") # 10000000000000000000
57-
+ default("sequencerFeeVaultMinimumWithdrawalAmount", "sequencerFeeVaultMinimumWithdrawalAmount", "0x8ac7230489e80000") #10000000000000000000
55+
+ default("baseFeeVaultMinimumWithdrawalAmount", "baseFeeVaultMinimumWithdrawalAmount", "0x8ac7230489e80000") // 10000000000000000000
56+
+ default("l1FeeVaultMinimumWithdrawalAmount", "l1FeeVaultMinimumWithdrawalAmount", "0x8ac7230489e80000") // 10000000000000000000
57+
+ default("sequencerFeeVaultMinimumWithdrawalAmount", "sequencerFeeVaultMinimumWithdrawalAmount", "0x8ac7230489e80000") // 10000000000000000000
5858
+ default("baseFeeVaultWithdrawalNetwork", "baseFeeVaultWithdrawalNetwork", 0)
5959
+ default("l1FeeVaultWithdrawalNetwork", "l1FeeVaultWithdrawalNetwork", 0)
6060
+ default("sequencerFeeVaultWithdrawalNetwork", "sequencerFeeVaultWithdrawalNetwork", 0);
@@ -97,7 +97,7 @@ local UpgradeScheduleDeployConfig =
9797
local L2CoreDeployConfig =
9898
require("l1ChainID", "l1ChainID")
9999
+ require("l2ChainID", "l2ChainID")
100-
+ require("l2BlockTime", "l2BlockTime")
100+
+ require("l2BlockTime", "TIMESTAMP")
101101
+ default("finalizationPeriodSeconds", "finalizationPeriodSeconds", 12)
102102
+ default("maxSequencerDrift", "maxSequencerDrift", 600)
103103
+ default("sequencerWindowSize", "sequencerWindowSize", 3600)
@@ -115,11 +115,11 @@ local AltDADeployConfig =
115115
+ default("daResolverRefundPercentage", "daResolverRefundPercentage", 0);
116116

117117
local OutputOracleDeployConfig =
118-
optional("l2OutputOracleSubmissionInterval", "l2OutputOracleSubmissionInterval")
119-
+ optional("l2OutputOracleStartingTimestamp", "l2OutputOracleStartingTimestamp")
120-
+ optional("l2OutputOracleStartingBlockNumber", "l2OutputOracleStartingBlockNumber")
121-
+ optional("l2OutputOracleProposer", "l2OutputOracleProposer")
122-
+ optional("l2OutputOracleChallenger", "l2OutputOracleChallenger");
118+
default("l2OutputOracleSubmissionInterval", "l2OutputOracleSubmissionInterval", 1800)
119+
+ default("l2OutputOracleStartingTimestamp", "l2OutputOracleStartingTimestamp", 0)
120+
+ require("l2OutputOracleStartingBlockNumber", "TIMESTAMP")
121+
+ require("l2OutputOracleProposer", "PROPOSER_ADDRESS")
122+
+ require("l2OutputOracleChallenger", "ADMIN_ADDRESS");
123123

124124
local FaultProofDeployConfig =
125125
default("useFaultProof", "useFaultProof", false)

init/3_generate_config.sh

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,43 @@ block=$(cast block finalized --rpc-url "$L1_RPC_URL")
77
timestamp=$(echo "$block" | awk '/timestamp/ { print $2 }')
88
blockhash=$(echo "$block" | awk '/hash/ { print $2 }')
99

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
22+
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+
fi
29+
30+
# Alt DA
31+
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"
40+
fi
41+
42+
# Fault proof - TODO
43+
44+
extCode+="}"
45+
1046
# Generate the configuration using Jsonnet
1147
cd ~/optimism/packages/contracts-bedrock && \
1248
mkdir -p ./deployments/$DEPLOYMENT_CONTEXT && \
13-
jsonnet /script/3_config.jsonnet --ext-code config='{
14-
ADMIN_ADDRESS: "$ADMIN_ADDRESS",
15-
BATCHER_ADDRESS: "$BATCHER_ADDRESS",
16-
SEQUENCER_ADDRESS: "$SEQUENCER_ADDRESS",
17-
TIMESTAMP: "$timestamp",
18-
l1ChainID: "$L1_CHAIN_ID",
19-
l2ChainID: "$L2_CHAIN_ID",
20-
l2BlockTime: "$timestamp",
21-
l1StartingBlockTag: "$blockhash",
22-
}' > /config/.deploy
49+
jsonnet /script/3_config.jsonnet --ext-code config="$extCode" > /config/.deploy

init/3_sample.sh

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

0 commit comments

Comments
 (0)