Skip to content

Commit 244a6cb

Browse files
anna-carrollEvalir
andauthored
improve logging on estimate_gas (#68)
* log request before & after gas normalization * add estimation result * chore: lock down dfeps * chore: force 1.0.5 * chore: just update the test * chore: more fixes * chore: more fixes --------- Co-authored-by: evalir <[email protected]>
1 parent b2ee9f3 commit 244a6cb

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ signet-tx-cache = { version = "0.2.0", path = "crates/tx-cache" }
4646
signet-zenith = { version = "0.2.0", path = "crates/zenith" }
4747

4848
# ajj
49-
ajj = { version = "0.3.1" }
49+
ajj = { version = "0.3.4" }
5050

5151
# trevm
52-
trevm = { version = "0.23.4", features = ["full_env_cfg"] }
52+
trevm = { version = "=0.23.4", features = ["full_env_cfg"] }
5353

5454
# Alloy periphery crates
5555
alloy = { version = "=1.0.5", features = [
@@ -58,6 +58,7 @@ alloy = { version = "=1.0.5", features = [
5858
"genesis",
5959
"arbitrary",
6060
] }
61+
alloy-rpc-types-mev = { version = "=1.0.5" }
6162
alloy-contract = { version = "=1.0.5", features = ["pubsub"] }
6263

6364
# Reth
@@ -80,7 +81,7 @@ reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1
8081
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
8182

8283
# Foundry periphery
83-
foundry-blob-explorers = "0.10"
84+
foundry-blob-explorers = "=0.10"
8485

8586
# Async
8687
tokio = { version = "1.43.0", features = ["macros"] }
@@ -114,4 +115,4 @@ hex = { package = "const-hex", version = "1.10", default-features = false, featu
114115
uuid = "1.16.0"
115116

116117
# Test Utils
117-
alloy-rlp = "0.3.11"
118+
alloy-rlp = "=0.3.11"

crates/bundle/src/send/bundle.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ mod test {
148148
max_timestamp: Some(3),
149149
reverting_tx_hashes: vec![B256::repeat_byte(4), B256::repeat_byte(5)],
150150
replacement_uuid: Some("uuid".to_owned()),
151+
..Default::default()
151152
},
152153
host_fills: Some(SignedFill {
153154
permit: Permit2Batch {

crates/rpc/examples/filler.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ where
135135
min_timestamp: None, // sufficiently covered by pinning to next block number
136136
max_timestamp: None, // sufficiently covered by pinning to next block number
137137
replacement_uuid: None, // optional if implementing strategies that replace or cancel bundles
138+
..Default::default() // all other options are not used.
138139
},
139140
};
140141

crates/rpc/src/eth/endpoints.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,10 +527,6 @@ where
527527
{
528528
let id = block.unwrap_or(BlockId::pending());
529529

530-
// Stateless gas normalization.
531-
let max_gas = ctx.signet().config().rpc_gas_cap;
532-
normalize_gas_stateless(&mut request, max_gas);
533-
534530
// this span is verbose yo.
535531
let span = trace_span!(
536532
"estimate_gas",
@@ -541,6 +537,12 @@ where
541537
block_cfg = tracing::field::Empty,
542538
);
543539

540+
// Stateless gas normalization.
541+
let max_gas = ctx.signet().config().rpc_gas_cap;
542+
normalize_gas_stateless(&mut request, max_gas);
543+
544+
tracing::span::Span::current().record("normalized_gas", format!("{:?}", request.gas));
545+
544546
let task = async move {
545547
// Get the block cfg from backend, erroring if it fails
546548
let block_cfg = match ctx.signet().block_cfg(id).await {
@@ -568,6 +570,8 @@ where
568570

569571
let (estimate, _) = response_tri!(trevm.estimate_gas().map_err(EvmErrored::into_error));
570572

573+
tracing::span::Span::current().record("estimate", format!("{:?}", &estimate));
574+
571575
match estimate {
572576
trevm::EstimationResult::Success { estimation, .. } => {
573577
ResponsePayload::Success(U64::from(estimation))

0 commit comments

Comments
 (0)