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

feat: Adding some extra config to config.sh script #151

Merged
merged 6 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions .envrc.example
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,10 @@ export ETHERSCAN_API_KEY=
# Private key to use for contract deployments, you don't need to worry about
# this for the Getting Started guide.
export PRIVATE_KEY=

# CELO additional configuration
export ENABLE_GOVERNANCE=false
export FUNDS_DEV_ACCOUNTS=false
export USE_PLASMA=false
# Set to false if migrating state from a Celo L1. True for new testnets
export DEPLOY_CELO_CONTRACTS=false
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ build-ts: submodules
. $$NVM_DIR/nvm.sh && nvm use; \
fi
pnpm install:ci
pnpm prepare
pnpm build
.PHONY: build-ts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,26 @@ reqenv() {
}

# Check required environment variables
reqenv "DEPLOYMENT_CONTEXT"
reqenv "GS_ADMIN_ADDRESS"
reqenv "GS_BATCHER_ADDRESS"
reqenv "GS_PROPOSER_ADDRESS"
reqenv "GS_SEQUENCER_ADDRESS"
reqenv "L1_RPC_URL"
reqenv "L1_CHAIN_ID"
reqenv "L2_CHAIN_ID"
reqenv "L1_BLOCK_TIME"
reqenv "L2_BLOCK_TIME"
reqenv "FUNDS_DEV_ACCOUNTS"
reqenv "USE_PLASMA"
reqenv "DEPLOY_CELO_CONTRACTS"

# Get the finalized block timestamp and hash
block=$(cast block finalized --rpc-url "$L1_RPC_URL")
timestamp=$(echo "$block" | awk '/timestamp/ { print $2 }')
blockhash=$(echo "$block" | awk '/hash/ { print $2 }')
batchInboxAddressSuffix=$(printf "%0$(expr 38 - ${#L2_CHAIN_ID})d" 0)$L2_CHAIN_ID
batchInboxAddress=0xff$batchInboxAddressSuffix

# Generate the config file
config=$(cat << EOL
Expand All @@ -31,15 +41,15 @@ config=$(cat << EOL

"l1ChainID": $L1_CHAIN_ID,
"l2ChainID": $L2_CHAIN_ID,
"l2BlockTime": 2,
"l1BlockTime": 12,
"l2BlockTime": $L2_BLOCK_TIME,
"l1BlockTime": $L1_BLOCK_TIME,

"maxSequencerDrift": 600,
"sequencerWindowSize": 3600,
"channelTimeout": 300,

"p2pSequencerAddress": "$GS_SEQUENCER_ADDRESS",
"batchInboxAddress": "0xff00000000000000000000000000000000042069",
"batchInboxAddress": "$batchInboxAddress",
"batchSenderAddress": "$GS_BATCHER_ADDRESS",

"l2OutputOracleSubmissionInterval": 120,
Expand All @@ -65,10 +75,12 @@ config=$(cat << EOL
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,

"gasPriceOracleOverhead": 2100,
"gasPriceOracleOverhead": 0,
"gasPriceOracleScalar": 1000000,

"enableGovernance": true,
"deployCeloContracts": $DEPLOY_CELO_CONTRACTS,

"enableGovernance": $ENABLE_GOVERNANCE,
"governanceTokenSymbol": "OP",
"governanceTokenName": "Optimism",
"governanceTokenOwner": "$GS_ADMIN_ADDRESS",
Expand All @@ -81,7 +93,9 @@ config=$(cat << EOL
"eip1559DenominatorCanyon": 250,
"eip1559Elasticity": 6,

"l2GenesisDeltaTimeOffset": null,
"l2GenesisFjordTimeOffset": "0x0",
"l2GenesisEcotoneTimeOffset": "0x0",
"l2GenesisDeltaTimeOffset": "0x0",
"l2GenesisCanyonTimeOffset": "0x0",

"systemConfigStartBlock": 0,
Expand All @@ -92,7 +106,7 @@ config=$(cat << EOL
"faultGameAbsolutePrestate": "0x03c7ae758795765c6664a5d39bf63841c71ff191e9189522bad8ebff5d4eca98",
"faultGameMaxDepth": 44,
"faultGameClockExtension": 0,
"faultGameMaxClockDuration": 1200,
"faultGameMaxClockDuration": 600,
"faultGameGenesisBlock": 0,
"faultGameGenesisOutputRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"faultGameSplitDepth": 14,
Expand All @@ -101,11 +115,18 @@ config=$(cat << EOL
"preimageOracleMinProposalSize": 1800000,
"preimageOracleChallengePeriod": 86400,

"fundDevAccounts": false,
"fundDevAccounts": $FUNDS_DEV_ACCOUNTS,
"useFaultProofs": false,
"proofMaturityDelaySeconds": 604800,
"disputeGameFinalityDelaySeconds": 302400,
"respectedGameType": 0
"respectedGameType": 0,

"usePlasma": $USE_PLASMA,
"daCommitmentType": "KeccakCommitment",
"daChallengeWindow": 160,
"daResolveWindow": 160,
"daBondSize": 1000000,
"daResolverRefundPercentage": 0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if there's a use case for it, but you could add deployCeloContracts here as well.

}
EOL
)
Expand Down