From 848ac6c5ccb9fe740862f402ceda340c06dd5e15 Mon Sep 17 00:00:00 2001 From: sveitser Date: Thu, 7 Nov 2024 16:42:06 +0100 Subject: [PATCH 1/2] Fix WS provider URL This caused calls to the L1 provider to fail. - Ignore `.env` for typos. - Log fee contract address during proxy check for easier debugging. --- .env | 2 +- .typos.toml | 1 + sequencer/src/genesis.rs | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.env b/.env index efc833858e..66bb2e9009 100644 --- a/.env +++ b/.env @@ -37,7 +37,7 @@ ESPRESSO_SEQUENCER_GENESIS_FILE=/genesis/demo.toml ESPRESSO_SEQUENCER_L1_PORT=8545 ESPRESSO_SEQUENCER_L1_WS_PORT=8546 ESPRESSO_SEQUENCER_L1_PROVIDER=http://demo-l1-network:${ESPRESSO_SEQUENCER_L1_PORT} -ESPRESSO_SEQUENCER_L1_WS_PROVIDER=http://demo-l1-network:${ESPRESSO_SEQUENCER_L1_WS_PORT} +ESPRESSO_SEQUENCER_L1_WS_PROVIDER=ws://demo-l1-network:${ESPRESSO_SEQUENCER_L1_WS_PORT} ESPRESSO_NODE_VALIDATOR_PORT=9000 # Only allow 1 block to be processed for events at a time, simulating a very bad L1 provider. diff --git a/.typos.toml b/.typos.toml index 37ee97ca20..8b837e2f27 100644 --- a/.typos.toml +++ b/.typos.toml @@ -1,5 +1,6 @@ [files] extend-exclude = [ + ".env", "*.json", "doc/*.svg", "contracts/lib", diff --git a/sequencer/src/genesis.rs b/sequencer/src/genesis.rs index dbaabd64ee..f98d41c47b 100644 --- a/sequencer/src/genesis.rs +++ b/sequencer/src/genesis.rs @@ -91,11 +91,13 @@ impl Genesis { .context("connecting L1 client")?; if let Some(fee_contract_address) = self.chain_config.fee_contract { + tracing::info!("validating fee contract at {fee_contract_address:x}"); + if !is_proxy_contract(l1.provider(), fee_contract_address) .await .context("checking if fee contract is a proxy")? { - anyhow::bail!("Fee contract's address is not a proxy"); + anyhow::bail!("Fee contract address {fee_contract_address:x} is not a proxy"); } } From 2819539ecf8849e404e90b4e16af9679c92b6126 Mon Sep 17 00:00:00 2001 From: sveitser Date: Thu, 7 Nov 2024 17:06:19 +0100 Subject: [PATCH 2/2] fix test --- sequencer/src/genesis.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sequencer/src/genesis.rs b/sequencer/src/genesis.rs index f98d41c47b..235a83901c 100644 --- a/sequencer/src/genesis.rs +++ b/sequencer/src/genesis.rs @@ -599,10 +599,7 @@ mod test { // check if the result from the validation is an error if let Err(e) = result { - // assert that the error message contains "Fee contract's address is not a proxy" - assert!(e - .to_string() - .contains("Fee contract's address is not a proxy")); + assert!(e.to_string().contains("is not a proxy")); } else { panic!("Expected the fee contract to not be a proxy, but the validation succeeded"); }