From cbb07181a88aaebcc100160eb2aeb6fbe707aa0c Mon Sep 17 00:00:00 2001 From: Zach Showalter Date: Wed, 18 Dec 2024 11:26:15 -0500 Subject: [PATCH] Fix test-node utils. (#78) * Update migration test for TEE integration This commit updates the migration-test.bash script to reflect the new migration flow for the TEE integration. It also adds some utility scripts and updates some exsisting example files to assist in the migration test. * Remove changes to docker-compose.yml * Respond to review feedback * Update migration test to be compatible with integration branch * Fix the batch poster In this commit, a dummy TEE Verifier address is being used, we will use a correct one later * Fix config.ts to allow sequencer node to start * Update orbit-actions sub-module to integration branch * update migration test to point at integration branch * Fix smoke test --------- Co-authored-by: ImJeremyHe --- .github/workflows/ci.yml | 2 +- docker-compose.yaml | 4 - espresso-tests/.env | 17 ++-- ...loyAndInitEspressoSequencerInboxTest.s.sol | 37 ++++++++ espresso-tests/DeployMockVerifier.s.sol | 14 +++ espresso-tests/migration-test.bash | 92 ++++++++++--------- espresso-tests/test-chain-config.json | 29 ++++++ orbit-actions | 2 +- rollupcreator/Dockerfile | 2 + scripts/config.ts | 31 +------ scripts/index.ts | 1 + 11 files changed, 144 insertions(+), 87 deletions(-) create mode 100644 espresso-tests/DeployAndInitEspressoSequencerInboxTest.s.sol create mode 100644 espresso-tests/DeployMockVerifier.s.sol create mode 100644 espresso-tests/test-chain-config.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd2eb2a4..a77da3c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ on: jobs: build_and_run: - runs-on: ubuntu-8 + runs-on: ubuntu-latest strategy: matrix: pos: [pos, no-pos] diff --git a/docker-compose.yaml b/docker-compose.yaml index d2d828e0..e73f6d89 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -15,8 +15,6 @@ services: bin/blockscout eval "Elixir.Explorer.ReleaseTasks.create_and_migrate()" node init/install.js postgres 5432 bin/blockscout start - extra_hosts: - - "host.docker.internal:host-gateway" env_file: - ./blockscout/nitro.env environment: @@ -444,8 +442,6 @@ services: timeout: 10s retries: 5 start_period: 40s - extra_hosts: - - "host.docker.internal:host-gateway" # Reads from sequencer feed, forwards transactions to sequencer full-node: diff --git a/espresso-tests/.env b/espresso-tests/.env index 9cb0f2bc..64ef26e8 100644 --- a/espresso-tests/.env +++ b/espresso-tests/.env @@ -6,18 +6,19 @@ PARENT_CHAIN_RPC_URL="http://localhost:8545" CHILD_CHAIN_RPC_URL="http://localhost:8547" # Environment variables for new OSP deployment # These are essential for the upgrade -HOTSHOT_ADDRESS="0xb6eb235fa509e3206f959761d11e3777e16d0e98" PARENT_CHAIN_UPGRADE_EXECUTOR="0x513D9F96d4D0563DEbae8a0DC307ea0E46b10ed7" CHILD_CHAIN_UPGRADE_EXUCTOR_ADDRESS="0xD59870177729b1Fa7CCdA1d2E245C57C6ad5F9F6" # Environment variables for osp migration action contract -CURRENT_OSP_ENTRY="0x9C2eD9F57D053FDfAEcBF1B6Dfd7C97e2e340B84" ROLLUP_ADDRESS="0x0DFDF1473B14D2330A40F6a42bb6d601DD121E6b" -PROXY_ADMIN="0x2A1f38c9097e7883570e0b02BFBE6869Cc25d8a3" +PROXY_ADMIN_ADDRESS="0x2A1f38c9097e7883570e0b02BFBE6869Cc25d8a3" # Environment variables for ArbOS upgrade action. UPGRADE_TIMESTAMP="1723664126" -NEW_WASM_MODULE_ROOT="0x2422802a7cda99737209430b103689205bc8e56eab8b08c6ad409e65e45c3145" -CURRENT_WASM_MODULE_ROOT="0xbc1026ff45c20ea97e9e6057224a5668ea78d8f885c9b14fc849238e8ef5c5dc" - -#Environment variables used in test assertions -CHALLENGE_MANAGER_ADDRESS="0x784FC11476F3d06801A76b944795E6367391b12e" +# The reader addr is only important if the parent chain is not an arbitrum chain, this is important for the batch poster. +READER_ADDRESS="0x7DD3F2a3fAeF3B9F2364c335163244D3388Feb83" +IS_USING_FEE_TOKEN="false" +IS_MIGRATION_TEST="true" +MAX_DATA_SIZE="117964" +OLD_BATCH_POSTER_ADDRESS="0xe2148eE53c0755215Df69b2616E552154EdC584f" +NEW_BATCH_POSTER_ADDRESS="0xe2148eE53c0755215Df69b2616E552154EdC584f" +BATCH_POSTER_MANAGER_ADDRESS="0xe2148eE53c0755215Df69b2616E552154EdC584f" diff --git a/espresso-tests/DeployAndInitEspressoSequencerInboxTest.s.sol b/espresso-tests/DeployAndInitEspressoSequencerInboxTest.s.sol new file mode 100644 index 00000000..f213bc41 --- /dev/null +++ b/espresso-tests/DeployAndInitEspressoSequencerInboxTest.s.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.9; + +import "forge-std/Script.sol"; +import "nitro-contracts/bridge/SequencerInbox.sol"; +import "nitro-contracts/bridge/ISequencerInbox.sol"; + +/// @notice This contract deploys and initializes a sequencerInbox contract that orbit chains can migrate to that enables compatibility +/// with the espresso confirmation layer +/// @dev BATCH_POSTER_ADDRS should be a comma delimited list that includes addresses. This list will give batch posting affordances to those addresses +/// For chains using the Espresso TEE integration, this will be the address of your new batch poster, if you decide to change it. +contract DeployAndInitEspressoSequencerInboxTest is Script { + function run() external { + bool isMigrationTest = vm.envBool("IS_MIGRATION_TEST"); + // Grab addresses from env + address reader4844Addr = vm.envAddress("READER_ADDRESS"); + + // Grab any uints we need to initialize the contract from envAddress + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + uint256 maxDataSize = vm.envUint("MAX_DATA_SIZE"); + // Grab booleans we need from env + bool isUsingFeeToken = vm.envBool("IS_USING_FEE_TOKEN"); + // Trick the Vm into seeing that this opcode exsists if this isn't the migration test + if (!isMigrationTest){ + bytes memory code = vm.getDeployedCode("ArbSysMock.sol:ArbSysMock"); + vm.etch(0x0000000000000000000000000000000000000064, code); + } + // initialize interfaces needed + IReader4844 reader = IReader4844(reader4844Addr); + // Start broadcast to deploy the SequencerInbox + vm.startBroadcast(deployerPrivateKey); + SequencerInbox sequencerInbox = new SequencerInbox(maxDataSize, reader, isUsingFeeToken); + + // Setting batch posters and batch poster manager + vm.stopBroadcast(); + } +} diff --git a/espresso-tests/DeployMockVerifier.s.sol b/espresso-tests/DeployMockVerifier.s.sol new file mode 100644 index 00000000..cdc60a11 --- /dev/null +++ b/espresso-tests/DeployMockVerifier.s.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.9; + +import "forge-std/Script.sol"; +import "nitro-contracts/mocks/EspressoTEEVerifier.sol"; + +contract DeployMockVerifier is Script { + function run() external { + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(deployerPrivateKey); + EspressoTEEVerifierMock mockVerifier = new EspressoTEEVerifierMock(); + vm.stopBroadcast(); + } +} diff --git a/espresso-tests/migration-test.bash b/espresso-tests/migration-test.bash index c030e553..1b063751 100755 --- a/espresso-tests/migration-test.bash +++ b/espresso-tests/migration-test.bash @@ -19,23 +19,24 @@ ORBIT_ACTIONS_DIR="$TESTNODE_DIR/orbit-actions" cd "$ORBIT_ACTIONS_DIR" git submodule update --init +forge update yarn # Change to the top level directory for the purposes of the test. cd "$TESTNODE_DIR" # Initialize a standard network not compatible with espresso to simulate a pre-upgrade orbit network e.g. not needed for the real migration -./test-node.bash --simple --init-force --tokenbridge --detach +./test-node.bash --simple --init-force --tokenbridge --detach --no-build-utils # Start espresso sequencer node for the purposes of the test e.g. not needed for the real migration. docker compose up espresso-dev-node --detach # Export environment variables in .env file -# A similar env file should be supplied for whatever +# A similar env file should be supplied for whatever . "$TEST_DIR/.env" # Overwrite the ROLLUP_ADDRESS for this test, it might not be the same as the one in the .env file -#* Essential migration sub step * This address (the rollup proxy address) is likely a known address to operators. +#* Essential migration sub step * This address (the rollup proxy address) is likely a known address to operators. ROLLUP_ADDRESS=$(docker compose run --entrypoint cat scripts /config/deployed_chain_info.json | jq -r '.[0].rollup.rollup' | tail -n 1 | tr -d '\r\n') # A convoluted way to get the address of the child chain upgrade executor, maybe there's a better way? @@ -50,51 +51,64 @@ CHILD_CHAIN_UPGRADE_EXECUTOR_ADDRESS=$(cast call $L1_TOKEN_BRIDGE_CREATOR_ADDRES PRIVATE_KEY="$(docker compose run scripts print-private-key --account l2owner | tail -n 1 | tr -d '\r\n')" OWNER_ADDRESS="$(docker compose run scripts print-address --account l2owner | tail -n 1 | tr -d '\r\n')" -# Echo for debug -echo "Deploying Espresso Osp" -# Change directory to orbit actions dir for the following commands. cd $ORBIT_ACTIONS_DIR -# ** Essential migration step ** Forge script to deploy new OSP entry. We do this to later point the rollups challenge manager to the espresso integrated OSP. -forge script --chain $PARENT_CHAIN_CHAIN_ID contracts/parent-chain/espresso-migration/DeployEspressoOsp.s.sol:DeployEspressoOsp --rpc-url $PARENT_CHAIN_RPC_URL --broadcast -vvvv +forge update +echo "Deploying mock espresso tee verifier" +forge script --chain $PARENT_CHAIN_CHAIN_ID ../espresso-tests/DeployMockVerifier.s.sol:DeployMockVerifier --rpc-url $PARENT_CHAIN_RPC_URL --broadcast -vvvv + +ESPRESSO_TEE_VERIFIER_ADDRESS=$(cat broadcast/DeployMockVerifier.s.sol/1337/run-latest.json | jq -r '.transactions[0].contractAddress' | cast to-checksum) +echo "Mock TEE Address:" +echo $ESPRESSO_TEE_VERIFIER_ADDRESS + +# Echo for debug +echo "Deploying and initializing Espresso SequencerInbox" +# ** Essential migration step ** Forge script to deploy the new SequencerInbox. We do this to later point the rollups challenge manager to the espresso integrated OSP. +forge script --chain $PARENT_CHAIN_CHAIN_ID ../espresso-tests/DeployAndInitEspressoSequencerInboxTest.s.sol:DeployAndInitEspressoSequencerInboxTest --rpc-url $PARENT_CHAIN_RPC_URL --broadcast -vvvv --skip-simulation # Extract new_osp_entry address from run-latest.json # * Essential migration sub step * These addresses are likely known addresses to operators in the event of a real migration after they have deployed the new OSP contracts, however, if operators create a script for the migration, this command is useful. -NEW_OSP_ENTRY=$(cat broadcast/DeployEspressoOsp.s.sol/1337/run-latest.json | jq -r '.transactions[4].contractAddress'| cast to-checksum) - +NEW_SEQUENCER_INBOX_IMPL_ADDRESS=$(cat broadcast/DeployAndInitEspressoSequencerInbox.s.sol/1337/run-latest.json | jq -r '.transactions[0].contractAddress'| cast to-checksum) # Echo for debugging. -echo "Deployed new OspEntry at $NEW_OSP_ENTRY" +echo "Deployed new SequencerInbox at $NEW_SEQUENCER_INBOX_IMPL_ADDRESS" # Echo for debug -echo "Deploying Espresso Osp migration action" +echo "Deploying Espresso SequencerInbox migration action" # ** Essential migration step ** Forge script to deploy Espresso OSP migration action -forge script --chain $PARENT_CHAIN_CHAIN_ID contracts/parent-chain/espresso-migration/DeployEspressoOspMigrationAction.s.sol --rpc-url $PARENT_CHAIN_RPC_URL --broadcast -vvvv +forge script --chain $PARENT_CHAIN_CHAIN_ID contracts/parent-chain/espresso-migration/DeployEspressoSequencerMigrationAction.s.sol:DeployEspressoSequencerMigrationAction --rpc-url $PARENT_CHAIN_RPC_URL --broadcast -vvvv # Capture new OSP address # * Essential migration sub step ** Essential migration sub step * operators will be able to manually determine this address while running the upgrade, but this can be useful if they wish to make a script. -OSP_MIGRATION_ACTION=$(cat broadcast/DeployEspressoOspMigrationAction.s.sol/1337/run-latest.json | jq -r '.transactions[0].contractAddress') +SEQUENCER_MIGRATION_ACTION=$(cat broadcast/DeployEspressoSequencerMigrationAction.s.sol/1337/run-latest.json | jq -r '.transactions[0].contractAddress' | cast to-checksum) -echo "Deployed new OspMigrationAction at $OSP_MIGRATION_ACTION" +echo "Deployed new EspressoSequencerMigrationAction at $SEQUENCER_MIGRATION_ACTION" -# Use cast to call the upgradeExecutor and execute the L1 upgrade actions.This will point the challenge manager at the new OSP entry, as well as update the wasmModuleRoot for the rollup. -# ** Essential migration step ** - -cast send $PARENT_CHAIN_UPGRADE_EXECUTOR "execute(address, bytes)" $OSP_MIGRATION_ACTION $(cast calldata "perform()") --rpc-url $PARENT_CHAIN_RPC_URL --private-key $PRIVATE_KEY - -echo "Executed OspMigrationAction via UpgradeExecutor" +echo "Deploying ArbOS Upgrade action" +# Forge script to deploy the Espresso ArbOS upgrade action. +# ** Essential migration step ** the ArbOS upgrade signifies that the chain is now espresso compatible. +forge script --chain $CHILD_CHAIN_CHAIN_NAME contracts/child-chain/espresso-migration/DeployArbOSUpgradeAction.s.sol:DeployArbOSUpgradeAction --rpc-url $CHILD_CHAIN_RPC_URL --broadcast -vvvv -# Get the number of confirmed nodes before the upgrade to ensure the staker is still working. -NUM_CONFIRMED_NODES_BEFORE_UPGRADE=$(cast call --rpc-url $PARENT_CHAIN_RPC_URL $ROLLUP_ADDRESS 'latestConfirmed()(uint256)') -# Shutdown nitro node +# Get the address of the newly deployed upgrade action. +ARBOS_UPGRADE_ACTION=$(cat broadcast/DeployArbOSUpgradeAction.s.sol/412346/run-latest.json | jq -r '.transactions[0].contractAddress') -# This is part of the migration but the mechanics of this can be left up to operators. -# ** Essential migration step ** The previous sequencer that is not compatible with espresso must be shut down so that we can start a new sequencer node that can have it's ArbOS version updated to signify the upgrade has occurred. -docker stop nitro-testnode-sequencer-1 +# Echo information for debugging. +echo "Deployed ArbOSUpgradeAction at $ARBOS_UPGRADE_ACTION" # Change directories to start nitro node in new docker container with espresso image cd $TESTNODE_DIR + +docker stop nitro-testnode-sequencer-1 +docker wait nitro-testnode-sequencer-1 # Start nitro node in new docker container with espresso image ./espresso-tests/create-espresso-integrated-nitro-node.bash +# Use cast to call the upgradeExecutor and execute the L1 upgrade actions.This will point the challenge manager at the new OSP entry, as well as update the wasmModuleRoot for the rollup. ** Essential migration step ** +cast send $PARENT_CHAIN_UPGRADE_EXECUTOR "execute(address, bytes)" $SEQUENCER_MIGRATION_ACTION $(cast calldata "perform()") --rpc-url $PARENT_CHAIN_RPC_URL --private-key $PRIVATE_KEY + +echo "Executed SequencerMigrationAction via UpgradeExecutor" + +# Get the number of confirmed nodes before the upgrade to ensure the staker is still working. +NUM_CONFIRMED_NODES_BEFORE_UPGRADE=$(cast call --rpc-url $PARENT_CHAIN_RPC_URL $ROLLUP_ADDRESS 'latestConfirmed()(uint256)') + # Wait for CHILD_CHAIN_RPC_URL to be available # * Essential migration sub step * This is technically essential to the migration, but doesn't usually take long and shouldn't need to be programmatically determined during a live migration. @@ -108,25 +122,20 @@ echo "Adding child chain upgrade executor as an L2 chain owner" # This step is done for the purposes of the test, as there should already be an upgrade executor on the child chain that is a chain owner cast send 0x0000000000000000000000000000000000000070 'addChainOwner(address)' $CHILD_CHAIN_UPGRADE_EXECUTOR_ADDRESS --rpc-url $CHILD_CHAIN_RPC_URL --private-key $PRIVATE_KEY -echo "Deploying ArbOS Upgrade action" - cd $ORBIT_ACTIONS_DIR -# Forge script to deploy the Espresso ArbOS upgrade action. -# ** Essential migration step ** the ArbOS upgrade signifies that the chain is now espresso compatible. -forge script --chain $CHILD_CHAIN_CHAIN_NAME contracts/child-chain/arbos-upgrade/DeployArbOSUpgradeAction.s.sol:DeployArbOSUpgradeAction --rpc-url $CHILD_CHAIN_RPC_URL --broadcast -vvvv - -# Get the address of the newly deployed upgrade action. -ARBOS_UPGRADE_ACTION=$(cat broadcast/DeployArbOSUpgradeAction.s.sol/412346/run-latest.json | jq -r '.transactions[0].contractAddress') - -# Echo information for debugging. -echo "Deployed ArbOSUpgradeAction at $ARBOS_UPGRADE_ACTION" - # Grab the pre-upgrade ArbOS version for testing. ARBOS_VERSION_BEFORE_UPGRADE=$(cast call "0x0000000000000000000000000000000000000064" "arbOSVersion()(uint64)" --rpc-url $CHILD_CHAIN_RPC_URL) # Use the Upgrde executor on the child chain to execute the ArbOS upgrade to signify that the node is now operating in espresso mode. This is essential for the migration. # ** Essential migration step ** This step can technically be done before all of the others as it is just scheduling the ArbOS upgrade. The unix timestamp at which the upgrade occurrs can be determined by operators, but for the purposes of the test we use 0 to upgrade immediately. cast send $CHILD_CHAIN_UPGRADE_EXECUTOR_ADDRESS "execute(address, bytes)" $ARBOS_UPGRADE_ACTION $(cast calldata "perform()") --rpc-url $CHILD_CHAIN_RPC_URL --private-key $PRIVATE_KEY +cd $TEST_DIR +# write tee verifier address into chain config +jq -r '.arbitrum.EspressoTEEVerifierAddress |= $ESPRESSO_TEE_VERIFIER_ADDRESS' test-chain-config.json > sent-chain-config.json --arg ESPRESSO_TEE_VERIFIER_ADDRESS $ESPRESSO_TEE_VERIFIER_ADDRESS +CHAIN_CONFIG=$(cat sent-chain-config.json) + +cast send $CHILD_CHAIN_UPGRADE_EXECUTOR_ADDRESS $(cast calldata "executeCall(address, bytes)" "0x0000000000000000000000000000000000000070" $(cast calldata "setChainConfig(string)" "$CHAIN_CONFIG")) --rpc-url $CHILD_CHAIN_RPC_URL --private-key $PRIVATE_KEY +# Set the chain config # Check the upgrade happened @@ -144,11 +153,6 @@ if [ $ARBOS_VERSION_AFTER_UPGRADE != "90" ]; then fail "ArbOS version not updated: Expected 90, Actual $ARBOS_VERSION_AFTER_UPGRADE" fi -# Test for new OSP address -CHALLENGE_MANAGER_OSP_ADDRESS=$(cast call $CHALLENGE_MANAGER_ADDRESS "osp()(address)" --rpc-url $PARENT_CHAIN_RPC_URL) -if [ $NEW_OSP_ENTRY != $CHALLENGE_MANAGER_OSP_ADDRESS ]; then - fail "OSP has not been set to newly deployed OSP: \n Newly deployed: $NEW_OSP_ENTRY \n Currently set OSP: $CHALLENGE_MANAGER_OSP_ADDRESS" -fi # Check for balance before transfer. # The following sequence is to check that transactions are still successfully being sequenced on the L2 ORIGINAL_OWNER_BALANCE=$(cast balance $OWNER_ADDRESS -e --rpc-url $CHILD_CHAIN_RPC_URL) diff --git a/espresso-tests/test-chain-config.json b/espresso-tests/test-chain-config.json new file mode 100644 index 00000000..44cfdb4d --- /dev/null +++ b/espresso-tests/test-chain-config.json @@ -0,0 +1,29 @@ +{ + "chainId":412346, + "homesteadBlock":0, + "daoForkSupport":true, + "eip150Block":0, + "eip150Hash":"0x0000000000000000000000000000000000000000000000000000000000000000", + "eip155Block":0, + "eip158Block":0, + "byzantiumBlock":0, + "constantinopleBlock":0, + "petersburgBlock":0, + "istanbulBlock":0, + "muirGlacierBlock":0, + "berlinBlock":0, + "londonBlock":0, + "clique":{ + "period":0, + "epoch":0 + }, + "arbitrum":{ + "EnableArbOS":true, + "AllowDebugPrecompiles":true, + "DataAvailabilityCommittee":false, + "InitialArbOSVersion":30, + "InitialChainOwner":"0x5E1497dD1f08C87b2d8FE23e9AAB6c1De833D927", + "GenesisBlockNum":0, + "EspressoTEEVerifierAddress": "0x0" + } +} diff --git a/orbit-actions b/orbit-actions index 751be3fd..c44e3451 160000 --- a/orbit-actions +++ b/orbit-actions @@ -1 +1 @@ -Subproject commit 751be3fd8c19647b8ded06b136a8170458542d9f +Subproject commit c44e345109976d6cc12828087de5961ae201a785 diff --git a/rollupcreator/Dockerfile b/rollupcreator/Dockerfile index 3ae9349e..93bcc80a 100644 --- a/rollupcreator/Dockerfile +++ b/rollupcreator/Dockerfile @@ -9,6 +9,8 @@ RUN git checkout ${NITRO_CONTRACTS_BRANCH} RUN curl -L https://foundry.paradigm.xyz | bash ENV PATH="${PATH}:/root/.foundry/bin" RUN foundryup +RUN forge update lib/forge-std +RUN git submodule update --init --recursive RUN touch scripts/config.ts RUN yarn install RUN yarn build:all diff --git a/scripts/config.ts b/scripts/config.ts index 81b06507..0850034e 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -246,7 +246,7 @@ function writeConfigs(argv: any) { url: argv.validationNodeUrl, jwtsecret: valJwtSecret, }, - "dangerous": {"reset-block-validation": false}, + dangerous: { "reset-block-validation": false }, }, feed: { input: { @@ -292,15 +292,8 @@ function writeConfigs(argv: any) { if (argv.espresso) { let config = baseConfig as any; - config.node["block-validator"]["espresso"] = false; - config.node["block-validator"]["light-client-address"] = ""; config.node["batch-poster"]["hotshot-url"] = ""; config.node["batch-poster"]["light-client-address"] = ""; - config.node["transaction-streamer"] = { - "sovereign-sequencer-enabled": false, - "hotshot-url": "", - "espresso-namespace": 412346, - }; } baseConfig.node["data-availability"]["sequencer-inbox-address"] = @@ -318,12 +311,6 @@ function writeConfigs(argv: any) { simpleConfig.node["delayed-sequencer"].enable = true; simpleConfig.node["batch-poster"].enable = true; simpleConfig.node["batch-poster"]["redis-url"] = ""; - if (argv.espresso) { - simpleConfig.node["transaction-streamer"]["hotshot-url"] = - argv.espressoUrl; - simpleConfig.node["transaction-streamer"]["sovereign-sequencer-enabled"] = - true; - } simpleConfig.execution["sequencer"].enable = true; if (argv.anytrust) { @@ -334,9 +321,6 @@ function writeConfigs(argv: any) { simpleConfig.node["batch-poster"]["hotshot-url"] = argv.espressoUrl; simpleConfig.node["batch-poster"]["light-client-address"] = argv.lightClientAddress; - simpleConfig.node["block-validator"]["espresso"] = true; - simpleConfig.node["block-validator"]["light-client-address"] = - argv.lightClientAddress; simpleConfig.node["block-validator"]["dangerous"][ "reset-block-validation" ] = true; @@ -386,9 +370,6 @@ function writeConfigs(argv: any) { validatorConfig.node.staker.enable = true; validatorConfig.node.staker["use-smart-contract-wallet"] = true; if (argv.espresso) { - validatorConfig.node["block-validator"]["espresso"] = true; - validatorConfig.node["block-validator"]["light-client-address"] = - argv.lightClientAddress; validatorConfig.node["block-validator"]["dangerous"][ "reset-block-validation" ] = true; @@ -412,7 +393,6 @@ function writeConfigs(argv: any) { sequencerConfig.node["delayed-sequencer"].enable = true; if (argv.espresso) { - sequencerConfig.execution.sequencer["enable-espresso-sovereign"] = true; sequencerConfig.node.feed.output.enable = true; sequencerConfig.node.dangerous["no-sequencer-coordinator"] = true; } else { @@ -422,7 +402,6 @@ function writeConfigs(argv: any) { if (argv.espresso && argv.enableEspressoFinalityNode) { sequencerConfig.execution.sequencer["enable-espresso-finality-node"] = true; - sequencerConfig.execution.sequencer["enable-espresso-sovereign"] = false; sequencerConfig.execution.sequencer["espresso-finality-node-config"] = { "hotshot-url": argv.espressoUrl, "start-block": 0, @@ -445,10 +424,6 @@ function writeConfigs(argv: any) { posterConfig.node["batch-poster"]["hotshot-url"] = argv.espressoUrl; posterConfig.node["batch-poster"]["light-client-address"] = argv.lightClientAddress; - posterConfig.node["transaction-streamer"]["hotshot-url"] = - argv.espressoUrl; - posterConfig.node["transaction-streamer"]["sovereign-sequencer-enabled"] = - true; } else { posterConfig.node["seq-coordinator"].enable = true; } @@ -481,7 +456,6 @@ function writeConfigs(argv: any) { l3Config.node["batch-poster"].enable = true; l3Config.node["batch-poster"]["redis-url"] = ""; if (argv.espresso) { - l3Config.execution.sequencer["enable-espresso-sovereign"] = true; l3Config.node.feed.output.enable = true; l3Config.node.dangerous["no-sequencer-coordinator"] = true; } @@ -549,8 +523,7 @@ function writeL2ChainConfig(argv: any) { }; if (argv.espresso) { let chainConfig = l2ChainConfig as any; - chainConfig.arbitrum["EnableEspresso"] = true; - chainConfig["espresso"] = true; + chainConfig.arbitrum["EspressoTEEVerifierAddress"]= "0x5F1f60F24be95C7cfC430bfcf0001D4701BE1231" } const l2ChainConfigJSON = JSON.stringify(l2ChainConfig); fs.writeFileSync( diff --git a/scripts/index.ts b/scripts/index.ts index 9fac2a01..13ed1324 100644 --- a/scripts/index.ts +++ b/scripts/index.ts @@ -41,6 +41,7 @@ async function main() { espressoUrl: { string: true, description: 'Espresso Sequencer url', default: 'http://espresso-dev-node:41000' }, lightClientAddress: { string: true, description: 'address of the light client contract', default: ''}, enableEspressoFinalityNode: {boolean: true, description: 'enable finality node', default: false}, + simpleWithValidator: {boolean: true, description: 'start a simple node that validates', default: false}, }) .command(bridgeFundsCommand) .command(bridgeToL3Command)