Skip to content

Commit f23ae0b

Browse files
authored
Instrument gas price simulation (#3874)
# Description We're sometimes getting "insufficient funds" reverts with ridiculous estimates in access lists. Adding some instrumentation that captures the return value of the gas estimator to be able to debug this better.
1 parent 29ad31b commit f23ae0b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

crates/driver/src/domain/competition/solution/settlement.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ impl Settlement {
124124
}
125125

126126
/// Create a new settlement and ensure that it is valid.
127+
#[instrument(name = "create_settlement", skip_all)]
127128
async fn new(
128129
auction_id: auction::Id,
129130
solution: Solution,

crates/driver/src/infra/blockchain/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use {
1313
},
1414
std::{fmt, sync::Arc, time::Duration},
1515
thiserror::Error,
16+
tracing::{Level, instrument},
1617
url::Url,
1718
web3::{Transport, types::CallRequest},
1819
};
@@ -173,6 +174,7 @@ impl Ethereum {
173174
}
174175

175176
/// Create access list used by a transaction.
177+
#[instrument(skip_all)]
176178
pub async fn create_access_list<T>(&self, tx: T) -> Result<eth::AccessList, Error>
177179
where
178180
CallRequest: From<T>,
@@ -271,6 +273,7 @@ impl Ethereum {
271273
.map_err(Into::into)
272274
}
273275

276+
#[instrument(skip(self), ret(level = Level::DEBUG))]
274277
pub(super) async fn simulation_gas_price(&self) -> Option<eth::U256> {
275278
// Some nodes don't pick a reasonable default value when you don't specify a gas
276279
// price and default to 0. Additionally some sneaky tokens have special code

0 commit comments

Comments
 (0)