diff --git a/arbnode/batch_poster.go b/arbnode/batch_poster.go index 52cf890ed3..934d6cf68a 100644 --- a/arbnode/batch_poster.go +++ b/arbnode/batch_poster.go @@ -478,7 +478,7 @@ func (b *BatchPoster) addEspressoBlockMerkleProof( if validatedHotShotHeight < jst.Header.Height { return fmt.Errorf("could not construct batch justification, light client is at height %v but the justification is for height %v", validatedHotShotHeight, jst.Header.Height) } - proof, err := b.hotshotClient.FetchBlockMerkleProof(validatedL1Height, jst.Header.Height) + proof, err := b.hotshotClient.FetchBlockMerkleProof(context.Background(), validatedL1Height, jst.Header.Height) if err != nil { return err } diff --git a/arbos/mock_light_client_reader.go b/arbos/mock_light_client_reader.go index 7074ef52f9..6c180e8e49 100644 --- a/arbos/mock_light_client_reader.go +++ b/arbos/mock_light_client_reader.go @@ -21,7 +21,7 @@ func (l *MockLightClientReader) ValidatedHeight() (validatedHeight uint64, l1Hei return 18446744073709551615, 18446744073709551615, nil } -func (l *MockLightClientReader) IsHotShotAvaliable(t time.Duration) bool { +func (l *MockLightClientReader) IsHotShotAvailable(t time.Duration) bool { return true } diff --git a/execution/gethexec/switch_sequencer.go b/execution/gethexec/switch_sequencer.go index 25c35230d9..710332fc27 100644 --- a/execution/gethexec/switch_sequencer.go +++ b/execution/gethexec/switch_sequencer.go @@ -117,7 +117,7 @@ func (s *SwitchSequencer) Start(ctx context.Context) error { if s.lightClient != nil { s.CallIteratively(func(ctx context.Context) time.Duration { - espresso := s.lightClient.IsHotShotAvaliable(s.maxHotShotDriftTime) + espresso := s.lightClient.IsHotShotAvailable(s.maxHotShotDriftTime) var err error if s.IsRunningEspressoMode() && !espresso { diff --git a/go.mod b/go.mod index 73e6ff0c8a..9c3f4e35c3 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ replace github.com/VictoriaMetrics/fastcache => ./fastcache replace github.com/ethereum/go-ethereum => ./go-ethereum require ( - github.com/EspressoSystems/espresso-sequencer-go v0.0.11 + github.com/EspressoSystems/espresso-sequencer-go v0.0.13 github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible github.com/Shopify/toxiproxy v2.1.4+incompatible github.com/alicebob/miniredis/v2 v2.21.0 diff --git a/go.sum b/go.sum index da2856dc5b..dbd2eeffd2 100644 --- a/go.sum +++ b/go.sum @@ -53,6 +53,8 @@ github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/EspressoSystems/espresso-sequencer-go v0.0.11 h1:PWBzbf8/WX10dYizIco0bAmIVE7/lwR4bNM/t+AT+HU= github.com/EspressoSystems/espresso-sequencer-go v0.0.11/go.mod h1:BbU8N23RGl45QXSf/bYc8OQ8TG/vlMaPC1GU1acqKmc= +github.com/EspressoSystems/espresso-sequencer-go v0.0.13 h1:uawTcW9N+P7Cx/8CWp1kM6KNzz0wMXjJEtW4wWhqZj8= +github.com/EspressoSystems/espresso-sequencer-go v0.0.13/go.mod h1:BbU8N23RGl45QXSf/bYc8OQ8TG/vlMaPC1GU1acqKmc= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= @@ -240,6 +242,7 @@ github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 h1:aPEJyR4rPBvD github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= @@ -286,6 +289,7 @@ github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6Uh github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= @@ -402,6 +406,7 @@ github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -898,6 +903,7 @@ github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -1278,6 +1284,7 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= @@ -1419,6 +1426,7 @@ github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAv github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 h1:1/WtZae0yGtPq+TI6+Tv1WTxkukpXeMlviSxvL7SRgk= +github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9/go.mod h1:x3N5drFsm2uilKKuuYo6LdyD8vZAW55sH/9w+pbo1sw= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= @@ -1658,6 +1666,7 @@ github.com/wealdtech/go-merkletree v1.0.0/go.mod h1:cdil512d/8ZC7Kx3bfrDvGMQXB25 github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc h1:BCPnHtcboadS0DvysUuJXZ4lWVv5Bh5i7+tbIyi+ck4= github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc/go.mod h1:r45hJU7yEoA81k6MWNhpMj/kms0n14dkzkxYHoB96UM= github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 h1:5HZfQkwe0mIfyDmc1Em5GqlNRzcdtlv4HTNmdpt7XH0= +github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11/go.mod h1:Wlo/SzPmxVp6vXpGt/zaXhHH0fn4IxgqZc82aKg6bpQ= github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa h1:EyA027ZAkuaCLoxVX4r1TZMPy1d31fM6hbfQ4OU4I5o= github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= diff --git a/system_tests/espresso-e2e/.env b/system_tests/espresso-e2e/.env index da69425997..5af96d5898 100644 --- a/system_tests/espresso-e2e/.env +++ b/system_tests/espresso-e2e/.env @@ -12,32 +12,46 @@ L1_BLOCK_TIME_SEC=3 ASYNC_STD_THREAD_COUNT=1 # Internal port inside container -ESPRESSO_WEB_SERVER_PORT=40000 +ESPRESSO_CDN_SERVER_PORT=40000 +ESPRESSO_CDN_SERVER_METRICS_PORT=9090 ESPRESSO_ORCHESTRATOR_PORT=40001 -ESPRESSO_CONSENSUS_SERVER_PORT=40002 -ESPRESSO_DA_SERVER_PORT=40003 -ESPRESSO_SEQUENCER_DA_SERVER_URL=http://da-server:$ESPRESSO_WEB_SERVER_PORT -ESPRESSO_SEQUENCER_CONSENSUS_SERVER_URL=http://consensus-server:$ESPRESSO_WEB_SERVER_PORT -ESPRESSO_SEQUENCER_ORCHESTRATOR_URL=http://orchestrator:$ESPRESSO_ORCHESTRATOR_PORT +ESPRESSO_ORCHESTRATOR_NUM_NODES=2 +ESPRESSO_ORCHESTRATOR_START_DELAY=5s +ESPRESSO_ORCHESTRATOR_NEXT_VIEW_TIMEOUT=30s +ESPRESSO_ORCHESTRATOR_MIN_TRANSACTIONS=50 +ESPRESSO_ORCHESTRATOR_MIN_PROPOSE_TIME=1s +ESPRESSO_ORCHESTRATOR_MAX_PROPOSE_TIME=2s +ESPRESSO_SEQUENCER_CDN_ENDPOINT=marshal-0:${ESPRESSO_CDN_SERVER_PORT} +ESPRESSO_SEQUENCER_ORCHESTRATOR_URL=http://orchestrator:${ESPRESSO_ORCHESTRATOR_PORT} ESPRESSO_SEQUENCER_API_PORT=50000 +ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_PORT=42000 ESPRESSO_SEQUENCER1_API_PORT=50001 -ESPRESSO_SEQUENCER_URL=http://espresso-sequencer0:$ESPRESSO_SEQUENCER_API_PORT +ESPRESSO_SEQUENCER_URL=http://espresso-sequencer0:${ESPRESSO_SEQUENCER_API_PORT} ESPRESSO_SEQUENCER_STORAGE_PATH=/store/sequencer ESPRESSO_SEQUENCER_L1_PORT=8545 ESPRESSO_SEQUENCER_L1_WS_PORT=8546 -ESPRESSO_SEQUENCER_L1_PROVIDER=http://host.docker.internal:$ESPRESSO_SEQUENCER_L1_PORT -ESPRESSO_SEQUENCER_L1_WS_PROVIDER=ws://host.docker.internal:$ESPRESSO_SEQUENCER_L1_WS_PORT -ESPRESSO_SEQUENCER_L1_USE_LATEST_BLOCK_TAG=true +ESPRESSO_SEQUENCER_L1_PROVIDER=http://host.docker.internal:${ESPRESSO_SEQUENCER_L1_PORT} +ESPRESSO_SEQUENCER_L1_WS_PROVIDER=ws://host.docker.internal:${ESPRESSO_SEQUENCER_L1_WS_PORT} 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_DEPLOYER_ACCOUNT_INDEX=5 +ESPRESSO_SEQUENCER_PREFUNDED_BUILDER_ACCOUNTS=0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f ESPRESSO_COMMITMENT_TASK_PORT=60000 +ESPRESSO_STATE_RELAY_SERVER_PORT=40004 +ESPRESSO_SEQUENCER_DB_PORT=5432 +ESPRESSO_STATE_RELAY_SERVER_URL=http://state-relay-server:${ESPRESSO_STATE_RELAY_SERVER_PORT} + +ESPRESSO_STATE_SIGNATURE_WEIGHT_THRESHOLD=3 # Ethereum accounts (note 11-15 are used by the sequencer nodes) ESPRESSO_SEQUENCER_HOTSHOT_ACCOUNT_INDEX=5 +ESPRESSO_BUILDER_ETH_ACCOUNT_INDEX=5 +ESPRESSO_SEQUENCER_ETH_ACCOUNT_INDEX=5 +ESPRESSO_DEPLOYER_ACCOUNT_INDEX=5 # Conctracts ESPRESSO_SEQUENCER_HOTSHOT_ADDRESS=0x217788c286797d56cd59af5e493f3699c39cbbe8 +ESPRESSO_SEQUENCER_LIGHT_CLIENT_PROXY_ADDRESS=0xb075b82c7a23e0994df4793422a1f03dbcf9136f +ESPRESSO_SEQUENCER_LIGHTCLIENT_ADDRESS=$ESPRESSO_SEQUENCER_LIGHT_CLIENT_PROXY_ADDRESS # Example sequencer demo private keys ESPRESSO_DEMO_SEQUENCER_STAKING_PRIVATE_KEY_0=BLS_SIGNING_KEY~lNDh4Pn-pTAyzyprOAFdXHwhrKhEwqwtMtkD3CZF4x3o @@ -46,9 +60,14 @@ ESPRESSO_DEMO_SEQUENCER_STAKING_PRIVATE_KEY_1=BLS_SIGNING_KEY~-DO72m_SFl6NQMYknm ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_0=SCHNORR_SIGNING_KEY~XxPSER8Vh3nFj_m7cUQ--96JfKrycrSKyRQximkQigCo ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_1=SCHNORR_SIGNING_KEY~2NpKtvY5F0u1LWgYws-JeX1vDdp5CfECuaMMYxyz4gDM -ESPRESSO_SEQUENCER_ETH_ACCOUNT_INDEX=8 -ESPRESSO_SEQUENCER_PREFUNDED_BUILDER_ACCOUNTS=0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f +# Builder service +ESPRESSO_BUILDER_L1_PROVIDER=${ESPRESSO_SEQUENCER_L1_PROVIDER} +ESPRESSO_BUILDER_ETH_MNEMONIC=${ESPRESSO_SEQUENCER_ETH_MNEMONIC} +ESPRESSO_BUILDER_SERVER_PORT=41003 +ESPRESSO_BUILDER_PRIVATE_STAKING_KEY=BLS_SIGNING_KEY~tI9He_sCnEbfEajycUXz9Scfy6ocLr0yL9ceD53s8QPa +ESPRESSO_BUILDER_PRIVATE_STATE_KEY=SCHNORR_SIGNING_KEY~IftHINvgzqcd9agX13HHY3Uhz8vsH46i8soKgV7ZUQV- +ESPRESSO_BUILDER_CHANNEL_CAPACITY=1024 +ESPRESSO_BUILDER_BOOTSTRAPPED_VIEW=0 -ESPRESSO_STATE_RELAY_SERVER_PORT=40004 -ESPRESSO_STATE_SIGNATURE_WEIGHT_THRESHOLD=3 -ESPRESSO_STATE_RELAY_SERVER_URL=http://state-relay-server:$ESPRESSO_STATE_RELAY_SERVER_PORT \ No newline at end of file +ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_0=7000 +ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_1=7001 diff --git a/system_tests/espresso-e2e/docker-compose.yaml b/system_tests/espresso-e2e/docker-compose.yaml index d78a04046b..4cd54dd7d9 100644 --- a/system_tests/espresso-e2e/docker-compose.yaml +++ b/system_tests/espresso-e2e/docker-compose.yaml @@ -22,37 +22,83 @@ services: - "$ESPRESSO_ORCHESTRATOR_PORT:$ESPRESSO_ORCHESTRATOR_PORT" environment: - ESPRESSO_ORCHESTRATOR_PORT - - ESPRESSO_ORCHESTRATOR_NUM_NODES=2 - - ESPRESSO_ORCHESTRATOR_START_DELAY=5s - - ESPRESSO_ORCHESTRATOR_NEXT_VIEW_TIMEOUT=30s - - ESPRESSO_ORCHESTRATOR_MIN_TRANSACTIONS=1 - - ESPRESSO_ORCHESTRATOR_MIN_PROPOSE_TIME=0s - - ESPRESSO_ORCHESTRATOR_MAX_PROPOSE_TIME=1s + - ESPRESSO_ORCHESTRATOR_NUM_NODES + - ESPRESSO_ORCHESTRATOR_START_DELAY + - ESPRESSO_ORCHESTRATOR_NEXT_VIEW_TIMEOUT + - ESPRESSO_ORCHESTRATOR_MIN_TRANSACTIONS + - ESPRESSO_ORCHESTRATOR_MIN_PROPOSE_TIME + - ESPRESSO_ORCHESTRATOR_MAX_PROPOSE_TIME - RUST_LOG - RUST_LOG_FORMAT - da-server: - image: ghcr.io/espressosystems/espresso-sequencer/web-server:arbitrum-integrationmusl - ports: - - "$ESPRESSO_DA_SERVER_PORT:$ESPRESSO_WEB_SERVER_PORT" + # We use KeyDB (a Redis variant) to maintain consistency between + # different parts of the CDN + keydb: + image: docker.io/eqalpha/keydb:latest + command: ["--requirepass", "changemeplease!!"] + healthcheck: + # Attempt to PING the database + test: keydb-cli --pass changemeplease!! --raw incr PING + interval: 5s + timeout: 4s + retries: 20 + + # The CDN system's main entry point; where users contact first. + marshal-0: environment: - - ESPRESSO_WEB_SERVER_PORT - - RUST_LOG=error - - RUST_LOG_FORMAT + - RUST_LOG + - ESPRESSO_CDN_SERVER_METRICS_PORT + image: ghcr.io/espressosystems/espresso-sequencer/cdn-marshal:main + command: + - cdn-marshal + - -d + - redis://:changemeplease!!@keydb:6379 + - -b + - $ESPRESSO_CDN_SERVER_PORT + - -m + - 0.0.0.0:$ESPRESSO_CDN_SERVER_METRICS_PORT depends_on: - orchestrator: + keydb: condition: service_healthy - consensus-server: - image: ghcr.io/espressosystems/espresso-sequencer/web-server:arbitrum-integrationmusl - ports: - - "$ESPRESSO_CONSENSUS_SERVER_PORT:$ESPRESSO_WEB_SERVER_PORT" + # A broker is the main message-routing unit of the CDN + broker-0: environment: - - ESPRESSO_WEB_SERVER_PORT - - RUST_LOG=error - - RUST_LOG_FORMAT + - RUST_LOG + - ESPRESSO_CDN_SERVER_METRICS_PORT + image: ghcr.io/espressosystems/espresso-sequencer/cdn-broker:main + command: + - cdn-broker + - -d + - redis://:changemeplease!!@keydb:6379 + - --public-advertise-endpoint + - broker-0:1738 + - --private-advertise-endpoint + - broker-0:1739 + - -m + - 0.0.0.0:$ESPRESSO_CDN_SERVER_METRICS_PORT depends_on: - orchestrator: + keydb: + condition: service_healthy + + # A broker is the main message-routing unit of the CDN + broker-1: + environment: + - RUST_LOG + - ESPRESSO_CDN_SERVER_METRICS_PORT + image: ghcr.io/espressosystems/espresso-sequencer/cdn-broker:main + command: + - cdn-broker + - -d + - redis://:changemeplease!!@keydb:6379 + - --public-advertise-endpoint + - broker-1:1738 + - --private-advertise-endpoint + - broker-1:1739 + - -m + - 0.0.0.0:$ESPRESSO_CDN_SERVER_METRICS_PORT + depends_on: + keydb: condition: service_healthy espresso-sequencer0: @@ -60,18 +106,19 @@ services: ports: - "$ESPRESSO_SEQUENCER_API_PORT:$ESPRESSO_SEQUENCER_API_PORT" # Run the API server (with options taken from the environment) and the optional submission API - command: sequencer -- http -- query -- submit -- status + command: sequencer -- http -- query -- submit -- status -- state environment: - ESPRESSO_SEQUENCER_ORCHESTRATOR_URL - - ESPRESSO_SEQUENCER_DA_SERVER_URL - - ESPRESSO_SEQUENCER_CONSENSUS_SERVER_URL + - ESPRESSO_SEQUENCER_CDN_ENDPOINT - ESPRESSO_SEQUENCER_API_PORT + - ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_PORT - ESPRESSO_SEQUENCER_STORAGE_PATH - ESPRESSO_SEQUENCER_L1_PROVIDER - - ESPRESSO_SEQUENCER_L1_USE_LATEST_BLOCK_TAG - ESPRESSO_STATE_RELAY_SERVER_URL - ESPRESSO_SEQUENCER_PRIVATE_STAKING_KEY=$ESPRESSO_DEMO_SEQUENCER_STAKING_PRIVATE_KEY_0 - - ESPRESSO_SEQUENCER_PRIVATE_STATE_KEY=$ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_1 + - ESPRESSO_SEQUENCER_PRIVATE_STATE_KEY=$ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_0 + - ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_0 + - ESPRESSO_SEQUENCER_LIBP2P_ADVERTISE_ADDRESS=espresso-sequencer0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_0 - ESPRESSO_SEQUENCER_ETH_MNEMONIC - ESPRESSO_SEQUENCER_ETH_ACCOUNT_INDEX - ESPRESSO_SEQUENCER_PREFUNDED_BUILDER_ACCOUNTS @@ -81,12 +128,16 @@ services: depends_on: orchestrator: condition: service_healthy - consensus-server: - condition: service_healthy - da-server: + sequencer-db: condition: service_healthy state-relay-server: condition: service_healthy + broker-0: + condition: service_healthy + broker-1: + condition: service_healthy + marshal-0: + condition: service_healthy extra_hosts: - "host.docker.internal:host-gateway" @@ -98,30 +149,35 @@ services: command: sequencer -- http environment: - ESPRESSO_SEQUENCER_ORCHESTRATOR_URL - - ESPRESSO_SEQUENCER_DA_SERVER_URL - - ESPRESSO_SEQUENCER_CONSENSUS_SERVER_URL + - ESPRESSO_SEQUENCER_CDN_ENDPOINT - ESPRESSO_SEQUENCER_API_PORT + - ESPRESSO_SEQUENCER_HOTSHOT_EVENT_STREAMING_API_PORT - ESPRESSO_SEQUENCER_STORAGE_PATH - ESPRESSO_SEQUENCER_L1_PROVIDER - - ESPRESSO_SEQUENCER_L1_USE_LATEST_BLOCK_TAG + - ESPRESSO_STATE_RELAY_SERVER_URL - ESPRESSO_SEQUENCER_PRIVATE_STAKING_KEY=$ESPRESSO_DEMO_SEQUENCER_STAKING_PRIVATE_KEY_1 - ESPRESSO_SEQUENCER_PRIVATE_STATE_KEY=$ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_1 + - ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_1 + - ESPRESSO_SEQUENCER_LIBP2P_ADVERTISE_ADDRESS=espresso-sequencer1:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_1 - ESPRESSO_SEQUENCER_ETH_MNEMONIC - ESPRESSO_SEQUENCER_ETH_ACCOUNT_INDEX - ESPRESSO_SEQUENCER_PREFUNDED_BUILDER_ACCOUNTS - - ESPRESSO_STATE_RELAY_SERVER_URL + - ESPRESSO_SEQUENCER_STATE_PEERS=http://espresso-sequencer0:$ESPRESSO_SEQUENCER_API_PORT - RUST_LOG - RUST_LOG_FORMAT - - ESPRESSO_SEQUENCER_STATE_PEERS=http://espresso-sequencer0:$ESPRESSO_SEQUENCER_API_PORT depends_on: orchestrator: condition: service_healthy - consensus-server: - condition: service_healthy - da-server: + sequencer-db: condition: service_healthy state-relay-server: condition: service_healthy + broker-0: + condition: service_healthy + broker-1: + condition: service_healthy + marshal-0: + condition: service_healthy extra_hosts: - "host.docker.internal:host-gateway" @@ -141,10 +197,6 @@ services: depends_on: espresso-sequencer0: condition: service_healthy - consensus-server: - condition: service_healthy - da-server: - condition: service_healthy deploy-contracts: condition: service_completed_successfully @@ -160,3 +212,19 @@ services: - ESPRESSO_STATE_SIGNATURE_WEIGHT_THRESHOLD - RUST_LOG - RUST_LOG_FORMAT + + sequencer-db: + image: postgres + user: postgres + ports: + - "$ESPRESSO_SEQUENCER_DB_PORT:5432" + environment: + - POSTGRES_PASSWORD=password + - POSTGRES_USER=root + healthcheck: + # Postgres can be falsely "ready" once before running init scripts. + # See https://github.com/docker-library/postgres/issues/146 for discussion. + test: "pg_isready && sleep 1 && pg_isready" + interval: 5s + timeout: 4s + retries: 20 diff --git a/system_tests/espresso_e2e_test.go b/system_tests/espresso_e2e_test.go index 47ffdc19a7..bb9dc6e562 100644 --- a/system_tests/espresso_e2e_test.go +++ b/system_tests/espresso_e2e_test.go @@ -56,8 +56,6 @@ func runEspresso(t *testing.T, ctx context.Context) func() { invocation := []string{"compose", "up", "-d", "--build"} nodes := []string{ "orchestrator", - "da-server", - "consensus-server", "espresso-sequencer0", "espresso-sequencer1", "commitment-task",