Skip to content

Commit a2cbea5

Browse files
Merge pull request #107 from availproject/feat/log-estimates
feat: Adds last estimates logs to track surrounding fees
2 parents 0c49557 + ff9abb7 commit a2cbea5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

script/bin/operator.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,7 @@ where
857857
get_retry_envs()?;
858858

859859
let mut attempt: u8 = 0;
860+
let mut last_estimates: Vec<f64> = vec![];
860861

861862
let tx_hash: B256 = loop {
862863
let effective_gas_estimate = self
@@ -867,6 +868,8 @@ where
867868
let should_send_now = effective_gas_estimate <= max_usd_fee_threshold
868869
|| attempt == max_estimate_retries;
869870

871+
last_estimates.push(round_to_decimals(effective_gas_estimate, 2));
872+
870873
if should_send_now {
871874
let receipt = self.submit_proof(chain_id, tx).await?;
872875
let wei = Unit::ETHER.wei_const().to::<u128>() as f64;
@@ -881,7 +884,8 @@ where
881884
message = "Transaction gas fee used",
882885
gas_fee = effective_gas_used,
883886
usd_fee = usd_fee,
884-
tx_hash = %receipt.transaction_hash()
887+
tx_hash = %receipt.transaction_hash(),
888+
last_usd_gas_estimates = ?last_estimates
885889
);
886890

887891
break receipt.transaction_hash();

0 commit comments

Comments
 (0)