Skip to content

Commit

Permalink
Merge pull request #27 from EspressoSystems/jh/update
Browse files Browse the repository at this point in the history
Fix the testnode
  • Loading branch information
nomaxg authored Apr 1, 2024
2 parents 20ea245 + 7d036e6 commit c06c442
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ ESPRESSO_SEQUENCER_L1_USE_LATEST_BLOCK_TAG=true
# A special account for `espresso-sequencer`, check `scripts/accounts.ts` for details.
ESPRESSO_COMMITMENT_ETH_MNEMONIC="indoor dish desk flag debris potato excuse depart ticket judge file exit"
ESPRESSO_SEQUENCER_ETH_MNEMONIC="test test test test test test test test test test test junk"
ESPRESSO_SEQUENCER_HOTSHOT_ACCOUNT_INDEX=6
ESPRESSO_DEPLOYER_ACCOUNT_INDEX=6
ESPRESSO_SEQUENCER_HOTSHOT_ACCOUNT_INDEX=$ESPRESSO_DEPLOYER_ACCOUNT_INDEX
ESPRESSO_COMMITMENT_TASK_PORT=60000

# Example sequencer demo private keys
Expand Down
19 changes: 17 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,24 @@ services:
geth:
condition: service_started

deploy-contracts:
image: ghcr.io/espressosystems/espresso-sequencer/deploy:arbitrum-integrationmusl
environment:
- ESPRESSO_SEQUENCER_ORCHESTRATOR_URL
- ESPRESSO_SEQUENCER_L1_PROVIDER
- ESPRESSO_SEQUENCER_ETH_MNEMONIC=$ESPRESSO_COMMITMENT_ETH_MNEMONIC
- ESPRESSO_DEPLOYER_ACCOUNT_INDEX
- RUST_LOG
- RUST_LOG_FORMAT
- ASYNC_STD_THREAD_COUNT
depends_on:
orchestrator:
condition: service_healthy

commitment-task:
image: ghcr.io/espressosystems/espresso-sequencer/commitment-task:arbitrum-integrationmusl
ports:
- "$ESPRESSO_COMMITMENT_TASK_PORT:$ESPRESSO_COMMITMENT_TASK_PORT"
command: commitment-task --deploy
env_file:
- espresso.env
environment:
Expand All @@ -452,7 +465,7 @@ services:
- ESPRESSO_COMMITMENT_TASK_PORT
- ESPRESSO_SEQUENCER_URL
- ESPRESSO_SEQUENCER_L1_PROVIDER
- ESPRESSO_SEQUENCER_L1_USE_LATEST_BLOCK_TAG
- ESPRESSO_SEQUENCER_HOTSHOT_ADDRESS
- RUST_LOG
- RUST_LOG_FORMAT
depends_on:
Expand All @@ -464,6 +477,8 @@ services:
condition: service_healthy
geth:
condition: service_started
deploy-contracts:
condition: service_completed_successfully

state-relay-server:
image: ghcr.io/espressosystems/espresso-sequencer/state-relay-server:main
Expand Down
3 changes: 2 additions & 1 deletion espresso.env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ESPRESSO_SEQUENCER_HOTSHOT_ADDRESS="0x217788c286797d56cd59af5e493f3699c39cbbe8"
ESPRESSO_SEQUENCER_HOTSHOT_ADDRESS="0x75745a1124de342716a94cbdfdea12f4f93d1b80"
ESPRESSO_SEQUENCER_LIGHT_CLIENT_ADDRESS="0xae05733adeebc16f9e7f377c89b6ac7369fc9b07"
12 changes: 6 additions & 6 deletions scripts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ function writeConfigs(argv: any) {
"signing-key": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
},
"wait-for-l1-finality": false
}
},
"hotshot-url": "",
"light-client-address": "",
},
"block-validator": {
"validation-server" : {
Expand Down Expand Up @@ -278,11 +280,7 @@ function writeConfigs(argv: any) {
validatorConfig.node.staker["use-smart-contract-wallet"] = true
if (argv.espresso) {
validatorConfig.node["block-validator"]["espresso"] = true
// If we don't quote the address it is interpreted as a Number.
// The quotes however stick around and make it an invalid address.
// Remove the double quote from the hotshot address.
// There has to be a better way.
validatorConfig.node["block-validator"]["hotshot-address"] = argv["hotshot-address"].replace(/^"(.+(?="$))"$/, '$1')
validatorConfig.node["block-validator"]["hotshot-address"] = argv.hotshotAddress
validatorConfig.node["block-validator"]["dangerous"]["reset-block-validation"] = true
}
let validconfJSON = JSON.stringify(validatorConfig)
Expand Down Expand Up @@ -311,6 +309,8 @@ function writeConfigs(argv: any) {
let posterConfig = JSON.parse(baseConfJSON)
if (argv.espresso) {
posterConfig.node.feed.input.url.push("ws://sequencer:9642")
posterConfig.node["batch-poster"]["hotshot-url"] = argv.espressoUrl
posterConfig.node["batch-poster"]["light-client-address"] = argv.lightClientAddress
} else {
posterConfig.node["seq-coordinator"].enable = true
}
Expand Down
3 changes: 2 additions & 1 deletion scripts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ async function main() {
.options({
espresso: { boolean: true, decription: 'use Espresso Sequencer for sequencing and DA', default: false },
espressoUrl: { string: true, description: 'Espresso Sequencer url', default: 'http://espresso-sequencer0:50000' },
hotshotAddress: { sring: true, description: 'address of the HotShot contract', default: '' }
hotshotAddress: { string: true, description: 'address of the HotShot contract', default: '' },
lightClientAddress: { string: true, description: 'address of the light client contract', default: ''},
})
.command(bridgeFundsCommand)
.command(bridgeToL3Command)
Expand Down
12 changes: 6 additions & 6 deletions test-node.bash
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ tokenbridge=false
l3node=false
consensusclient=false
redundantsequencers=0
hotShotAddr=0x217788c286797d56cd59af5e493f3699c39cbbe8
hotShotAddr=0x75745a1124de342716a94cbdfdea12f4f93d1b80
lightClientAddr=0xae05733adeebc16f9e7f377c89b6ac7369fc9b07
dev_build_nitro=false
dev_build_blockscout=false
espresso=false
Expand Down Expand Up @@ -361,10 +362,9 @@ if $force_init; then

if $espresso; then
echo == Deploying Espresso Contract
echo "" > espresso.env
docker compose up -d commitment-task espresso-sequencer0 espresso-sequencer1 --wait
hotShotAddr=`curl http://localhost:60000/api/hotshot_contract`
echo "ESPRESSO_SEQUENCER_HOTSHOT_ADDRESS=$hotShotAddr" > espresso.env
docker compose up -d commitment-task deploy-contracts espresso-sequencer0 espresso-sequencer1 --wait
addr=`curl http://localhost:60000/api/hotshot_contract`
echo $addr
fi

sequenceraddress=`docker compose run scripts print-address --account sequencer | tail -n 1 | tr -d '\r\n'`
Expand All @@ -378,7 +378,7 @@ if $force_init; then
docker compose run scripts write-config --simple
else
echo == Writing configs
docker compose run scripts write-config --espresso $espresso --hotshot-address $hotShotAddr
docker compose run scripts write-config --espresso $espresso --hotshot-address $hotShotAddr --light-client-address $lightClientAddr

echo == Initializing redis
docker compose up --wait redis
Expand Down

0 comments on commit c06c442

Please sign in to comment.