|
| 1 | +//-----------------------------------------------------------------------// |
| 2 | +// args / funcs |
| 3 | + |
| 4 | +local config = std.extVar("config"); |
| 5 | + |
| 6 | +// if not exist conf, throw an error |
| 7 | +local require(key, conf) = |
| 8 | + if std.objectHas(config, conf) then |
| 9 | + { [key]: config[conf] } |
| 10 | + else |
| 11 | + error "required field not found :" + conf; |
| 12 | + |
| 13 | +// if not exist conf, return the default value |
| 14 | +local default(key, conf, default) = |
| 15 | + if std.objectHas(config, conf) then |
| 16 | + { [key]: config[conf] } |
| 17 | + else |
| 18 | + { [key]: default }; |
| 19 | + |
| 20 | +// if not exist conf, return empty |
| 21 | +local optional(key, conf) = |
| 22 | + if std.objectHas(config, conf) then |
| 23 | + { [key]: config[conf] } |
| 24 | + else |
| 25 | + {}; |
| 26 | + |
| 27 | +//-----------------------------------------------------------------------// |
| 28 | +// elements |
| 29 | + |
| 30 | +local L1StartingBlockTag = |
| 31 | + require("l1StartingBlockTag", "l1StartingBlockTag"); |
| 32 | + |
| 33 | +local DevDeployConfig = |
| 34 | + default("fundDevAccounts", "fundDevAccounts", false); |
| 35 | + |
| 36 | +local L2GenesisBlockDeployConfig = |
| 37 | + optional("l2GenesisBlockNonce", "l2GenesisBlockNonce") |
| 38 | + + default("l2GenesisBlockGasLimit", "l2GenesisBlockGasLimit", "0x1c9c380") // 30_000_000 |
| 39 | + + optional("l2GenesisBlockDifficulty", "l2GenesisBlockDifficulty") |
| 40 | + + optional("l2GenesisBlockMixHash", "l2GenesisBlockMixHash") |
| 41 | + + optional("l2GenesisBlockNumber", "l2GenesisBlockNumber") |
| 42 | + + optional("l2GenesisBlockGasUsed", "l2GenesisBlockGasUsed") |
| 43 | + + optional("l2GenesisBlockParentHash", "l2GenesisBlockParentHash") |
| 44 | + + default("l2GenesisBlockBaseFeePerGas", "l2GenesisBlockBaseFeePerGas", "0x3b9aca00") // 1_000_000_000 |
| 45 | + + optional("l2GenesisBlockExtraData", "l2GenesisBlockExtraData"); |
| 46 | + |
| 47 | +local OwnershipDeployConfig = |
| 48 | + require("proxyAdminOwner", "ADMIN_ADDRESS") |
| 49 | + + require("finalSystemOwner", "ADMIN_ADDRESS"); |
| 50 | + |
| 51 | +local L2VaultsDeployConfig = |
| 52 | + require("baseFeeVaultRecipient", "ADMIN_ADDRESS") |
| 53 | + + require("l1FeeVaultRecipient", "ADMIN_ADDRESS") |
| 54 | + + require("sequencerFeeVaultRecipient", "ADMIN_ADDRESS") |
| 55 | + + default("baseFeeVaultMinimumWithdrawalAmount", "baseFeeVaultMinimumWithdrawalAmount", "0x8ac7230489e80000") // 10000000000000000000 |
| 56 | + + default("l1FeeVaultMinimumWithdrawalAmount", "l1FeeVaultMinimumWithdrawalAmount", "0x8ac7230489e80000") // 10000000000000000000 |
| 57 | + + default("sequencerFeeVaultMinimumWithdrawalAmount", "sequencerFeeVaultMinimumWithdrawalAmount", "0x8ac7230489e80000") // 10000000000000000000 |
| 58 | + + default("baseFeeVaultWithdrawalNetwork", "baseFeeVaultWithdrawalNetwork", 0) |
| 59 | + + default("l1FeeVaultWithdrawalNetwork", "l1FeeVaultWithdrawalNetwork", 0) |
| 60 | + + default("sequencerFeeVaultWithdrawalNetwork", "sequencerFeeVaultWithdrawalNetwork", 0); |
| 61 | + |
| 62 | +local GovernanceDeployConfig = |
| 63 | + default("enableGovernance", "enableGovernance", false) |
| 64 | + + default("governanceTokenSymbol", "governanceTokenSymbol", "NA") |
| 65 | + + default("governanceTokenName", "governanceTokenName", "NotApplicable") |
| 66 | + + require("governanceTokenOwner", "ADMIN_ADDRESS"); |
| 67 | + |
| 68 | +local GasPriceOracleDeployConfig = |
| 69 | + default("gasPriceOracleOverhead", "gasPriceOracleOverhead", 2100) |
| 70 | + + default("gasPriceOracleScalar", "gasPriceOracleScalar", 1000000) |
| 71 | + + default("gasPriceOracleBaseFeeScalar", "gasPriceOracleBaseFeeScalar", 1368) |
| 72 | + + default("gasPriceOracleBlobBaseFeeScalar", "gasPriceOracleBlobBaseFeeScalar", 810949); |
| 73 | + |
| 74 | +local GasTokenDeployConfig = |
| 75 | + default("useCustomGasToken", "useCustomGasToken", false) |
| 76 | + + optional("customGasTokenAddress", "customGasTokenAddress"); |
| 77 | + |
| 78 | +local OperatorDeployConfig = |
| 79 | + require("p2pSequencerAddress", "SEQUENCER_ADDRESS") |
| 80 | + + require("batchSenderAddress", "BATCHER_ADDRESS"); |
| 81 | + |
| 82 | +local EIP1559DeployConfig = |
| 83 | + default("eip1559Elasticity", "eip1559Elasticity", 6) |
| 84 | + + default("eip1559Denominator", "eip1559Denominator", 50) |
| 85 | + + default("eip1559DenominatorCanyon", "eip1559DenominatorCanyon", 250); |
| 86 | + |
| 87 | +local UpgradeScheduleDeployConfig = |
| 88 | + default("l2GenesisRegolithTimeOffset", "l2GenesisRegolithTimeOffset", "0x0") |
| 89 | + + default("l2GenesisCanyonTimeOffset", "l2GenesisCanyonTimeOffset", "0x0") |
| 90 | + + default("l2GenesisDeltaTimeOffset", "l2GenesisDeltaTimeOffset", "0x0") |
| 91 | + + default("l2GenesisEcotoneTimeOffset", "l2GenesisEcotoneTimeOffset", "0x0") |
| 92 | + + default("l2GenesisFjordTimeOffset", "l2GenesisFjordTimeOffset", "0x0") |
| 93 | + // + default("l2GenesisGraniteTimeOffset", "l2GenesisGraniteTimeOffset", "0x0") // not used now |
| 94 | + + default("l2GenesisInteropTimeOffset", "l2GenesisInteropTimeOffset", "0x0") |
| 95 | + + default("useInterop", "useInterop", false); |
| 96 | + |
| 97 | +local L2CoreDeployConfig = |
| 98 | + require("l1ChainID", "l1ChainID") |
| 99 | + + require("l2ChainID", "l2ChainID") |
| 100 | + + default("l2BlockTime", "l2BlockTime", 2) |
| 101 | + + default("finalizationPeriodSeconds", "finalizationPeriodSeconds", 12) |
| 102 | + + default("maxSequencerDrift", "maxSequencerDrift", 600) |
| 103 | + + default("sequencerWindowSize", "sequencerWindowSize", 3600) |
| 104 | + + default("channelTimeout", "channelTimeout", 300) |
| 105 | + + optional("channelTimeoutGranite", "channelTimeoutGranite") |
| 106 | + + default("batchInboxAddress", "batchInboxAddress", "0xff00000000000000000000000000000000000000") |
| 107 | + + default("systemConfigStartBlock", "systemConfigStartBlock", 0); |
| 108 | + |
| 109 | +local AltDADeployConfig = |
| 110 | + default("usePlasma", "usePlasma", false) |
| 111 | + + default("daCommitmentType", "daCommitmentType", "KeccakCommitment") |
| 112 | + + default("daChallengeWindow", "daChallengeWindow", 16) |
| 113 | + + default("daResolveWindow", "daResolveWindow", 16) |
| 114 | + + default("daBondSize", "daBondSize", 1000000) |
| 115 | + + default("daResolverRefundPercentage", "daResolverRefundPercentage", 0); |
| 116 | + |
| 117 | +local DevL1DeployConfig = |
| 118 | + default("l1BlockTime", "l1BlockTime", 12) |
| 119 | + + optional("l1GenesisBlockTimestamp", "l1GenesisBlockTimestamp") |
| 120 | + + optional("l1GenesisBlockNonce", "l1GenesisBlockNonce") |
| 121 | + + optional("l1GenesisBlockGasLimit", "l1GenesisBlockGasLimit") |
| 122 | + + optional("l1GenesisBlockDifficulty", "l1GenesisBlockDifficulty") |
| 123 | + + optional("l1GenesisBlockMixHash", "l1GenesisBlockMixHash") |
| 124 | + + optional("l1GenesisBlockCoinbase", "l1GenesisBlockCoinbase") |
| 125 | + + optional("l1GenesisBlockNumber", "l1GenesisBlockNumber") |
| 126 | + + optional("l1GenesisBlockGasUsed", "l1GenesisBlockGasUsed") |
| 127 | + + optional("l1GenesisBlockParentHash", "l1GenesisBlockParentHash") |
| 128 | + + optional("l1GenesisBlockBaseFeePerGas", "l1GenesisBlockBaseFeePerGas") |
| 129 | + + optional("l1GenesisBlockExcessBlobGas", "l1GenesisBlockExcessBlobGas") |
| 130 | + + optional("l1GenesisBlockblobGasUsed", "l1GenesisBlockblobGasUsed"); |
| 131 | + |
| 132 | +local SuperchainL1DeployConfig = |
| 133 | + require("superchainConfigGuardian", "ADMIN_ADDRESS") |
| 134 | + + default("requiredProtocolVersion", "requiredProtocolVersion", "0x0000000000000000000000000000000000000000000000000000000000000000") |
| 135 | + + default("recommendedProtocolVersion", "recommendedProtocolVersion", "0x0000000000000000000000000000000000000000000000000000000000000000"); |
| 136 | + |
| 137 | +local OutputOracleDeployConfig = |
| 138 | + default("l2OutputOracleSubmissionInterval", "l2OutputOracleSubmissionInterval", 1800) |
| 139 | + + require("l2OutputOracleStartingTimestamp", "TIMESTAMP") |
| 140 | + + default("l2OutputOracleStartingBlockNumber", "l2OutputOracleStartingBlockNumber", 0) |
| 141 | + + require("l2OutputOracleProposer", "PROPOSER_ADDRESS") |
| 142 | + + require("l2OutputOracleChallenger", "ADMIN_ADDRESS"); |
| 143 | + |
| 144 | +local FaultProofDeployConfig = |
| 145 | + default("useFaultProofs", "useFaultProofs", true) |
| 146 | + + default("faultGameAbsolutePrestate", "faultGameAbsolutePrestate", "0x0000000000000000000000000000000000000000000000000000000000000000") |
| 147 | + + default("faultGameMaxDepth", "faultGameMaxDepth", 73) |
| 148 | + + default("faultGameClockExtension", "faultGameClockExtension", 18000) |
| 149 | + + default("faultGameMaxClockDuration", "faultGameMaxClockDuration", 302400) |
| 150 | + + default("faultGameGenesisBlock", "faultGameGenesisBlock", 0) |
| 151 | + + default("faultGameGenesisOutputRoot", "faultGameGenesisOutputRoot", "0x0000000000000000000000000000000000000000000000000000000000000000") |
| 152 | + + default("faultGameSplitDepth", "faultGameSplitDepth", 30) |
| 153 | + + default("faultGameWithdrawalDelay", "faultGameWithdrawalDelay", 604800) |
| 154 | + + default("preimageOracleMinProposalSize", "preimageOracleMinProposalSize", 126000) |
| 155 | + + default("preimageOracleChallengePeriod", "preimageOracleChallengePeriod", 86400) |
| 156 | + + default("proofMaturityDelaySeconds", "proofMaturityDelaySeconds", 604800) |
| 157 | + + default("disputeGameFinalityDelaySeconds", "disputeGameFinalityDelaySeconds", 302400) |
| 158 | + + default("respectedGameType", "respectedGameType", 0); |
| 159 | + |
| 160 | +//-----------------------------------------------------------------------// |
| 161 | +// output |
| 162 | + |
| 163 | +L1StartingBlockTag |
| 164 | ++ DevDeployConfig |
| 165 | ++ L2GenesisBlockDeployConfig |
| 166 | ++ OwnershipDeployConfig |
| 167 | ++ L2VaultsDeployConfig |
| 168 | ++ GovernanceDeployConfig |
| 169 | ++ GasPriceOracleDeployConfig |
| 170 | ++ GasTokenDeployConfig |
| 171 | ++ OperatorDeployConfig |
| 172 | ++ EIP1559DeployConfig |
| 173 | ++ UpgradeScheduleDeployConfig |
| 174 | ++ L2CoreDeployConfig |
| 175 | ++ AltDADeployConfig |
| 176 | ++ DevL1DeployConfig |
| 177 | ++ SuperchainL1DeployConfig |
| 178 | ++ OutputOracleDeployConfig |
| 179 | ++ FaultProofDeployConfig |
0 commit comments