From 85284b11471fbcc4e7d0d590155edf39b04c845c Mon Sep 17 00:00:00 2001 From: Leandro Serra Date: Mon, 7 Jul 2025 16:18:42 -0300 Subject: [PATCH 1/3] fix(l1,l2): eth client send blobs when calling eth_estimateGas --- crates/networking/rpc/clients/eth/mod.rs | 30 ++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/crates/networking/rpc/clients/eth/mod.rs b/crates/networking/rpc/clients/eth/mod.rs index db3e03b6dc..2b171594f9 100644 --- a/crates/networking/rpc/clients/eth/mod.rs +++ b/crates/networking/rpc/clients/eth/mod.rs @@ -436,6 +436,20 @@ impl EthClient { ); } + if !transaction.blobs.is_empty() { + let blobs_str: Vec<_> = transaction + .blobs + .into_iter() + .map(|blob| format!("0x{}", hex::encode(blob))) + .collect(); + + data.as_object_mut() + .ok_or_else(|| { + EthClientError::Custom("Failed to mutate data in estimate_gas".to_owned()) + })? + .insert("blobs".to_owned(), json!(blobs_str)); + } + // Add the nonce just if present, otherwise the RPC will use the latest nonce if let Some(nonce) = transaction.nonce { if let Value::Object(ref mut map) = data { @@ -843,7 +857,9 @@ impl EthClient { ) -> Result<(), EthClientError> { let mut transaction = match wrapped_tx { WrappedTransaction::EIP4844(wrapped_eip4844_transaction) => { - GenericTransaction::from(wrapped_eip4844_transaction.clone().tx) + let mut tx = GenericTransaction::from(wrapped_eip4844_transaction.clone().tx); + add_blobs_to_generic_tx(&mut tx, &wrapped_eip4844_transaction.blobs_bundle); + tx } WrappedTransaction::EIP1559(eip1559_transaction) => { GenericTransaction::from(eip1559_transaction.clone()) @@ -877,7 +893,9 @@ impl EthClient { ) -> Result { let mut transaction = match wrapped_tx { WrappedTransaction::EIP4844(wrapped_eip4844_transaction) => { - GenericTransaction::from(wrapped_eip4844_transaction.clone().tx) + let mut tx = GenericTransaction::from(wrapped_eip4844_transaction.clone().tx); + add_blobs_to_generic_tx(&mut tx, &wrapped_eip4844_transaction.blobs_bundle); + tx } WrappedTransaction::EIP1559(eip1559_transaction) => { GenericTransaction::from(eip1559_transaction.clone()) @@ -1423,6 +1441,14 @@ pub fn get_address_from_secret_key(secret_key: &SecretKey) -> Result Date: Mon, 7 Jul 2025 16:20:20 -0300 Subject: [PATCH 2/3] fix send request retries if endpoint returns Ok(RpcResponse::Error) --- crates/networking/rpc/clients/eth/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/networking/rpc/clients/eth/mod.rs b/crates/networking/rpc/clients/eth/mod.rs index 2b171594f9..1f1494f5d4 100644 --- a/crates/networking/rpc/clients/eth/mod.rs +++ b/crates/networking/rpc/clients/eth/mod.rs @@ -155,7 +155,11 @@ impl EthClient { for url in self.urls.iter() { response = self.send_request_to_url(url, &request).await; if response.is_ok() { - return response; + // Some RPC servers don't implement all the endpoints or don't implement them completly/correctly + // so if the server returns Ok(RpcResponse::Error) we retry with the others + if let Ok(RpcResponse::Success(ref _a)) = response { + return response; + } } } response From f40c307739e925987b0bc20814de39a4def214b4 Mon Sep 17 00:00:00 2001 From: LeanSerra <46695152+LeanSerra@users.noreply.github.com> Date: Tue, 8 Jul 2025 13:01:24 -0300 Subject: [PATCH 3/3] fix typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tomás Paradelo <112426153+tomip01@users.noreply.github.com> --- crates/networking/rpc/clients/eth/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/networking/rpc/clients/eth/mod.rs b/crates/networking/rpc/clients/eth/mod.rs index 1f1494f5d4..b1f8530e18 100644 --- a/crates/networking/rpc/clients/eth/mod.rs +++ b/crates/networking/rpc/clients/eth/mod.rs @@ -155,7 +155,7 @@ impl EthClient { for url in self.urls.iter() { response = self.send_request_to_url(url, &request).await; if response.is_ok() { - // Some RPC servers don't implement all the endpoints or don't implement them completly/correctly + // Some RPC servers don't implement all the endpoints or don't implement them completely/correctly // so if the server returns Ok(RpcResponse::Error) we retry with the others if let Ok(RpcResponse::Success(ref _a)) = response { return response;