From 3afc63f5a7ebad4c5706dfbe7ce0c71731a1a385 Mon Sep 17 00:00:00 2001 From: Archethect Date: Fri, 2 Aug 2024 11:36:50 +0200 Subject: [PATCH 1/4] Fix prompt for InFile wallet path --- .../src/commands/chain/args/create.rs | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs index 63f3a3736cd7..4575aca1ccd8 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs @@ -79,18 +79,20 @@ impl ChainCreateArgs { .ask() }); - let wallet_creation = PromptSelect::new( - MSG_WALLET_CREATION_PROMPT, - WalletCreation::iter().filter(|wallet| { - // Disable localhost wallets for external networks - if l1_network == &L1Network::Localhost { - true - } else { - wallet != &WalletCreation::Localhost - } - }), - ) - .ask(); + let wallet_creation = self.wallet_creation.unwrap_or_else(|| { + PromptSelect::new( + MSG_WALLET_CREATION_PROMPT, + WalletCreation::iter().filter(|wallet| { + // Disable localhost wallets for external networks + if l1_network == &L1Network::Localhost { + true + } else { + wallet != &WalletCreation::Localhost + } + }), + ) + .ask() + }); let prover_version = PromptSelect::new(MSG_PROVER_VERSION_PROMPT, ProverMode::iter()).ask(); @@ -100,7 +102,7 @@ impl ChainCreateArgs { ) .ask(); - let wallet_path: Option = if self.wallet_creation == Some(WalletCreation::InFile) { + let wallet_path: Option = if wallet_creation == WalletCreation::InFile { Some(self.wallet_path.unwrap_or_else(|| { Prompt::new(MSG_WALLET_PATH_PROMPT) .validate_with(|val: &String| { From d9ca2263a689f8ba8e22512de8a4cea7f011f2bd Mon Sep 17 00:00:00 2001 From: Archethect Date: Thu, 8 Aug 2024 14:50:43 +0200 Subject: [PATCH 2/4] Support recursively fetching batched events for local reth node --- core/node/eth_watch/src/client.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/node/eth_watch/src/client.rs b/core/node/eth_watch/src/client.rs index 39b9b5e9f6b1..da964d3a52c0 100644 --- a/core/node/eth_watch/src/client.rs +++ b/core/node/eth_watch/src/client.rs @@ -40,6 +40,7 @@ pub trait EthClient: 'static + fmt::Debug + Send + Sync { pub const RETRY_LIMIT: usize = 5; const TOO_MANY_RESULTS_INFURA: &str = "query returned more than"; const TOO_MANY_RESULTS_ALCHEMY: &str = "response size exceeded"; +const TOO_MANY_RESULTS_RETH: &str = "query exceeds max block range"; /// Implementation of [`EthClient`] based on HTTP JSON-RPC (encapsulated via [`EthInterface`]). #[derive(Debug)] @@ -178,6 +179,7 @@ impl EthClient for EthHttpQueryClient { // check whether the error is related to having too many results if err_message.contains(TOO_MANY_RESULTS_INFURA) || err_message.contains(TOO_MANY_RESULTS_ALCHEMY) + || err_message.contains(TOO_MANY_RESULTS_RETH) { // get the numeric block ids let from_number = match from { From 41727f28899c9d352e883e571f81db5158e7212e Mon Sep 17 00:00:00 2001 From: Archethect Date: Thu, 8 Aug 2024 14:57:47 +0200 Subject: [PATCH 3/4] Add corsdomain for localhost --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 116cc3478185..68feb0769c23 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: source: ./etc/reth/chaindata target: /chaindata - command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --dev.block-time 300ms --chain /chaindata/reth_config + command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --http.corsdomain "*" --dev.block-time 300ms --chain /chaindata/reth_config ports: - 127.0.0.1:8545:8545 From f7bcd0020ec8cb8d16a969fe18739c24c226f0d4 Mon Sep 17 00:00:00 2001 From: Archethect Date: Thu, 8 Aug 2024 15:10:07 +0200 Subject: [PATCH 4/4] Revert "Add corsdomain for localhost" This reverts commit 41727f28899c9d352e883e571f81db5158e7212e. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 68feb0769c23..116cc3478185 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: source: ./etc/reth/chaindata target: /chaindata - command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --http.corsdomain "*" --dev.block-time 300ms --chain /chaindata/reth_config + command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --dev.block-time 300ms --chain /chaindata/reth_config ports: - 127.0.0.1:8545:8545