From f7be823fa55d7f052503652a36509178904dc7af Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Thu, 13 Jun 2024 21:54:44 +0200 Subject: [PATCH 1/5] Remove pnpm prepare reference --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 02ea6b71f14f..174909d18faf 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,6 @@ build-ts: submodules . $$NVM_DIR/nvm.sh && nvm use; \ fi pnpm install:ci - pnpm prepare pnpm build .PHONY: build-ts From 9174c2f1707f65c0a8eaac139c8e65d9ca692e05 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Thu, 13 Jun 2024 21:55:04 +0200 Subject: [PATCH 2/5] Included some extra customization to config.sh file --- .envrc.example | 5 +++ .../getting-started/config-vars-celo.sh | 37 ++++++++++++++----- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/.envrc.example b/.envrc.example index 43ccf74842b6..665ec2002392 100644 --- a/.envrc.example +++ b/.envrc.example @@ -66,3 +66,8 @@ 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 diff --git a/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh b/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh index 52520eb0d07b..834156a25fec 100755 --- a/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh +++ b/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh @@ -13,16 +13,25 @@ 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" # 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 @@ -31,15 +40,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, @@ -65,10 +74,10 @@ config=$(cat << EOL "l1FeeVaultWithdrawalNetwork": 0, "sequencerFeeVaultWithdrawalNetwork": 0, - "gasPriceOracleOverhead": 2100, + "gasPriceOracleOverhead": 0, "gasPriceOracleScalar": 1000000, - "enableGovernance": true, + "enableGovernance": $ENABLE_GOVERNANCE, "governanceTokenSymbol": "OP", "governanceTokenName": "Optimism", "governanceTokenOwner": "$GS_ADMIN_ADDRESS", @@ -81,7 +90,8 @@ config=$(cat << EOL "eip1559DenominatorCanyon": 250, "eip1559Elasticity": 6, - "l2GenesisDeltaTimeOffset": null, + "l2GenesisEcotoneTimeOffset": "0x0", + "l2GenesisDeltaTimeOffset": "0x0", "l2GenesisCanyonTimeOffset": "0x0", "systemConfigStartBlock": 0, @@ -91,19 +101,28 @@ config=$(cat << EOL "faultGameAbsolutePrestate": "0x03c7ae758795765c6664a5d39bf63841c71ff191e9189522bad8ebff5d4eca98", "faultGameMaxDepth": 44, - "faultGameMaxDuration": 1200, + "faultGameClockExtension": 0, + "faultGameMaxClockDuration": 600, "faultGameGenesisBlock": 0, "faultGameGenesisOutputRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "faultGameSplitDepth": 14, + "faultGameWithdrawalDelay": 604800, "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 } EOL ) From 7d4f1d71ed4707f5e9f1d3a93a22b9de4ea8dc8c Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Fri, 21 Jun 2024 15:27:10 +0200 Subject: [PATCH 3/5] Update config-vars-celo.sh Included Fjord hardfork --- .../scripts/getting-started/config-vars-celo.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh b/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh index 834156a25fec..52e60cb31e0f 100755 --- a/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh +++ b/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh @@ -90,6 +90,7 @@ config=$(cat << EOL "eip1559DenominatorCanyon": 250, "eip1559Elasticity": 6, + "l2GenesisFjordTimeOffset": "0x0", "l2GenesisEcotoneTimeOffset": "0x0", "l2GenesisDeltaTimeOffset": "0x0", "l2GenesisCanyonTimeOffset": "0x0", From d17b85641ae383185f817404e2f5349eac9f0540 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Fri, 21 Jun 2024 15:33:39 +0200 Subject: [PATCH 4/5] Update config-vars-celo.sh Adding deployCeloContracts config --- .../scripts/getting-started/config-vars-celo.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh b/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh index 52e60cb31e0f..979fcb49627c 100755 --- a/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh +++ b/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh @@ -77,6 +77,8 @@ config=$(cat << EOL "gasPriceOracleOverhead": 0, "gasPriceOracleScalar": 1000000, + "deployCeloContracts": true, + "enableGovernance": $ENABLE_GOVERNANCE, "governanceTokenSymbol": "OP", "governanceTokenName": "Optimism", From 4812ca002214be043016d572d0db075b7442ea50 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Mon, 24 Jun 2024 11:48:18 +0200 Subject: [PATCH 5/5] Exposed DEPLOY_CELO_CONTRACTS in envrc --- .envrc.example | 2 ++ .../scripts/getting-started/config-vars-celo.sh | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.envrc.example b/.envrc.example index 665ec2002392..d917ad07ab18 100644 --- a/.envrc.example +++ b/.envrc.example @@ -71,3 +71,5 @@ export PRIVATE_KEY= 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 diff --git a/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh b/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh index 979fcb49627c..4de42fc4c1d6 100755 --- a/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh +++ b/packages/contracts-bedrock/scripts/getting-started/config-vars-celo.sh @@ -25,6 +25,7 @@ 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") @@ -77,7 +78,7 @@ config=$(cat << EOL "gasPriceOracleOverhead": 0, "gasPriceOracleScalar": 1000000, - "deployCeloContracts": true, + "deployCeloContracts": $DEPLOY_CELO_CONTRACTS, "enableGovernance": $ENABLE_GOVERNANCE, "governanceTokenSymbol": "OP",