Skip to content

Commit dbf800a

Browse files
ImJeremyHeSneh1999
andauthored
Sync with celestia integration (#88)
* Update espresso image to point to integration (#83) * Update espresso image to point to integration * update espresso dev node * Update light client address --------- Co-authored-by: Jeremy <[email protected]> * add blobSchedule for new genesis creator requirement (#84) * add blobSchedule for new genesis creator requirement * Rename (cherry picked from commit 01b9f3a) * Fix caff node test (#85) * WIP * WIP * small fixes * rename to caff * fix * use bc for big numbers * Send transaction through caff node --------- Co-authored-by: Sneh Koul <[email protected]> (cherry picked from commit bfaaf1d) * Add EspressoTEEVerifier address (#86) * Add EspressoTEEVerifier address * Fix the TEE address --------- Co-authored-by: Jeremy <[email protected]> (cherry picked from commit b1ce7e1) * Fix caff node test (cherry picked from commit 589b44b) * Remove simple test --------- Co-authored-by: Sneh Koul <[email protected]>
1 parent 947fb44 commit dbf800a

File tree

7 files changed

+97
-70
lines changed

7 files changed

+97
-70
lines changed

.github/workflows/smoke-test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ jobs:
1818
smoke_test:
1919
strategy:
2020
matrix:
21-
test-script: [./smoke-test.bash]
21+
test-script:
22+
[
23+
./smoke-test.bash,
24+
./smoke-test-caff-node.bash,
25+
]
2226

2327
runs-on: ubuntu-24.04
2428

docker-compose.yaml

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -186,22 +186,25 @@ services:
186186
depends_on:
187187
- geth
188188

189-
sequencer-espresso-finality:
189+
caff-node:
190190
pid: host # allow debugging
191191
image: nitro-node-dev-testnode
192192
entrypoint: /usr/local/bin/nitro
193193
ports:
194-
- "127.0.0.1:8549:8547"
195-
- "127.0.0.1:8550:8548"
194+
- "127.0.0.1:8550:8547"
195+
- "127.0.0.1:8552:8548"
196196
- "127.0.0.1:9645:9642"
197197
volumes:
198198
- "seqdata_espresso_finality:/home/user/.arbitrum/local/nitro"
199199
- "l1keystore:/home/user/l1keystore"
200200
- "config:/config"
201201
- "tokenbridge-data:/tokenbridge-data"
202-
command: --conf.file /config/espresso_finality_sequencer_config.json --node.feed.output.enable --node.feed.output.port 9642 --http.api net,web3,eth,txpool,debug --node.seq-coordinator.my-url ws://sequencer:8548 --graphql.enable --graphql.vhosts * --graphql.corsdomain *
202+
command: --conf.file /config/caff_sequencer_config.json --node.feed.output.enable --node.feed.output.port 9642 --http.api net,web3,eth,txpool,debug --node.seq-coordinator.my-url ws://sequencer:8548 --graphql.enable --graphql.vhosts * --graphql.corsdomain *
203203
depends_on:
204204
- geth
205+
- espresso-dev-node
206+
extra_hosts:
207+
- "host.docker.internal:host-gateway"
205208

206209
sequencer_b:
207210
pid: host # allow debugging
@@ -411,37 +414,26 @@ services:
411414
- /var/run/docker.sock:/var/run/docker.sock
412415

413416
espresso-dev-node:
414-
# TODO: revert to `:main` tag once we are compatible with the marketplace builder
415-
image: ghcr.io/espressosystems/espresso-sequencer/espresso-dev-node:20240919-dev-node-legacy-builder
417+
image: ghcr.io/espressosystems/espresso-sequencer/espresso-dev-node:main
416418
ports:
417419
- "$ESPRESSO_SEQUENCER_API_PORT:$ESPRESSO_SEQUENCER_API_PORT"
418420
- "$ESPRESSO_BUILDER_PORT:$ESPRESSO_BUILDER_PORT"
419421
- "$ESPRESSO_DEV_NODE_PORT:$ESPRESSO_DEV_NODE_PORT"
420422
environment:
421-
- ESPRESSO_SEQUENCER_L1_PROVIDER
422-
- ESPRESSO_SEQUENCER_ETH_MNEMONIC
423-
- ESPRESSO_DEPLOYER_ACCOUNT_INDEX
424-
- ESPRESSO_SEQUENCER_API_PORT
425423
- ESPRESSO_BUILDER_PORT
424+
- ESPRESSO_DEPLOYER_ACCOUNT_INDEX
426425
- ESPRESSO_DEV_NODE_PORT
426+
- ESPRESSO_SEQUENCER_API_PORT
427+
- ESPRESSO_SEQUENCER_ETH_MNEMONIC
428+
- ESPRESSO_SEQUENCER_L1_PROVIDER
429+
- ESPRESSO_SEQUENCER_DATABASE_MAX_CONNECTIONS=25
430+
- ESPRESSO_SEQUENCER_STORAGE_PATH=/data/espresso
427431
- RUST_LOG=info
428432
- RUST_LOG_FORMAT
429-
- ESPRESSO_DEPLOYER_ALT_CHAIN_PROVIDERS
430-
- ESPRESSO_DEPLOYER_ALT_MNEMONICS
431-
- ESPRESSO_SEQUENCER_DEPLOYER_ALT_INDICES
432-
depends_on:
433-
- geth
434-
- sequencer
435-
healthcheck:
436-
test:
437-
[
438-
"CMD-SHELL",
439-
"curl -fL http://localhost:$ESPRESSO_DEV_NODE_PORT || exit 1",
440-
]
441-
interval: 30s
442-
timeout: 10s
443-
retries: 5
444-
start_period: 40s
433+
volumes:
434+
- espresso_storage:/data/espresso
435+
extra_hosts:
436+
- "host.docker.internal:host-gateway"
445437

446438
# Reads from sequencer feed, forwards transactions to sequencer
447439
full-node:
@@ -534,3 +526,4 @@ volumes:
534526
das-committee-a-data:
535527
das-committee-b-data:
536528
das-mirror-data:
529+
espresso_storage:

scripts/config.ts

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,14 @@ function writeGethGenesisConfig(argv: any) {
6969
"shanghaiTime": 0,
7070
"cancunTime": 1706778826,
7171
"terminalTotalDifficulty": 0,
72-
"terminalTotalDifficultyPassed": true
72+
"terminalTotalDifficultyPassed": true,
73+
"blobSchedule": {
74+
"cancun": {
75+
"target": 3,
76+
"max": 6,
77+
"baseFeeUpdateFraction": 3338477
78+
}
79+
}
7380
},
7481
"difficulty": "0",
7582
"extradata": "0x00000000000000000000000000000000000000000000000000000000000000003f1Eae7D46d88F08fc2F8ed27FCb2AB183EB2d0E0B0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
@@ -205,6 +212,9 @@ function writeConfigs(argv: any) {
205212
"make-assertion-interval": "10s",
206213
strategy: "MakeNodes",
207214
},
215+
"parent-chain-reader": {
216+
enable: true,
217+
},
208218
sequencer: false,
209219
dangerous: {
210220
"no-sequencer-coordinator": false,
@@ -399,16 +409,22 @@ function writeConfigs(argv: any) {
399409
sequencerConfig.node["seq-coordinator"].enable = true;
400410
}
401411

402-
if (argv.espresso && argv.enableEspressoFinalityNode) {
403-
sequencerConfig.execution.sequencer["enable-espresso-finality-node"] =
404-
true;
405-
sequencerConfig.execution.sequencer["espresso-finality-node-config"] = {
406-
"hotshot-url": argv.espressoUrl,
407-
"start-block": 0,
412+
if (argv.espresso && argv.enableCaffNode) {
413+
sequencerConfig.node.sequencer = false
414+
sequencerConfig.node["delayed-sequencer"].enable = false;
415+
sequencerConfig.node["parent-chain-reader"].enable = false;
416+
sequencerConfig.execution.sequencer["enable-caff-node"] = true;
417+
sequencerConfig.execution.sequencer["caff-node-config"] = {
418+
"hotshot-urls": [argv.espressoUrl],
419+
"next-hotshot-block": 1,
408420
namespace: 412346,
421+
"parent-chain-node-url": argv.l1url,
422+
"hotshot-polling-interval": "250ms",
423+
"retry-time": "2s",
424+
"espresso-tee-verifier-addr": "0xb562622f2D76F355D673560CB88c1dF6088702f1",
409425
};
410426
fs.writeFileSync(
411-
path.join(consts.configpath, "espresso_finality_sequencer_config.json"),
427+
path.join(consts.configpath, "caff_sequencer_config.json"),
412428
JSON.stringify(sequencerConfig)
413429
);
414430
} else {
@@ -524,7 +540,7 @@ function writeL2ChainConfig(argv: any) {
524540
if (argv.espresso) {
525541
let chainConfig = l2ChainConfig as any;
526542
chainConfig.arbitrum["EspressoTEEVerifierAddress"] =
527-
"0x5eCF728ffC5C5E802091875f96281B5aeECf6C49";
543+
"0xb562622f2D76F355D673560CB88c1dF6088702f1";
528544
}
529545
const l2ChainConfigJSON = JSON.stringify(l2ChainConfig);
530546
fs.writeFileSync(

scripts/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function main() {
4040
espresso: { boolean: true, decription: 'use Espresso Sequencer for sequencing and DA', default: false },
4141
espressoUrl: { string: true, description: 'Espresso Sequencer url', default: 'http://espresso-dev-node:41000' },
4242
lightClientAddress: { string: true, description: 'address of the light client contract', default: ''},
43-
enableEspressoFinalityNode: {boolean: true, description: 'enable finality node', default: false},
43+
enableCaffNode: {boolean: true, description: 'enable caff node', default: false},
4444
simpleWithValidator: {boolean: true, description: 'start a simple node that validates', default: false},
4545
})
4646
.command(bridgeFundsCommand)

smoke-test-caff-node.bash

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
5+
6+
user=user_l2user
7+
caff_url="ws://caff-node:8548"
8+
9+
./test-node.bash --espresso --latest-espresso-image --validate --tokenbridge --init-force --detach --caff-node
10+
11+
# Start the caff node
12+
docker compose up -d caff-node --wait --detach
13+
14+
echo "Sending L2 transaction through sequencer"
15+
./test-node.bash script send-l2 --ethamount 10 --to $user --wait
16+
17+
# Check the balance from caff node's api
18+
userAddress=$(docker compose run scripts print-address --account $user | tail -n 1 | tr -d '\r\n')
19+
20+
while true; do
21+
# Check if the balance on Caff node is greater than 0
22+
balance=$(cast balance $userAddress --rpc-url ws://127.0.0.1:8552)
23+
# Using bc here because it supports bigint
24+
if [ "$(echo "$balance > 0" | bc)" -eq 1 ]; then
25+
break
26+
fi
27+
sleep 1
28+
done
29+
30+
echo "Sending L2 transaction through caff node"
31+
./test-node.bash script send-l2 --ethamount 10 --to $user --l2url $caff_url --wait
32+
33+
echo "Sending L2 transaction through sequencer"
34+
./test-node.bash script send-l2 --ethamount 10 --to $user --wait
35+
36+
echo "Sending L2 transaction through caff node"
37+
./test-node.bash script send-l2 --ethamount 10 --to $user --l2url $caff_url --wait
38+
39+
echo "Smoke test succeeded."
40+
docker compose down

smoke-test-espresso-finality-node.bash

Lines changed: 0 additions & 26 deletions
This file was deleted.

test-node.bash

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ tokenbridge=false
4848
l3node=false
4949
consensusclient=false
5050
redundantsequencers=0
51-
lightClientAddr=0xb6eb235fa509e3206f959761d11e3777e16d0e98
51+
lightClientAddr=0xb7fc0e52ec06f125f3afeba199248c79f71c2e3a
5252
lightClientAddrForL3=0x5e36aa9caaf5f708fca5c04d2d4c776a62b2b258
53-
enableEspressoFinalityNode=false
53+
enableCaffNode=false
5454
espresso=false
5555
l2_espresso=false
5656
latest_espresso_image=false
@@ -125,8 +125,8 @@ while [[ $# -gt 0 ]]; do
125125
l2_espresso=true
126126
shift
127127
;;
128-
--espresso-finality-node)
129-
enableEspressoFinalityNode=true
128+
--caff-node)
129+
enableCaffNode=true
130130
shift
131131
;;
132132
--latest-espresso-image)
@@ -301,7 +301,7 @@ while [[ $# -gt 0 ]]; do
301301
echo --no-tokenbridge don\'t build or launch tokenbridge
302302
echo --no-run does not launch nodes \(useful with build or init\)
303303
echo --no-simple run a full configuration with separate sequencer/batch-poster/validator/relayer
304-
echo --enable-finality-node enable espresso finality node
304+
echo --enable-caff-node enable espresso caff node
305305
echo --build-dev-nitro rebuild dev nitro docker image
306306
echo --no-build-dev-nitro don\'t rebuild dev nitro docker image
307307
echo --build-dev-blockscout rebuild dev blockscout docker image
@@ -558,9 +558,9 @@ if $force_init; then
558558
else
559559
echo == Writing configs
560560
docker compose run scripts write-config $anytrustNodeConfigLine --espresso $l2_espresso --lightClientAddress $lightClientAddr
561-
if $enableEspressoFinalityNode; then
561+
if $enableCaffNode; then
562562
echo == Writing configs for finality node
563-
docker compose run scripts write-config $anytrustNodeConfigLine --espresso $l2_espresso --enableEspressoFinalityNode --lightClientAddress $lightClientAddr
563+
docker compose run scripts write-config $anytrustNodeConfigLine --espresso $l2_espresso --enableCaffNode --lightClientAddress $lightClientAddr
564564
fi
565565
echo == Initializing redis
566566
docker compose up --wait redis

0 commit comments

Comments
 (0)