Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump revm-inspectors #717

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ foundry-fork-db = "=0.1.0"
# no default features to avoid c-kzg
revm = { version = "10.0.0", default-features = false }
revm-primitives = { version = "5.0.0", default-features = false }
revm-inspectors = { version = "0.1", features = ["serde"] }
revm-inspectors = { version = "=0.3.0", features = ["serde"] }

## ethers
ethers-contract-abigen = { version = "2.0.14", default-features = false }
Expand Down
4 changes: 3 additions & 1 deletion crates/foundry/evm/evm/src/inspectors/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ impl InspectorStack {
record_memory_snapshots: false,
record_stack_snapshots: StackSnapshotType::None,
record_state_diff: false,
record_returndata_snapshots: false,
record_opcodes_filter: None,
exclude_precompile_calls: false,
record_logs: true,
})
Expand All @@ -397,7 +399,7 @@ impl InspectorStack {
.collect()
})
.unwrap_or_default(),
traces: self.tracer.map(|tracer| tracer.get_traces().clone()),
traces: self.tracer.map(TracingInspector::into_traces),
coverage: self.coverage.map(|coverage| coverage.maps),
cheatcodes: self.cheatcodes,
chisel_state: self.chisel_state.and_then(|state| state.state),
Expand Down
6 changes: 5 additions & 1 deletion crates/foundry/evm/traces/src/decoder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,11 @@ impl CallTraceDecoder {

let events_it = nodes
.iter()
.flat_map(|node| node.logs.iter().filter_map(|log| log.topics().first()))
.flat_map(|node| {
node.logs
.iter()
.filter_map(|log| log.raw_log.topics().first())
})
.unique();
identifier.write().await.identify_events(events_it).await;

Expand Down
9 changes: 5 additions & 4 deletions crates/foundry/evm/traces/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub mod abi;
mod decoder;
pub use decoder::{CallTraceDecoder, CallTraceDecoderBuilder};
use foundry_evm_core::contracts::{ContractsByAddress, ContractsByArtifact};
use revm_inspectors::tracing::types::LogCallOrder;
use revm_inspectors::tracing::types::TraceMemberOrder;
pub use revm_inspectors::tracing::{
types::{CallKind, CallTrace, CallTraceNode},
CallTraceArena, GethTraceBuilder, ParityTraceBuilder, StackSnapshotType, TracingInspector,
Expand Down Expand Up @@ -93,8 +93,8 @@ pub async fn render_trace_arena(
let right_prefix = format!("{child}{PIPE}");
for child in &node.ordering {
match child {
LogCallOrder::Log(index) => {
let log = render_trace_log(&node.logs[*index], decoder).await?;
TraceMemberOrder::Log(index) => {
let log = render_trace_log(&node.logs[*index].raw_log, decoder).await?;

// Prepend our tree structure symbols to each line of the displayed log
log.lines().enumerate().try_for_each(|(i, line)| {
Expand All @@ -106,7 +106,7 @@ pub async fn render_trace_arena(
)
})?;
}
LogCallOrder::Call(index) => {
TraceMemberOrder::Call(index) => {
inner(
arena,
decoder,
Expand All @@ -117,6 +117,7 @@ pub async fn render_trace_arena(
)
.await?;
}
TraceMemberOrder::Step(_) => {}
}
}

Expand Down
Loading