This commit is contained in:
pgherveou
2025-10-08 18:26:43 +02:00
parent 8303d789cd
commit 0a68800856
5 changed files with 76 additions and 31 deletions
+2 -2
View File
@@ -94,8 +94,8 @@ impl GethNode {
const TRANSACTION_INDEXING_ERROR: &str = "transaction indexing is in progress";
const TRANSACTION_TRACING_ERROR: &str = "historical state not available in path scheme yet";
const RECEIPT_POLLING_DURATION: Duration = Duration::from_secs(5 * 60);
const TRACE_POLLING_DURATION: Duration = Duration::from_secs(60);
const RECEIPT_POLLING_DURATION: Duration = Duration::from_secs(10);
const TRACE_POLLING_DURATION: Duration = Duration::from_secs(10);
pub fn new(
context: impl AsRef<WorkingDirectoryConfiguration>
@@ -116,7 +116,7 @@ impl LighthouseGethNode {
const TRANSACTION_INDEXING_ERROR: &str = "transaction indexing is in progress";
const TRANSACTION_TRACING_ERROR: &str = "historical state not available in path scheme yet";
const RECEIPT_POLLING_DURATION: Duration = Duration::from_secs(5 * 60);
const RECEIPT_POLLING_DURATION: Duration = Duration::from_secs(30);
const TRACE_POLLING_DURATION: Duration = Duration::from_secs(60);
const VALIDATOR_MNEMONIC: &str = "giant issue aisle success illegal bike spike question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy very lucky have athlete";
@@ -428,16 +428,20 @@ impl EthereumNode for ZombieNode {
transaction: alloy::rpc::types::TransactionRequest,
) -> Pin<Box<dyn Future<Output = anyhow::Result<TransactionReceipt>> + '_>> {
Box::pin(async move {
let receipt = self
let pending = self
.provider()
.await
.context("Failed to create provider for transaction submission")?
.send_transaction(transaction)
.await
.context("Failed to submit transaction to proxy")?
.get_receipt()
.await
.context("Failed to fetch transaction receipt from proxy")?;
.context("Failed to submit transaction to proxy")?;
let receipt =
tokio::time::timeout(std::time::Duration::from_secs(120), pending.get_receipt())
.await
.context("Timeout waiting for transaction receipt")?
.context("Failed to fetch transaction receipt from proxy")?;
Ok(receipt)
})
}
+4 -3
View File
@@ -108,9 +108,10 @@ where
.await
.context(format!("Transaction inclusion watching timeout for {tx_hash}"))?;
poll(Duration::from_secs(60), PollingWaitBehavior::Constant(Duration::from_secs(3)), || {
let provider = provider.clone();
debug!(%tx_hash, "Transaction included, polling for receipt");
poll(Duration::from_secs(30), PollingWaitBehavior::Constant(Duration::from_secs(3)), || {
let provider = provider.clone();
async move {
match provider.get_transaction_receipt(tx_hash).await {
Ok(Some(receipt)) => Ok(ControlFlow::Break(receipt)),
@@ -119,5 +120,5 @@ where
}
})
.await
.context(format!("Polling for receipt failed for {tx_hash}"))
.context(format!("Polling for receipt timed out for {tx_hash}"))
}