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 alloy #78

Merged
merged 6 commits into from
Apr 2, 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
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ clippy.lint_groups_priority = "allow"

[dependencies]
# eth
alloy-sol-types = "0.6.4"
alloy-primitives = "0.6.4"
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "7e39c85" }
alloy-rpc-trace-types = { git = "https://github.com/alloy-rs/alloy", rev = "7e39c85" }
revm = { version = "7.2", default-features = false, features = ["std"] }
alloy-sol-types = "0.7.0"
alloy-primitives = "0.7.0"
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "bfd0fda" }
alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "bfd0fda" }
revm = { version = "8.0", default-features = false, features = ["std"] }

anstyle = "1.0"
colorchoice = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ license-files = [{ path = "LICENSE", hash = 0x001c7e6c }]
unknown-registry = "warn"
unknown-git = "deny"
# TODO: remove, see ./Cargo.toml
allow-git = ["https://github.com/alloy-rs/alloy", "https://github.com/bluealloy/revm"]
allow-git = ["https://github.com/alloy-rs/alloy", "https://github.com/bluealloy/revm", "https://github.com/alloy-rs/core"]
6 changes: 3 additions & 3 deletions src/opcode.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use alloy_rpc_trace_types::opcode::OpcodeGas;
use alloy_rpc_types_trace::opcode::OpcodeGas;
use revm::{
interpreter::{opcode::OpCode, Interpreter},
Database, EvmContext, Inspector,
Expand Down Expand Up @@ -98,7 +98,7 @@ mod tests {
#[test]
fn test_opcode_counter_inspector() {
let mut opcode_counter = OpcodeGasInspector::new();
let contract = Box::<Contract>::default();
let contract = Contract::default();
let mut interpreter = Interpreter::new(contract, 10000, false);
let db = CacheDB::new(EmptyDB::default());

Expand All @@ -118,7 +118,7 @@ mod tests {
#[test]
fn test_with_variety_of_opcodes() {
let mut opcode_counter = OpcodeGasInspector::new();
let contract = Box::<Contract>::default();
let contract = Contract::default();
let mut interpreter = Interpreter::new(contract, 2024, false);
let db = CacheDB::new(EmptyDB::default());

Expand Down
2 changes: 1 addition & 1 deletion src/tracing/builder/geth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::tracing::{
TracingInspectorConfig,
};
use alloy_primitives::{Address, Bytes, B256, U256};
use alloy_rpc_trace_types::geth::{
use alloy_rpc_types_trace::geth::{
AccountChangeKind, AccountState, CallConfig, CallFrame, DefaultFrame, DiffMode,
GethDefaultTracingOptions, PreStateConfig, PreStateFrame, PreStateMode, StructLog,
};
Expand Down
2 changes: 1 addition & 1 deletion src/tracing/builder/parity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use crate::tracing::{
TracingInspectorConfig,
};
use alloy_primitives::{Address, U64};
use alloy_rpc_trace_types::parity::*;
use alloy_rpc_types::TransactionInfo;
use alloy_rpc_types_trace::parity::*;
use revm::{
db::DatabaseRef,
interpreter::{
Expand Down
10 changes: 5 additions & 5 deletions src/tracing/config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use alloy_rpc_trace_types::{
use alloy_rpc_types_trace::{
geth::{CallConfig, GethDefaultTracingOptions, PreStateConfig},
parity::TraceType,
};
Expand Down Expand Up @@ -68,7 +68,7 @@ impl TracingInspectorConfig {
/// This config does _not_ record opcode level traces and is suited for `debug_traceTransaction`
///
/// This will configure the default output of geth's default
/// [StructLogTracer](alloy_rpc_trace_types::geth::DefaultFrame).
/// [StructLogTracer](alloy_rpc_types_trace::geth::DefaultFrame).
pub const fn default_geth() -> Self {
Self {
record_steps: true,
Expand Down Expand Up @@ -98,7 +98,7 @@ impl TracingInspectorConfig {
/// Returns a config for geth style traces based on the given [GethDefaultTracingOptions].
///
/// This will configure the output of geth's default
/// [StructLogTracer](alloy_rpc_trace_types::geth::DefaultFrame) according to the given config.
/// [StructLogTracer](alloy_rpc_types_trace::geth::DefaultFrame) according to the given config.
#[inline]
pub fn from_geth_config(config: &GethDefaultTracingOptions) -> Self {
Self {
Expand All @@ -113,7 +113,7 @@ impl TracingInspectorConfig {
}
}

/// Returns a config for geth's [CallTracer](alloy_rpc_trace_types::geth::CallFrame).
/// Returns a config for geth's [CallTracer](alloy_rpc_types_trace::geth::CallFrame).
///
/// This returns [Self::none] and enables [TracingInspectorConfig::record_logs] if configured in
/// the given [CallConfig]
Expand All @@ -124,7 +124,7 @@ impl TracingInspectorConfig {
.set_record_logs(config.with_log.unwrap_or_default())
}

/// Returns a config for geth's [PrestateTracer](alloy_rpc_trace_types::geth::PreStateFrame).
/// Returns a config for geth's [PrestateTracer](alloy_rpc_types_trace::geth::PreStateFrame).
///
/// Note: This currently returns [Self::none] because the prestate tracer result currently
/// relies on the execution result entirely, see
Expand Down
2 changes: 1 addition & 1 deletion src/tracing/fourbyte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//! See also <https://geth.ethereum.org/docs/developers/evm-tracing/built-in-tracers>

use alloy_primitives::{hex, Selector};
use alloy_rpc_trace_types::geth::FourByteFrame;
use alloy_rpc_types_trace::geth::FourByteFrame;
use revm::{
interpreter::{CallInputs, CallOutcome},
Database, EvmContext, Inspector,
Expand Down
8 changes: 4 additions & 4 deletions src/tracing/js/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ where
memory,
pc: interp.program_counter() as u64,
gas_remaining: interp.gas.remaining(),
cost: interp.gas.spend(),
cost: interp.gas.spent(),
depth: context.journaled_state.depth(),
refund: interp.gas.refunded() as u64,
error: None,
Expand Down Expand Up @@ -425,7 +425,7 @@ where
memory,
pc: interp.program_counter() as u64,
gas_remaining: interp.gas.remaining(),
cost: interp.gas.spend(),
cost: interp.gas.spent(),
depth: context.journaled_state.depth(),
refund: interp.gas.refunded() as u64,
error: Some(format!("{:?}", interp.instruction_result)),
Expand Down Expand Up @@ -487,7 +487,7 @@ where
) -> CallOutcome {
if self.can_call_exit() {
let frame_result = FrameResult {
gas_used: outcome.result.gas.spend(),
gas_used: outcome.result.gas.spent(),
output: outcome.result.output.clone(),
error: None,
};
Expand Down Expand Up @@ -540,7 +540,7 @@ where
) -> CreateOutcome {
if self.can_call_exit() {
let frame_result = FrameResult {
gas_used: outcome.result.gas.spend(),
gas_used: outcome.result.gas.spent(),
output: outcome.result.output.clone(),
error: None,
};
Expand Down
4 changes: 2 additions & 2 deletions src/tracing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ impl TracingInspector {
if trace_idx == 0 {
// this is the root call which should get the gas used of the transaction
// refunds are applied after execution, which is when the root call ends
trace.gas_used = gas_used(context.spec_id(), gas.spend(), gas.refunded() as u64);
trace.gas_used = gas_used(context.spec_id(), gas.spent(), gas.refunded() as u64);
} else {
trace.gas_used = gas.spend();
trace.gas_used = gas.spent();
}

trace.status = result;
Expand Down
2 changes: 1 addition & 1 deletion src/tracing/mux.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::tracing::{FourByteInspector, TracingInspector, TracingInspectorConfig};
use alloy_primitives::{Address, Log, U256};
use alloy_rpc_trace_types::geth::{
use alloy_rpc_types_trace::geth::{
mux::{MuxConfig, MuxFrame},
CallConfig, FourByteFrame, GethDebugBuiltInTracerType, GethDebugTracerConfig, GethTrace,
NoopFrame, PreStateConfig,
Expand Down
2 changes: 1 addition & 1 deletion src/tracing/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::tracing::{config::TraceStyle, utils, utils::convert_memory};
pub use alloy_primitives::Log;
use alloy_primitives::{Address, Bytes, LogData, U256, U64};
use alloy_rpc_trace_types::{
use alloy_rpc_types_trace::{
geth::{CallFrame, CallLogFrame, GethDefaultTracingOptions, StructLog},
parity::{
Action, ActionType, CallAction, CallOutput, CallType, CreateAction, CreateOutput,
Expand Down
2 changes: 1 addition & 1 deletion tests/it/geth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::utils::inspect;
use alloy_primitives::{hex, Address, Bytes};
use alloy_rpc_trace_types::geth::{
use alloy_rpc_types_trace::geth::{
mux::MuxConfig, CallConfig, GethDebugBuiltInTracerType, GethDebugTracerConfig, GethTrace,
PreStateConfig,
};
Expand Down
Loading