diff --git a/.cargo/config.toml b/.cargo/config.toml index bd0f7448f4..361bd30ffa 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,5 +1,5 @@ [target.'cfg(target_os="macos")'] -rustflags = ["-C", "link-args=-framework CoreFoundation -framework Security"] +rustflags = ["-C", "link-args=-framework CoreFoundation -framework Security -framework CoreServices"] [net] git-fetch-with-cli = true [env] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49d273e4ac..9bdee3415d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,7 +57,7 @@ jobs: uses: actions/setup-go@v3 with: cache: false - go-version: ~1.19 + go-version: ~1.20 # Go cache for building geth-utils - name: Go cache uses: actions/cache@v3 diff --git a/Cargo.lock b/Cargo.lock index b00a460ff0..a48e5e8381 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1824,6 +1824,7 @@ dependencies = [ "log", "serde", "serde_json", + "serde_stacker", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 5b704861b3..010505ed0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,6 +51,7 @@ rayon = "1.5" regex = "1.5" serde = {version = "1.0", features = ["derive"] } serde_json = "1.0" +serde_stacker = "0.1" sha3 = "0.10" snark-verifier = { git = "https://github.com/scroll-tech/snark-verifier", branch = "develop" } snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", branch = "develop", default-features = false, features = ["loader_halo2", "loader_evm", "halo2-pse"] } diff --git a/bus-mapping/src/circuit_input_builder.rs b/bus-mapping/src/circuit_input_builder.rs index 51e08e818c..d3e5ab1f8f 100644 --- a/bus-mapping/src/circuit_input_builder.rs +++ b/bus-mapping/src/circuit_input_builder.rs @@ -12,7 +12,6 @@ mod l2; mod tracer_tests; mod transaction; -use self::access::gen_state_access_trace; pub use self::block::BlockHead; use crate::{ error::Error, @@ -947,29 +946,6 @@ pub struct BuilderClient { circuits_params: CircuitsParams, } -/// Get State Accesses from TxExecTraces -pub fn get_state_accesses( - eth_block: &EthBlock, - geth_traces: &[eth_types::GethExecTrace], -) -> Result { - let mut block_access_trace = vec![Access::new( - None, - RW::WRITE, - AccessValue::Account { - address: eth_block - .author - .ok_or(Error::EthTypeError(eth_types::Error::IncompleteBlock))?, - }, - )]; - for (tx_index, tx) in eth_block.transactions.iter().enumerate() { - let geth_trace = &geth_traces[tx_index]; - let tx_access_trace = gen_state_access_trace(eth_block, tx, geth_trace)?; - block_access_trace.extend(tx_access_trace); - } - - Ok(AccessSet::from(block_access_trace)) -} - /// Build a partial StateDB from step 3 pub fn build_state_code_db( proofs: Vec, @@ -1061,11 +1037,26 @@ impl BuilderClient

{ } /// Step 2. Get State Accesses from TxExecTraces - pub fn get_state_accesses( - eth_block: &EthBlock, - geth_traces: &[eth_types::GethExecTrace], - ) -> Result { - get_state_accesses(eth_block, geth_traces) + pub async fn get_state_accesses(&self, eth_block: &EthBlock) -> Result { + let mut access_set = AccessSet::default(); + access_set.add_account( + eth_block + .author + .ok_or(Error::EthTypeError(eth_types::Error::IncompleteBlock))?, + ); + let traces = self + .cli + .trace_block_prestate_by_hash( + eth_block + .hash + .ok_or(Error::EthTypeError(eth_types::Error::IncompleteBlock))?, + ) + .await?; + for trace in traces.into_iter() { + access_set.extend_from_traces(&trace); + } + + Ok(access_set) } /// Step 3. Query geth for all accounts, storage keys, and codes from @@ -1317,7 +1308,7 @@ impl BuilderClient

{ let mut access_set = AccessSet::default(); for block_num in block_num_begin..block_num_end { let (eth_block, geth_traces, _, _) = self.get_block(block_num).await?; - let mut access_list = Self::get_state_accesses(ð_block, &geth_traces)?; + let mut access_list = self.get_state_accesses(ð_block).await?; access_set.extend(&mut access_list); blocks_and_traces.push((eth_block, geth_traces)); } diff --git a/bus-mapping/src/circuit_input_builder/access.rs b/bus-mapping/src/circuit_input_builder/access.rs index f74ad121e1..81c0bce479 100644 --- a/bus-mapping/src/circuit_input_builder/access.rs +++ b/bus-mapping/src/circuit_input_builder/access.rs @@ -1,13 +1,7 @@ -use crate::{operation::RW, Error}; -use eth_types::{ - evm_types::OpcodeId, Address, GethExecStep, GethExecTrace, GethPrestateTrace, ToAddress, Word, -}; -use ethers_core::utils::get_contract_address; +use crate::operation::RW; +use eth_types::{geth_types::GethData, Address, GethPrestateTrace, Word}; use std::collections::{hash_map::Entry, HashMap, HashSet}; -use AccessValue::{Account, Code, Storage}; -use RW::{READ, WRITE}; - /// State and Code Access with "keys/index" used in the access operation. #[derive(Debug, PartialEq, Eq)] pub enum AccessValue { @@ -48,16 +42,6 @@ impl Access { } } -/// Given a trace and assuming that the first step is a *CALL*/CREATE* kind -/// opcode, return the result if found. -fn get_call_result(trace: &[GethExecStep]) -> Option { - let depth = trace[0].depth; - trace[1..] - .iter() - .find(|s| s.depth == depth) - .and_then(|s| s.stack.last().ok()) -} - /// State and Code Access set. #[derive(Debug, PartialEq, Eq, Default)] pub struct AccessSet { @@ -119,12 +103,13 @@ impl AccessSet { self.state.extend(other.state.drain()); self.code.extend(other.code.drain()); } -} -impl From> for AccessSet { - fn from(list: Vec) -> Self { + pub(crate) fn from_geth_data(geth_data: &GethData) -> Self { let mut access_set = AccessSet::default(); - access_set.extend_from_access(list); + access_set.add_account(geth_data.eth_block.author.unwrap()); + for trace in geth_data.geth_traces.iter() { + access_set.extend_from_traces(&trace.prestate); + } access_set } } @@ -145,168 +130,3 @@ impl Default for CodeSource { Self::Tx } } - -/// Generate the State Access trace from the given trace. All state read/write -/// accesses are reported, without distinguishing those that happen in revert -/// sections. -pub fn gen_state_access_trace( - _block: ð_types::Block, - tx: ð_types::Transaction, - geth_trace: &GethExecTrace, -) -> Result, Error> { - let mut call_stack: Vec<(Address, CodeSource)> = Vec::new(); - let mut accs = vec![Access::new(None, WRITE, Account { address: tx.from })]; - if let Some(to) = tx.to { - call_stack.push((to, CodeSource::Address(to))); - accs.push(Access::new(None, WRITE, Account { address: to })); - // Code may be null if the account is not a contract - accs.push(Access::new(None, READ, Code { address: to })); - } else { - let address = get_contract_address(tx.from, tx.nonce); - call_stack.push((address, CodeSource::Tx)); - accs.push(Access::new(None, WRITE, Account { address })); - accs.push(Access::new(None, WRITE, Code { address })); - } - - for (index, step) in geth_trace.struct_logs.iter().enumerate() { - let next_step = geth_trace.struct_logs.get(index + 1); - let i = Some(index); - let (contract_address, code_source) = &call_stack[call_stack.len() - 1]; - let (contract_address, code_source) = (*contract_address, *code_source); - - let (mut push_call_stack, mut pop_call_stack) = (false, false); - if let Some(next_step) = next_step { - push_call_stack = step.depth + 1 == next_step.depth; - pop_call_stack = step.depth - 1 == next_step.depth; - } - - let result: Result<(), Error> = (|| { - match step.op { - OpcodeId::SSTORE => { - let address = contract_address; - let key = step.stack.last()?; - accs.push(Access::new(i, WRITE, Storage { address, key })); - } - OpcodeId::SLOAD => { - let address = contract_address; - let key = step.stack.last()?; - accs.push(Access::new(i, READ, Storage { address, key })); - } - OpcodeId::SELFBALANCE => { - let address = contract_address; - accs.push(Access::new(i, READ, Account { address })); - } - OpcodeId::CODESIZE => { - if let CodeSource::Address(address) = code_source { - accs.push(Access::new(i, READ, Code { address })); - } - } - OpcodeId::CODECOPY => { - if let CodeSource::Address(address) = code_source { - accs.push(Access::new(i, READ, Code { address })); - } - } - OpcodeId::BALANCE => { - let address = step.stack.last()?.to_address(); - accs.push(Access::new(i, READ, Account { address })); - } - OpcodeId::EXTCODEHASH => { - let address = step.stack.last()?.to_address(); - accs.push(Access::new(i, READ, Account { address })); - } - OpcodeId::EXTCODESIZE => { - let address = step.stack.last()?.to_address(); - accs.push(Access::new(i, READ, Code { address })); - } - OpcodeId::EXTCODECOPY => { - let address = step.stack.last()?.to_address(); - accs.push(Access::new(i, READ, Code { address })); - } - OpcodeId::SELFDESTRUCT => { - let address = contract_address; - accs.push(Access::new(i, WRITE, Account { address })); - let address = step.stack.last()?.to_address(); - accs.push(Access::new(i, WRITE, Account { address })); - } - OpcodeId::CREATE => { - if push_call_stack { - // Find CREATE result - let address = get_call_result(&geth_trace.struct_logs[index..]) - .unwrap_or_else(Word::zero) - .to_address(); - if !address.is_zero() { - accs.push(Access::new(i, WRITE, Account { address })); - accs.push(Access::new(i, WRITE, Code { address })); - } - call_stack.push((address, CodeSource::Address(address))); - } - } - OpcodeId::CREATE2 => { - if push_call_stack { - // Find CREATE2 result - let address = get_call_result(&geth_trace.struct_logs[index..]) - .unwrap_or_else(Word::zero) - .to_address(); - if !address.is_zero() { - accs.push(Access::new(i, WRITE, Account { address })); - accs.push(Access::new(i, WRITE, Code { address })); - } - call_stack.push((address, CodeSource::Address(address))); - } - } - OpcodeId::CALL => { - let address = contract_address; - accs.push(Access::new(i, WRITE, Account { address })); - - let address = step.stack.nth_last(1)?.to_address(); - accs.push(Access::new(i, WRITE, Account { address })); - accs.push(Access::new(i, READ, Code { address })); - if push_call_stack { - call_stack.push((address, CodeSource::Address(address))); - } - } - OpcodeId::CALLCODE => { - let address = contract_address; - accs.push(Access::new(i, WRITE, Account { address })); - - let address = step.stack.nth_last(1)?.to_address(); - accs.push(Access::new(i, WRITE, Account { address })); - accs.push(Access::new(i, READ, Code { address })); - if push_call_stack { - call_stack.push((address, CodeSource::Address(address))); - } - } - OpcodeId::DELEGATECALL => { - let address = step.stack.nth_last(1)?.to_address(); - accs.push(Access::new(i, READ, Code { address })); - if push_call_stack { - call_stack.push((contract_address, CodeSource::Address(address))); - } - } - OpcodeId::STATICCALL => { - let address = step.stack.nth_last(1)?.to_address(); - accs.push(Access::new(i, READ, Code { address })); - if push_call_stack { - call_stack.push((address, CodeSource::Address(address))); - } - } - _ => {} - } - Ok(()) - })(); - if let Err(e) = result { - log::warn!("err when parsing access: {:?}, step {:?}", e, step); - } - - if pop_call_stack { - if call_stack.len() == 1 { - return Err(Error::InvalidGethExecStep( - "gen_state_access_trace: call stack will be empty", - Box::new(step.clone()), - )); - } - call_stack.pop().expect("call stack is empty"); - } - } - Ok(accs) -} diff --git a/bus-mapping/src/circuit_input_builder/input_state_ref.rs b/bus-mapping/src/circuit_input_builder/input_state_ref.rs index c08c1edbab..453c97b397 100644 --- a/bus-mapping/src/circuit_input_builder/input_state_ref.rs +++ b/bus-mapping/src/circuit_input_builder/input_state_ref.rs @@ -925,7 +925,8 @@ impl<'a> CircuitInputStateRef<'a> { let call_id = call.call_id; let call_idx = self.tx.calls().len(); - self.tx_ctx.push_call_ctx(call_idx, call_data); + self.tx_ctx + .push_call_ctx(call_idx, call_data, call.is_success); self.tx.push_call(call); self.block_ctx @@ -1008,13 +1009,8 @@ impl<'a> CircuitInputStateRef<'a> { address.0[0..19] == [0u8; 19] && (1..=9).contains(&address.0[19]) } - /// Parse [`Call`] from a *CALL*/CREATE* step. - pub fn parse_call(&mut self, step: &GethExecStep) -> Result { - let is_success = *self - .tx_ctx - .call_is_success - .get(self.tx.calls().len()) - .unwrap(); + /// Parse [`Call`] from a *CALL*/CREATE* step without information about success and persistent. + pub fn parse_call_partial(&mut self, step: &GethExecStep) -> Result { let kind = CallKind::try_from(step.op)?; let caller = self.call()?; let caller_ctx = self.call_ctx()?; @@ -1089,8 +1085,8 @@ impl<'a> CircuitInputStateRef<'a> { kind, is_static: kind == CallKind::StaticCall || caller.is_static, is_root: false, - is_persistent: caller.is_persistent && is_success, - is_success, + is_persistent: caller.is_persistent, + is_success: false, rw_counter_end_of_reversion: 0, caller_address, address, @@ -1110,6 +1106,19 @@ impl<'a> CircuitInputStateRef<'a> { Ok(call) } + /// Parse [`Call`] from a *CALL*/CREATE* step + pub fn parse_call(&mut self, step: &GethExecStep) -> Result { + let is_success = *self + .tx_ctx + .call_is_success + .get(self.tx.calls().len() - self.tx_ctx.call_is_success_offset) + .unwrap(); + let mut call = self.parse_call_partial(step)?; + call.is_success = is_success; + call.is_persistent = self.call()?.is_persistent && is_success; + Ok(call) + } + /// Return the reverted version of an op by op_ref only if the original op /// was reversible. fn get_rev_op_by_ref(&self, op_ref: &OperationRef) -> Option { @@ -1331,7 +1340,7 @@ impl<'a> CircuitInputStateRef<'a> { caller.last_callee_memory = callee_memory; } - self.tx_ctx.pop_call_ctx(); + self.tx_ctx.pop_call_ctx(call.is_success); Ok(()) } diff --git a/bus-mapping/src/circuit_input_builder/tracer_tests.rs b/bus-mapping/src/circuit_input_builder/tracer_tests.rs index a8d992ab52..d4ef0463ea 100644 --- a/bus-mapping/src/circuit_input_builder/tracer_tests.rs +++ b/bus-mapping/src/circuit_input_builder/tracer_tests.rs @@ -1,6 +1,5 @@ use super::*; use crate::{ - circuit_input_builder::access::gen_state_access_trace, error::{ ContractAddressCollisionError, DepthError, ExecError, InsufficientBalanceError, OogError, }, @@ -13,12 +12,9 @@ use eth_types::{ geth_types::GethData, word, Bytecode, GethExecError, Hash, ToAddress, ToWord, Word, }; -use mock::{ - test_ctx::{helpers::*, LoggerConfig, TestContext}, - MOCK_COINBASE, -}; +use mock::test_ctx::{helpers::*, LoggerConfig, TestContext}; use pretty_assertions::assert_eq; -use std::{collections::HashSet, sync::LazyLock}; +use std::sync::LazyLock; // Helper struct that contains a CircuitInputBuilder, a particular tx and a // particular execution step so that we can easily get a @@ -47,6 +43,8 @@ impl CircuitInputBuilderTx { return_value: "".to_owned(), struct_logs: vec![geth_step.clone()], account_after: vec![], + prestate: block.geth_traces[0].prestate.clone(), + call_trace: block.geth_traces[0].call_trace.clone(), }, false, ) @@ -1946,338 +1944,3 @@ fn create_address() { assert_eq!(addr.to_word(), addr_expect); } - -#[test] -fn test_gen_access_trace() { - use AccessValue::{Account, Code, Storage}; - use RW::{READ, WRITE}; - let ADDR_0 = address!("0x00000000000000000000000000000000c014ba5e"); - - // code_a calls code_b via static call, which tries to SSTORE and fails. - let code_a = bytecode! { - PUSH1(0x0) // retLength - PUSH1(0x0) // retOffset - PUSH1(0x0) // argsLength - PUSH1(0x0) // argsOffset - PUSH1(0x0) // value - PUSH32(*WORD_ADDR_B) // addr - PUSH32(0x1_0000) // gas - CALL - - PUSH2(0xaa) - }; - let code_b = bytecode! { - .op_mstore(0x01, word!("0x1234567890000000000000000000abcdef000000000000000000112233445566")) - PUSH1(0x01) // value - PUSH1(0x02) // key - SSTORE - PUSH1(0x03) // key - SLOAD - - PUSH3(0xbb) - }; - - // Get the execution steps from the external tracer - let block: GethData = TestContext::<3, 2>::new_with_logger_config( - None, - |accs| { - accs[0] - .address(address!("0x0000000000000000000000000000000000000000")) - .code(code_a); - accs[1].address(*ADDR_B).code(code_b); - accs[2].address(ADDR_0).balance(Word::from(1u64 << 30)); - }, - |mut txs, accs| { - txs[0].to(accs[0].address).from(accs[2].address); - txs[1] - .to(accs[1].address) - .from(accs[2].address) - .nonce(Word::one()); - }, - |block, _tx| block.number(0xcafeu64), - LoggerConfig::enable_memory(), - ) - .unwrap() - .into(); - - let access_trace = gen_state_access_trace( - &block.eth_block, - &block.eth_block.transactions[0], - &block.geth_traces[0], - ) - .unwrap(); - - assert_eq!( - access_trace, - vec![ - Access::new(None, WRITE, Account { address: ADDR_0 }), - Access::new(None, WRITE, Account { address: *ADDR_A }), - Access::new(None, READ, Code { address: *ADDR_A }), - Access::new(Some(7), WRITE, Account { address: *ADDR_A }), - Access::new(Some(7), WRITE, Account { address: *ADDR_B }), - Access::new(Some(7), READ, Code { address: *ADDR_B }), - Access::new( - Some(13), - WRITE, - Storage { - address: *ADDR_B, - key: Word::from(2), - } - ), - Access::new( - Some(15), - READ, - Storage { - address: *ADDR_B, - key: Word::from(3), - } - ), - ] - ); - - let access_set = AccessSet::from(access_trace); - assert_eq!( - access_set, - AccessSet { - state: HashMap::from_iter([ - (ADDR_0, HashSet::new()), - (*ADDR_A, HashSet::new()), - (*ADDR_B, HashSet::from_iter([Word::from(2), Word::from(3)])) - ]), - code: HashSet::from_iter([*ADDR_A, *ADDR_B]), - } - ) -} - -#[test] -fn test_gen_access_trace_call_EOA_no_new_stack_frame() { - use AccessValue::{Account, Code, Storage}; - use RW::{READ, WRITE}; - - // code calls an EOA with not code, so it won't push new stack frame. - let code = bytecode! { - PUSH1(0x0) // retLength - PUSH1(0x0) // retOffset - PUSH1(0x0) // argsLength - PUSH1(0x0) // argsOffset - PUSH1(0x0) // value - PUSH32(*WORD_ADDR_B) // addr - PUSH32(0x1_0000) // gas - CALL - PUSH1(0x01) // value - PUSH1(0x02) // key - SSTORE - PUSH1(0x03) // key - SLOAD - - PUSH2(0xaa) - }; - - // Get the execution steps from the external tracer - let block: GethData = TestContext::<2, 1>::new_with_logger_config( - None, - |accs| { - accs[0].address(*MOCK_COINBASE).code(code); - accs[1].address(*ADDR_B).balance(Word::from(1u64 << 30)); - }, - tx_from_1_to_0, - |block, _tx| block.number(0xcafeu64), - LoggerConfig::enable_memory(), - ) - .unwrap() - .into(); - - let access_trace = gen_state_access_trace( - &block.eth_block, - &block.eth_block.transactions[0], - &block.geth_traces[0], - ) - .unwrap(); - - assert_eq!( - access_trace, - vec![ - Access::new(None, WRITE, Account { address: *ADDR_B }), - Access::new( - None, - WRITE, - Account { - address: *MOCK_COINBASE - } - ), - Access::new( - None, - READ, - Code { - address: *MOCK_COINBASE - } - ), - Access::new( - Some(7), - WRITE, - Account { - address: *MOCK_COINBASE - } - ), - Access::new(Some(7), WRITE, Account { address: *ADDR_B }), - Access::new(Some(7), READ, Code { address: *ADDR_B }), - Access::new( - Some(10), - WRITE, - Storage { - address: *MOCK_COINBASE, - key: Word::from(2u64), - } - ), - Access::new( - Some(12), - READ, - Storage { - address: *MOCK_COINBASE, - key: Word::from(3u64), - } - ), - ] - ); - - let access_set = AccessSet::from(access_trace); - assert_eq!( - access_set, - AccessSet { - state: HashMap::from_iter([ - ( - *MOCK_COINBASE, - HashSet::from_iter([Word::from(2u64), Word::from(3u64)]) - ), - (*ADDR_B, HashSet::new()), - ]), - code: HashSet::from_iter([*ADDR_B, *MOCK_COINBASE]), - } - ); -} - -#[test] -fn test_gen_access_trace_create_push_call_stack() { - use AccessValue::{Account, Code}; - use RW::{READ, WRITE}; - - // revert - let code_creator = bytecode! { - PUSH1(0x00) // length - PUSH1(0x00) // offset - REVERT - }; - - // code_a calls code_b which executes code_creator in CREATE - let code_a = bytecode! { - PUSH1(0x0) // retLength - PUSH1(0x0) // retOffset - PUSH1(0x0) // argsLength - PUSH1(0x0) // argsOffset - PUSH1(0x0) // value - PUSH32(*WORD_ADDR_B) // addr - PUSH32(0x1_0000) // gas - CALL - - PUSH2(0xaa) - }; - - let mut code_b = Bytecode::default(); - // pad code_creator to multiple of 32 bytes - let len = code_creator.to_vec().len(); - let code_creator: Vec = code_creator - .to_vec() - .iter() - .cloned() - .chain(0u8..((32 - len % 32) as u8)) - .collect(); - for (index, word) in code_creator.chunks(32).enumerate() { - code_b.op_mstore(index * 32, Word::from_big_endian(word)); - } - let code_b_end = bytecode! { - PUSH1(len) // length - PUSH1(0x00) // offset - PUSH1(0x00) // value - CREATE - - PUSH3(0xbb) - }; - code_b.append(&code_b_end); - - // Get the execution steps from the external tracer - let block: GethData = TestContext::<3, 2>::new_with_logger_config( - None, - |accs| { - accs[0].address(*MOCK_COINBASE).code(code_a); - accs[1].address(*ADDR_B).code(code_b); - accs[2].balance(Word::from(1u64 << 30)); - }, - |mut txs, accs| { - txs[0].to(accs[0].address).from(accs[2].address); - txs[1] - .to(accs[1].address) - .from(accs[2].address) - .nonce(Word::one()); - }, - |block, _tx| block.number(0xcafeu64), - LoggerConfig::enable_memory(), - ) - .unwrap() - .into(); - - let access_trace = gen_state_access_trace( - &block.eth_block, - &block.eth_block.transactions[0], - &block.geth_traces[0], - ) - .unwrap(); - - assert_eq!( - access_trace, - vec![ - Access::new( - None, - WRITE, - Account { - address: Address::zero() - } - ), - Access::new( - None, - WRITE, - Account { - address: *MOCK_COINBASE - } - ), - Access::new( - None, - READ, - Code { - address: *MOCK_COINBASE - } - ), - Access::new( - Some(7), - WRITE, - Account { - address: *MOCK_COINBASE - } - ), - Access::new(Some(7), WRITE, Account { address: *ADDR_B }), - Access::new(Some(7), READ, Code { address: *ADDR_B }), - ] - ); - - let access_set = AccessSet::from(access_trace); - assert_eq!( - access_set, - AccessSet { - state: HashMap::from_iter([ - (*MOCK_COINBASE, HashSet::new()), - (*ADDR_A, HashSet::new()), - (*ADDR_B, HashSet::new()), - ]), - code: HashSet::from_iter([*MOCK_COINBASE, *ADDR_B]), - } - ) -} diff --git a/bus-mapping/src/circuit_input_builder/transaction.rs b/bus-mapping/src/circuit_input_builder/transaction.rs index e44467eb0e..a85618babe 100644 --- a/bus-mapping/src/circuit_input_builder/transaction.rs +++ b/bus-mapping/src/circuit_input_builder/transaction.rs @@ -1,7 +1,11 @@ //! Transaction & TransactionContext utility module. -use std::collections::BTreeMap; - +use super::{call::ReversionGroup, Call, CallContext, CallKind, CodeSource, ExecStep}; +use crate::{ + l2_predeployed::l1_gas_price_oracle, + state_db::{CodeDB, StateDB}, + Error, +}; use eth_types::{ evm_types::{gas_utils::tx_data_gas_cost, Memory, OpcodeId}, geth_types, @@ -10,14 +14,6 @@ use eth_types::{ }; use ethers_core::utils::get_contract_address; -use crate::{ - l2_predeployed::l1_gas_price_oracle, - state_db::{CodeDB, StateDB}, - Error, -}; - -use super::{call::ReversionGroup, Call, CallContext, CallKind, CodeSource, ExecStep}; - /// Precision of transaction L1 fee pub const TX_L1_FEE_PRECISION: u64 = 1_000_000_000; /// Extra cost as the bytes of rlped tx commited to L1 (assume to non-zero, overestimated a bit) @@ -38,6 +34,9 @@ pub struct TransactionContext { pub(crate) calls: Vec, /// Call `is_success` indexed by `call_index`. pub(crate) call_is_success: Vec, + /// Call `is_success` offset, since some calls are not included in the + /// `call_is_success` + pub(crate) call_is_success_offset: usize, /// Reversion groups by failure calls. We keep the reversion groups in a /// stack because it's possible to encounter a revert within a revert, /// and in such case, we must only process the reverted operation once: @@ -53,32 +52,7 @@ impl TransactionContext { geth_trace: &GethExecTrace, is_last_tx: bool, ) -> Result { - // Iterate over geth_trace to inspect and collect each call's is_success, which - // is at the top of stack at the step after a call. - let call_is_success = { - let mut call_is_success_map = BTreeMap::new(); - let mut call_indices = Vec::new(); - for (index, geth_step) in geth_trace.struct_logs.iter().enumerate() { - if let Some(geth_next_step) = geth_trace.struct_logs.get(index + 1) { - // Dive into call - if geth_step.depth + 1 == geth_next_step.depth { - call_indices.push(index); - // Emerge from call - } else if geth_step.depth - 1 == geth_next_step.depth { - let is_success = !geth_next_step.stack.last()?.is_zero(); - call_is_success_map.insert(call_indices.pop().unwrap(), is_success); - // Callee with empty code - } else if CallKind::try_from(geth_step.op).is_ok() { - let is_success = !geth_next_step.stack.last()?.is_zero(); - call_is_success_map.insert(index, is_success); - } - } - } - - std::iter::once(!geth_trace.failed) - .chain(call_is_success_map.into_values()) - .collect() - }; + let call_is_success = geth_trace.call_trace.gen_call_is_success(vec![]); let mut tx_ctx = Self { id: eth_tx @@ -89,6 +63,7 @@ impl TransactionContext { log_id: 0, is_last_tx, call_is_success, + call_is_success_offset: 0, calls: Vec::new(), reversion_groups: Vec::new(), l1_fee: geth_trace.l1_fee, @@ -100,6 +75,7 @@ impl TransactionContext { } else { eth_tx.input.to_vec() }, + !geth_trace.failed, ); Ok(tx_ctx) @@ -153,8 +129,8 @@ impl TransactionContext { } /// Push a new call context and its index into the call stack. - pub(crate) fn push_call_ctx(&mut self, call_idx: usize, call_data: Vec) { - if !self.call_is_success[call_idx] { + pub(crate) fn push_call_ctx(&mut self, call_idx: usize, call_data: Vec, is_success: bool) { + if !is_success { self.reversion_groups .push(ReversionGroup::new(vec![(call_idx, 0)], Vec::new())) } else if let Some(reversion_group) = self.reversion_groups.last_mut() { @@ -186,10 +162,10 @@ impl TransactionContext { } /// Pop the last entry in the call stack. - pub(crate) fn pop_call_ctx(&mut self) { + pub(crate) fn pop_call_ctx(&mut self, is_success: bool) { let call = self.calls.pop().expect("calls should not be empty"); // Accumulate reversible_write_counter if call is success - if self.call_is_success[call.index] { + if is_success { if let Some(caller) = self.calls.last_mut() { caller.reversible_write_counter += call.reversible_write_counter; } diff --git a/bus-mapping/src/evm/opcodes/begin_end_tx.rs b/bus-mapping/src/evm/opcodes/begin_end_tx.rs index 9814ab6c18..ed1dd477d6 100644 --- a/bus-mapping/src/evm/opcodes/begin_end_tx.rs +++ b/bus-mapping/src/evm/opcodes/begin_end_tx.rs @@ -493,7 +493,7 @@ pub fn gen_begin_tx_steps(state: &mut CircuitInputStateRef) -> Result { diff --git a/bus-mapping/src/evm/opcodes/callop.rs b/bus-mapping/src/evm/opcodes/callop.rs index 49edcc2bac..3a7c830a0d 100644 --- a/bus-mapping/src/evm/opcodes/callop.rs +++ b/bus-mapping/src/evm/opcodes/callop.rs @@ -47,8 +47,43 @@ impl Opcode for CallOpcode { state.call_expand_memory(args_offset, args_length, ret_offset, ret_length)?; let tx_id = state.tx_ctx.id(); - let callee_call = state.parse_call(geth_step)?; + let callee_kind = CallKind::try_from(geth_step.op)?; let caller_call = state.call()?.clone(); + // we need those information but we haven't parse callee's call yet + let caller_address = match callee_kind { + CallKind::Call | CallKind::CallCode | CallKind::StaticCall => caller_call.address, + CallKind::DelegateCall => caller_call.caller_address, + CallKind::Create | CallKind::Create2 => { + unreachable!("CREATE opcode handled in create.rs") + } + }; + let (found, sender_account) = state.sdb.get_account(&caller_address); + debug_assert!(found); + let caller_balance = sender_account.balance; + let call_value = match callee_kind { + CallKind::Call | CallKind::CallCode => geth_step.stack.nth_last(2)?, + CallKind::DelegateCall => caller_call.value, + CallKind::StaticCall => Word::zero(), + CallKind::Create | CallKind::Create2 => { + unreachable!("CREATE opcode handled in create.rs") + } + }; + // Precheck is OK when depth is in range and caller balance is sufficient. + let is_call_or_callcode = matches!(callee_kind, CallKind::Call | CallKind::CallCode); + let is_precheck_ok = + geth_step.depth < 1025 && (!is_call_or_callcode || caller_balance >= call_value); + + let callee_call = if is_precheck_ok { + state.parse_call(geth_step)? + } else { + // if precheck not ok, the call won't appear in call trace since it never happens + // we need to increase the offset and mannually set the is_success + state.tx_ctx.call_is_success_offset += 1; + let mut call = state.parse_call_partial(geth_step)?; + call.is_success = false; + call.is_persistent = false; + call + }; // For both CALLCODE and DELEGATECALL opcodes, `call.address` is caller // address which is different from callee_address (code address). @@ -146,17 +181,6 @@ impl Opcode for CallOpcode { state.call_context_write(&mut exec_step, callee_call.call_id, field, value)?; } - let (found, sender_account) = state.sdb.get_account(&callee_call.caller_address); - debug_assert!(found); - - let caller_balance = sender_account.balance; - let is_call_or_callcode = - callee_call.kind == CallKind::Call || callee_call.kind == CallKind::CallCode; - - // Precheck is OK when depth is in range and caller balance is sufficient. - let is_precheck_ok = - geth_step.depth < 1025 && (!is_call_or_callcode || caller_balance >= callee_call.value); - // read balance of caller to compare to value for insufficient_balance checking // in circuit, also use for callcode successful case check balance is // indeed larger than transfer value. for call opcode, it does in @@ -469,11 +493,8 @@ impl Opcode for CallOpcode { callee_gas_left_with_stipend, ); - let mut oog_step = ErrorOOGPrecompile::gen_associated_ops( - state, - &geth_steps[1], - callee_call.clone(), - )?; + let mut oog_step = + ErrorOOGPrecompile::gen_associated_ops(state, &geth_steps[1], callee_call)?; oog_step.gas_left = Gas(callee_gas_left_with_stipend); oog_step.gas_cost = GasCost(precompile_call_gas_cost); @@ -486,7 +507,7 @@ impl Opcode for CallOpcode { let mut precompile_step = precompile_associated_ops( state, geth_steps[1].clone(), - callee_call.clone(), + callee_call, precompile_call, &input_bytes.unwrap_or_default(), &output_bytes.unwrap_or_default(), diff --git a/bus-mapping/src/evm/opcodes/create.rs b/bus-mapping/src/evm/opcodes/create.rs index 58d65313cd..e8f1b56bd1 100644 --- a/bus-mapping/src/evm/opcodes/create.rs +++ b/bus-mapping/src/evm/opcodes/create.rs @@ -28,8 +28,40 @@ impl Opcode for Create { let mut exec_step = state.new_step(geth_step)?; let tx_id = state.tx_ctx.id(); - let callee = state.parse_call(geth_step)?; let caller = state.call()?.clone(); + let address = if IS_CREATE2 { + state.create2_address(&geth_steps[0])? + } else { + state.create_address()? + }; + let callee_account = &state.sdb.get_account(&address).1.clone(); + let callee_exists = !callee_account.is_empty(); + let callee_value = geth_step.stack.last()?; + if !callee_exists && callee_value.is_zero() { + state.sdb.get_account_mut(&address).1.storage.clear(); + } + + let is_address_collision = callee_account.code_hash != CodeDB::empty_code_hash() + || callee_account.nonce > Word::zero(); + // Get caller's balance and nonce + let caller_balance = state.sdb.get_balance(&caller.address); + let caller_nonce = state.sdb.get_nonce(&caller.address); + // Check if an error of ErrDepth, ErrInsufficientBalance or + // ErrNonceUintOverflow occurred. + let depth = caller.depth; + let is_precheck_ok = + depth < 1025 && caller_balance >= callee_value && caller_nonce < u64::MAX; + let callee = if is_precheck_ok && !is_address_collision { + state.parse_call(geth_step)? + } else { + // if precheck not ok, the call won't appear in call trace since it never happens + // we need to increase the offset and mannually set the is_success + state.tx_ctx.call_is_success_offset += 1; + let mut call = state.parse_call_partial(geth_step)?; + call.is_success = false; + call.is_persistent = false; + call + }; state.call_context_read( &mut exec_step, @@ -84,14 +116,6 @@ impl Opcode for Create { state.create_address()? }; - let callee_account = &state.sdb.get_account(&address).1.clone(); - let callee_exists = !callee_account.is_empty(); - let is_address_collision = callee_account.code_hash != CodeDB::empty_code_hash() - || callee_account.nonce > Word::zero(); - if !callee_exists && callee.value.is_zero() { - state.sdb.get_account_mut(&address).1.storage.clear(); - } - state.stack_write( &mut exec_step, geth_step.stack.nth_last_filled(n_pop - 1), @@ -103,10 +127,6 @@ impl Opcode for Create { )?; // stack end - // Get caller's balance and nonce - let caller_balance = state.sdb.get_balance(&caller.address); - let caller_nonce = state.sdb.get_nonce(&caller.address); - state.call_context_read( &mut exec_step, caller.call_id, @@ -128,10 +148,6 @@ impl Opcode for Create { caller_nonce.into(), )?; - // Check if an error of ErrDepth, ErrInsufficientBalance or - // ErrNonceUintOverflow occurred. - let is_precheck_ok = - depth < 1025 && caller_balance >= callee.value && caller_nonce < u64::MAX; if is_precheck_ok { // Increase caller's nonce state.push_op_reversible( diff --git a/bus-mapping/src/lib.rs b/bus-mapping/src/lib.rs index 1dc6b4b265..d9e6e57866 100644 --- a/bus-mapping/src/lib.rs +++ b/bus-mapping/src/lib.rs @@ -137,14 +137,6 @@ //! .unwrap(); //! //! let geth_steps: Vec = serde_json::from_str(input_trace).unwrap(); -//! let geth_trace = GethExecTrace { -//! account_after: Vec::new(), -//! l1_fee: 0, -//! return_value: "".to_string(), -//! gas: Gas(block.eth_block.transactions[0].gas.as_u64()), -//! failed: false, -//! struct_logs: geth_steps, -//! }; //! //! // Get an ordered vector with all of the Stack operations of this trace. //! let stack_ops = builder.block.container.sorted_stack(); diff --git a/bus-mapping/src/mock.rs b/bus-mapping/src/mock.rs index 6239d7f836..fb5147f262 100644 --- a/bus-mapping/src/mock.rs +++ b/bus-mapping/src/mock.rs @@ -1,9 +1,7 @@ //! Mock types and functions to generate mock data useful for tests use crate::{ - circuit_input_builder::{ - get_state_accesses, AccessSet, Block, BlockHead, CircuitInputBuilder, CircuitsParams, - }, + circuit_input_builder::{AccessSet, Block, BlockHead, CircuitInputBuilder, CircuitsParams}, state_db::{self, CodeDB, StateDB}, }; use eth_types::{geth_types::GethData, ToWord, Word, H256}; @@ -57,9 +55,7 @@ impl BlockData { let mut sdb = StateDB::new(); let mut code_db = CodeDB::new(); - let access_set: AccessSet = - get_state_accesses(&geth_data.eth_block, &geth_data.geth_traces) - .expect("state accesses"); + let access_set: AccessSet = AccessSet::from_geth_data(&geth_data); // Initialize all accesses accounts to zero for addr in access_set.state.keys() { sdb.set_account(addr, state_db::Account::zero()); diff --git a/bus-mapping/src/rpc.rs b/bus-mapping/src/rpc.rs index 7525671829..4b6b5af489 100644 --- a/bus-mapping/src/rpc.rs +++ b/bus-mapping/src/rpc.rs @@ -9,6 +9,7 @@ use eth_types::{ pub use ethers_core::types::BlockNumber; use ethers_providers::JsonRpcClient; use serde::Serialize; +use serde_json::json; use std::collections::HashMap; use crate::util::GETH_TRACE_CHECK_LEVEL; @@ -22,6 +23,18 @@ pub fn serialize(t: &T) -> serde_json::Value { serde_json::to_value(t).expect("Types never fail to serialize.") } +fn merge_json_object(a: &mut serde_json::Value, b: serde_json::Value) { + if let serde_json::Value::Object(a) = a { + if let serde_json::Value::Object(b) = b { + for (k, v) in b { + merge_json_object(a.entry(k.clone()).or_insert(serde_json::Value::Null), v); + } + return; + } + } + *a = b; +} + #[derive(Serialize)] #[doc(hidden)] pub(crate) struct GethLoggerConfig { @@ -45,9 +58,10 @@ pub(crate) struct GethLoggerConfig { impl Default for GethLoggerConfig { fn default() -> Self { Self { - enable_memory: cfg!(feature = "enable-memory"), - disable_stack: !cfg!(feature = "enable-stack"), - disable_storage: !cfg!(feature = "enable-storage"), + enable_memory: cfg!(feature = "enable-memory") && GETH_TRACE_CHECK_LEVEL.should_check(), + disable_stack: !cfg!(feature = "enable-stack") && GETH_TRACE_CHECK_LEVEL.should_check(), + disable_storage: !cfg!(feature = "enable-storage") + && GETH_TRACE_CHECK_LEVEL.should_check(), enable_return_data: true, timeout: None, } @@ -145,26 +159,83 @@ impl GethClient

{ timeout: Some("300s".to_string()), ..Default::default() }); - let resp: ResultGethExecTraces = self + let mut struct_logs: Vec = self .0 - .request("debug_traceBlockByNumber", [num, cfg]) + .request("debug_traceBlockByNumber", [num.clone(), cfg]) .await .map_err(|e| Error::JSONRpcError(e.into()))?; + let mux_trace: Vec = self + .0 + .request( + "debug_traceBlockByNumber", + [ + num, + json!({ + "tracer": "muxTracer", + "tracerConfig": { + "callTracer": {}, + "prestateTracer": {} + } + }), + ], + ) + .await + .map_err(|e| Error::JSONRpcError(e.into()))?; + + for (struct_log, mux) in struct_logs.iter_mut().zip(mux_trace.into_iter()) { + merge_json_object( + struct_log, + json!({ + "result": { + "prestate": mux["result"]["prestateTracer"], + "callTrace": mux["result"]["callTracer"], + } + }), + ); + } + + let resp: ResultGethExecTraces = + serde_json::from_value(serde_json::Value::Array(struct_logs)) + .map_err(|e| Error::JSONRpcError(e.into()))?; + Ok(resp.0.into_iter().map(|step| step.result).collect()) } /// .. pub async fn trace_tx_by_hash(&self, hash: H256) -> Result { let hash = serialize(&hash); - let cfg = GethLoggerConfig { - enable_memory: cfg!(feature = "enable-memory") && GETH_TRACE_CHECK_LEVEL.should_check(), - ..Default::default() - }; + let cfg = GethLoggerConfig::default(); let cfg = serialize(&cfg); - let resp: GethExecTrace = self + let mut struct_logs: serde_json::Value = self .0 - .request("debug_traceTransaction", [hash, cfg]) + .request("debug_traceTransaction", [hash.clone(), cfg]) + .await + .map_err(|e| Error::JSONRpcError(e.into()))?; + let mux_trace: serde_json::Value = self + .0 + .request( + "debug_traceTransaction", + [ + hash, + json!({ + "tracer": "muxTracer", + "tracerConfig": { + "callTracer": {}, + "prestateTracer": {} + } + }), + ], + ) .await .map_err(|e| Error::JSONRpcError(e.into()))?; + merge_json_object( + &mut struct_logs, + json!({ + "prestate": mux_trace["prestateTracer"], + "callTrace": mux_trace["callTracer"], + }), + ); + let resp = + serde_json::from_value(struct_logs).map_err(|e| Error::JSONRpcError(e.into()))?; Ok(resp) } diff --git a/eth-types/src/l2_types.rs b/eth-types/src/l2_types.rs index 9730834b29..b5f7861f51 100644 --- a/eth-types/src/l2_types.rs +++ b/eth-types/src/l2_types.rs @@ -2,7 +2,8 @@ use crate::{ evm_types::{Gas, GasCost, OpcodeId, ProgramCounter}, - Block, GethExecError, GethExecStep, GethExecTrace, Hash, Transaction, Word, H256, + Block, GethCallTrace, GethExecError, GethExecStep, GethExecTrace, GethPrestateTrace, Hash, + Transaction, Word, H256, }; use ethers_core::types::{Address, Bytes, U256, U64}; use serde::{Deserialize, Serialize}; @@ -204,6 +205,11 @@ pub struct ExecutionResult { #[serde(rename = "structLogs")] /// Exec steps pub exec_steps: Vec, + /// callTrace + #[serde(rename = "callTrace")] + pub call_trace: GethCallTrace, + /// prestate + pub prestate: HashMap, } impl From for GethExecTrace { @@ -216,6 +222,8 @@ impl From for GethExecTrace { return_value: e.return_value, struct_logs, account_after: e.account_after, + prestate: e.prestate, + call_trace: e.call_trace, } } } diff --git a/eth-types/src/lib.rs b/eth-types/src/lib.rs index e36841355c..e2dd90b439 100644 --- a/eth-types/src/lib.rs +++ b/eth-types/src/lib.rs @@ -702,6 +702,11 @@ pub struct GethExecTrace { /// List of accounts' (coinbase etc) status AFTER execution /// Only viable for scroll mode pub account_after: Vec, + /// prestate trace + pub prestate: HashMap, + /// call trace + #[serde(rename = "callTrace")] + pub call_trace: GethCallTrace, } fn parse_account_after<'de, D>(d: D) -> Result, D::Error> @@ -737,6 +742,36 @@ pub struct GethPrestateTrace { pub storage: Option>, } +/// The call trace returned by geth RPC debug_trace* methods. +/// using callTracer +#[derive(Deserialize, Serialize, Clone, Debug, Eq, PartialEq)] +pub struct GethCallTrace { + #[serde(default)] + calls: Vec, + error: Option, + // from: Address, + // gas: U256, + // #[serde(rename = "gasUsed")] + // gas_used: U256, + // input: Bytes, + // output: Bytes, + // to: Option

, + #[serde(rename = "type")] + call_type: String, + // value: U256, +} + +impl GethCallTrace { + /// generate the call_is_success vec + pub fn gen_call_is_success(&self, mut call_is_success: Vec) -> Vec { + call_is_success.push(self.error.is_none()); + for call in &self.calls { + call_is_success = call.gen_call_is_success(call_is_success); + } + call_is_success + } +} + #[macro_export] /// Create an [`Address`] from a hex string. Panics on invalid input. macro_rules! address { @@ -850,7 +885,13 @@ mod tests { "00000000000000000000000000000000000000000000003635c9adc5dea00000" ] } - ] + ], + "prestate": {}, + "callTrace": { + "calls": [], + "error": null, + "type": "CALL" + } } "#; let trace: GethExecTrace = @@ -933,6 +974,12 @@ mod tests { ]), } ], + prestate: HashMap::new(), + call_trace: GethCallTrace { + calls: Vec::new(), + error: None, + call_type: "CALL".to_string(), + } } ); } diff --git a/external-tracer/Cargo.toml b/external-tracer/Cargo.toml index e2ccd77bba..63a4b95602 100644 --- a/external-tracer/Cargo.toml +++ b/external-tracer/Cargo.toml @@ -8,7 +8,8 @@ license.workspace = true eth-types = { path = "../eth-types" } geth-utils = { path = "../geth-utils" } serde.workspace = true -serde_json.workspace = true +serde_json = { workspace = true, features = ["unbounded_depth"] } +serde_stacker.workspace = true log.workspace = true [features] diff --git a/external-tracer/src/lib.rs b/external-tracer/src/lib.rs index a397580248..0ab92d5ff4 100644 --- a/external-tracer/src/lib.rs +++ b/external-tracer/src/lib.rs @@ -109,8 +109,10 @@ pub fn trace(config: &TraceConfig) -> Result, Error> { log::trace!("trace: {}", trace_string); - let trace = serde_json::from_str(&trace_string).map_err(Error::SerdeError)?; - Ok(trace) + let mut deserializer = serde_json::Deserializer::from_str(&trace_string); + deserializer.disable_recursion_limit(); + let deserializer = serde_stacker::Deserializer::new(&mut deserializer); + serde::Deserialize::deserialize(deserializer).map_err(Error::SerdeError) } /// Creates a l2-trace for the specified config @@ -136,7 +138,10 @@ pub fn l2trace(config: &TraceConfig) -> Result { log::trace!("trace: {}", trace_string); - serde_json::from_str(&trace_string).map_err(Error::SerdeError) + let mut deserializer = serde_json::Deserializer::from_str(&trace_string); + deserializer.disable_recursion_limit(); + let deserializer = serde_stacker::Deserializer::new(&mut deserializer); + serde::Deserialize::deserialize(deserializer).map_err(Error::SerdeError) } #[cfg(feature = "scroll")] diff --git a/geth-utils/l1geth/go.mod b/geth-utils/l1geth/go.mod index 1874514d48..0058473c7b 100644 --- a/geth-utils/l1geth/go.mod +++ b/geth-utils/l1geth/go.mod @@ -2,8 +2,24 @@ module main go 1.18 +require github.com/ethereum/go-ethereum v1.13.5 + require ( - github.com/ethereum/go-ethereum v1.11.5 + github.com/bits-and-blooms/bitset v1.11.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/consensys/bavard v0.1.13 // indirect + github.com/consensys/gnark-crypto v0.12.1 // indirect + github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/ethereum/c-kzg-4844 v0.4.0 // indirect + github.com/go-stack/stack v1.8.1 // indirect + github.com/holiman/uint256 v1.2.3 // indirect + github.com/mmcloughlin/addchain v0.4.0 // indirect + github.com/supranational/blst v0.3.11 // indirect + golang.org/x/crypto v0.15.0 // indirect + golang.org/x/sync v0.5.0 // indirect + golang.org/x/sys v0.14.0 // indirect + rsc.io/tmplfunc v0.0.3 // indirect ) // Uncomment for debugging diff --git a/geth-utils/l1geth/go.sum b/geth-utils/l1geth/go.sum index 4659333701..30b11e5b62 100644 --- a/geth-utils/l1geth/go.sum +++ b/geth-utils/l1geth/go.sum @@ -102,12 +102,16 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.11.0 h1:RMyy2mBBShArUAhfVRZJ2xyBO58KCBCtZFShw3umo6k= +github.com/bits-and-blooms/bitset v1.11.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= +github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= +github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= @@ -147,9 +151,12 @@ github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= +github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= github.com/consensys/gnark-crypto v0.9.1-0.20230105202408-1a7a29904a7c/go.mod h1:CkbdF9hbRidRJYMRzmfX8TMOr95I2pYXRHF18MzRrvA= +github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= +github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= @@ -163,6 +170,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/crate-crypto/go-ipa v0.0.0-20220523130400-f11357ae11c7/go.mod h1:gFnFS95y8HstDP6P9pPwzrxOOC5TRDkwbM+ao15ChAI= +github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= +github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= @@ -177,6 +186,8 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= @@ -211,9 +222,13 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= +github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= +github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= github.com/ethereum/go-ethereum v1.11.5 h1:3M1uan+LAUvdn+7wCEFrcMM4LJTeuxDrPTg/f31a5QQ= github.com/ethereum/go-ethereum v1.11.5/go.mod h1:it7x0DWnTDMfVFdXcU6Ti4KEFQynLHVRarcSlPr0HBo= +github.com/ethereum/go-ethereum v1.13.5 h1:U6TCRciCqZRe4FPXmy1sMGxTfuk8P7u2UoinF3VbaFk= +github.com/ethereum/go-ethereum v1.13.5/go.mod h1:yMTu38GSuyxaYzQMViqNmQ1s3cE84abZexQmTgenWk0= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= @@ -602,6 +617,7 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= +github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -798,6 +814,8 @@ github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/supranational/blst v0.3.8-0.20220526154634-513d2456b344/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= +github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tdewolff/minify/v2 v2.12.1/go.mod h1:p5pwbvNs1ghbFED/ZW1towGsnnWwzvM8iz8l0eURi9g= @@ -907,6 +925,8 @@ golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= +golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1053,6 +1073,8 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1157,6 +1179,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1427,4 +1451,5 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= +rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= +rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= \ No newline at end of file diff --git a/geth-utils/l1geth/trace.go b/geth-utils/l1geth/trace.go index d84eaf5335..cc0bcd0e92 100644 --- a/geth-utils/l1geth/trace.go +++ b/geth-utils/l1geth/trace.go @@ -1,6 +1,7 @@ package main import ( + "encoding/json" "fmt" "math/big" @@ -11,7 +12,9 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/eth/tracers" "github.com/ethereum/go-ethereum/eth/tracers/logger" + _ "github.com/ethereum/go-ethereum/eth/tracers/native" "github.com/ethereum/go-ethereum/params" "github.com/imdario/mergo" ) @@ -21,10 +24,12 @@ import ( // while replaying a transaction in debug mode as well as transaction // execution status, the amount of gas used and the return value type ExecutionResult struct { - Gas uint64 `json:"gas"` - Failed bool `json:"failed"` - ReturnValue string `json:"returnValue"` - StructLogs []StructLogRes `json:"structLogs"` + Gas uint64 `json:"gas"` + Failed bool `json:"failed"` + ReturnValue string `json:"returnValue"` + StructLogs []StructLogRes `json:"structLogs"` + Prestate json.RawMessage `json:"prestate"` + CallTrace json.RawMessage `json:"callTrace"` } // StructLogRes stores a structured log emitted by the EVM while replaying a @@ -144,7 +149,6 @@ func Trace(config TraceConfig) ([]*ExecutionResult, error) { DAOForkBlock: big.NewInt(0), DAOForkSupport: true, EIP150Block: big.NewInt(0), - EIP150Hash: common.Hash{}, EIP155Block: big.NewInt(0), EIP158Block: big.NewInt(0), ByzantiumBlock: big.NewInt(0), @@ -238,8 +242,22 @@ func Trace(config TraceConfig) ([]*ExecutionResult, error) { // Run the transactions with tracing enabled. executionResults := make([]*ExecutionResult, len(config.Transactions)) for i, message := range messages { - tracer := logger.NewStructLogger(config.LoggerConfig) - evm := vm.NewEVM(blockCtx, core.NewEVMTxContext(&message), stateDB, &chainConfig, vm.Config{Debug: true, Tracer: tracer, NoBaseFee: true}) + txContext := core.NewEVMTxContext(&message) + prestateTracer, err := tracers.DefaultDirectory.New("prestateTracer", new(tracers.Context), nil) + if err != nil { + return nil, fmt.Errorf("Failed to create prestateTracer: %w", err) + } + callTracer, err := tracers.DefaultDirectory.New("callTracer", new(tracers.Context), nil) + if err != nil { + return nil, fmt.Errorf("Failed to create callTracer: %w", err) + } + structLogger := logger.NewStructLogger(config.LoggerConfig) + tracer := NewMuxTracer( + structLogger, + prestateTracer, + callTracer, + ) + evm := vm.NewEVM(blockCtx, txContext, stateDB, &chainConfig, vm.Config{Tracer: tracer, NoBaseFee: true}) result, err := core.ApplyMessage(evm, &message, new(core.GasPool).AddGas(message.GasLimit)) if err != nil { @@ -247,13 +265,81 @@ func Trace(config TraceConfig) ([]*ExecutionResult, error) { } stateDB.Finalise(true) + prestate, err := prestateTracer.GetResult() + if err != nil { + return nil, fmt.Errorf("Failed to get prestateTracer result: %w", err) + } + + callTrace, err := callTracer.GetResult() + if err != nil { + return nil, fmt.Errorf("Failed to get callTracer result: %w", err) + } + executionResults[i] = &ExecutionResult{ Gas: result.UsedGas, Failed: result.Failed(), ReturnValue: fmt.Sprintf("%x", result.ReturnData), - StructLogs: FormatLogs(tracer.StructLogs()), + StructLogs: FormatLogs(structLogger.StructLogs()), + Prestate: prestate, + CallTrace: callTrace, } } return executionResults, nil } + +type MuxTracer struct { + tracers []vm.EVMLogger +} + +func NewMuxTracer(tracers ...vm.EVMLogger) *MuxTracer { + return &MuxTracer{tracers} +} + +func (t *MuxTracer) CaptureTxStart(gasLimit uint64) { + for _, tracer := range t.tracers { + tracer.CaptureTxStart(gasLimit) + } +} + +func (t *MuxTracer) CaptureTxEnd(restGas uint64) { + for _, tracer := range t.tracers { + tracer.CaptureTxEnd(restGas) + } +} + +func (t *MuxTracer) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) { + for _, tracer := range t.tracers { + tracer.CaptureStart(env, from, to, create, input, gas, value) + } +} + +func (t *MuxTracer) CaptureEnd(output []byte, gasUsed uint64, err error) { + for _, tracer := range t.tracers { + tracer.CaptureEnd(output, gasUsed, err) + } +} + +func (t *MuxTracer) CaptureEnter(typ vm.OpCode, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) { + for _, tracer := range t.tracers { + tracer.CaptureEnter(typ, from, to, input, gas, value) + } +} + +func (t *MuxTracer) CaptureExit(output []byte, gasUsed uint64, err error) { + for _, tracer := range t.tracers { + tracer.CaptureExit(output, gasUsed, err) + } +} + +func (t *MuxTracer) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, rData []byte, depth int, err error) { + for _, tracer := range t.tracers { + tracer.CaptureState(pc, op, gas, cost, scope, rData, depth, err) + } +} + +func (t *MuxTracer) CaptureFault(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, depth int, err error) { + for _, tracer := range t.tracers { + tracer.CaptureFault(pc, op, gas, cost, scope, depth, err) + } +} diff --git a/geth-utils/l2geth/go.mod b/geth-utils/l2geth/go.mod index 940bc9bebf..3d6b050992 100644 --- a/geth-utils/l2geth/go.mod +++ b/geth-utils/l2geth/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/imdario/mergo v0.3.16 - github.com/scroll-tech/go-ethereum v1.10.14-0.20231123003536-35313dc92055 + github.com/scroll-tech/go-ethereum v1.10.14-0.20240117040348-01dcf0ea2b48 ) require ( @@ -30,13 +30,13 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/tsdb v0.10.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect - github.com/scroll-tech/zktrie v0.6.0 // indirect + github.com/scroll-tech/zktrie v0.7.1 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect - golang.org/x/crypto v0.14.0 // indirect - golang.org/x/sys v0.13.0 // indirect + golang.org/x/crypto v0.18.0 // indirect + golang.org/x/sys v0.16.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect ) diff --git a/geth-utils/l2geth/go.sum b/geth-utils/l2geth/go.sum index db169fed7f..ef90b140bc 100644 --- a/geth-utils/l2geth/go.sum +++ b/geth-utils/l2geth/go.sum @@ -137,10 +137,18 @@ github.com/scroll-tech/go-ethereum v1.10.14-0.20230901060443-e1eebd17067c h1:GuA github.com/scroll-tech/go-ethereum v1.10.14-0.20230901060443-e1eebd17067c/go.mod h1:DiN3p2inoXOxGffxSswDKqWjQ7bU+Mp0c9v0XQXKmaA= github.com/scroll-tech/go-ethereum v1.10.14-0.20230919024151-fa0be69a3fb9 h1:QiqH+ZGNNzMcKy21VGX6XYg81DXE+/9j1Ik7owm13hs= github.com/scroll-tech/go-ethereum v1.10.14-0.20230919024151-fa0be69a3fb9/go.mod h1:DiN3p2inoXOxGffxSswDKqWjQ7bU+Mp0c9v0XQXKmaA= -github.com/scroll-tech/go-ethereum v1.10.14-0.20231123003536-35313dc92055 h1:7dGW0GxAu5y+8SlXc4LtuoWXxbV5de3vDjN2qz2oO+k= -github.com/scroll-tech/go-ethereum v1.10.14-0.20231123003536-35313dc92055/go.mod h1:4HrFcoStbViFVy/9l/rvKl1XmizVAaPdgqI8v0U8hOc= +github.com/scroll-tech/go-ethereum v1.10.14-0.20231127055938-52511afb103f h1:rWae0zTgyQg41TnbUl1u8QC5VDfN8FA4WTMn7UTkUKo= +github.com/scroll-tech/go-ethereum v1.10.14-0.20231127055938-52511afb103f/go.mod h1:4HrFcoStbViFVy/9l/rvKl1XmizVAaPdgqI8v0U8hOc= +github.com/scroll-tech/go-ethereum v1.10.14-0.20231127063850-acaa268ff676 h1:/xCHeje6y3nv+cn4Qsm24fwOGT3VLOfzdsPe6/bK4SY= +github.com/scroll-tech/go-ethereum v1.10.14-0.20231127063850-acaa268ff676/go.mod h1:4HrFcoStbViFVy/9l/rvKl1XmizVAaPdgqI8v0U8hOc= +github.com/scroll-tech/go-ethereum v1.10.14-0.20240115085500-c2d3130e51bc h1:w0XnA5Fw6AkvSjnAGTC0jk9QZ4+izqT5IJ2DQwHfehs= +github.com/scroll-tech/go-ethereum v1.10.14-0.20240115085500-c2d3130e51bc/go.mod h1:DsirsE0wBU56OTnZUGg4PYs+uXLeO2EXzd8FZFoWteo= +github.com/scroll-tech/go-ethereum v1.10.14-0.20240117040348-01dcf0ea2b48 h1:YaIDfl8pgvfnwH/NauZS6Tz/EDUbuIsnspxwXKdcutA= +github.com/scroll-tech/go-ethereum v1.10.14-0.20240117040348-01dcf0ea2b48/go.mod h1:DsirsE0wBU56OTnZUGg4PYs+uXLeO2EXzd8FZFoWteo= github.com/scroll-tech/zktrie v0.6.0 h1:xLrMAO31Yo2BiPg1jtYKzcjpEFnXy8acbB7iIsyshPs= github.com/scroll-tech/zktrie v0.6.0/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk= +github.com/scroll-tech/zktrie v0.7.1 h1:NrmZNjuBzsbrKePqdHDG+t2cXnimbtezPAFS0+L9ElE= +github.com/scroll-tech/zktrie v0.7.1/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -169,6 +177,8 @@ golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -179,7 +189,6 @@ golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -211,13 +220,14 @@ golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= diff --git a/geth-utils/l2geth/trace.go b/geth-utils/l2geth/trace.go index 3ba9e307b2..7a034ce8f2 100644 --- a/geth-utils/l2geth/trace.go +++ b/geth-utils/l2geth/trace.go @@ -13,6 +13,7 @@ import ( "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/core/vm" "github.com/scroll-tech/go-ethereum/params" + "github.com/scroll-tech/go-ethereum/rollup/tracing" "github.com/scroll-tech/go-ethereum/trie" ) @@ -232,7 +233,7 @@ func Trace(config TraceConfig) (*types.BlockTrace, error) { return nil, err } - traceEnv := core.CreateTraceEnvHelper( + traceEnv := tracing.CreateTraceEnvHelper( &chainConfig, config.LoggerConfig, blockCtx, diff --git a/go.work.sum b/go.work.sum index 7ec67a9076..7c1856e1ca 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1 +1,291 @@ +github.com/Azure/azure-pipeline-go v0.2.2 h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot6ltoThhY= +github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1 h1:qoVeMsc9/fh/yhxVaA0obYjVH/oI/ihrOoMwsLS9KSA= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0 h1:8q4SaHjFsClSvuVne0ID/5Ka8u3fcIHyqkLjcFpNRHQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0 h1:Px2UA+2RvSSvv+RvJNuUB6n7rs5Wsel4dXLe90Um2n4= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0 h1:gggzg0SUMs6SQbEw+3LoSsYf9YMjkupeAnHMX8O9mmY= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0/go.mod h1:+6KLcKIVgxoBDMqMO/Nvy7bZ9a0nbU3I1DtFQK3YvB4= +github.com/Azure/azure-storage-blob-go v0.7.0 h1:MuueVOYkufCxJw5YZzF842DY2MBsp+hLuh2apKY0mck= +github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= +github.com/Azure/go-autorest/autorest/adal v0.9.23 h1:Yepx8CvFxwNKpH6ja7RZ+sKX+DWYNldbLiALMC3BTz8= +github.com/Azure/go-autorest/autorest/adal v0.9.23/go.mod h1:5pcMqFkdPhviJdlEy3kC/v1ZLnQl0MH6XA5YCcMhy4c= +github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= +github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= +github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= +github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY= +github.com/aws/aws-sdk-go-v2 v1.2.0 h1:BS+UYpbsElC82gB+2E2jiCBg36i8HlubTB/dO/moQ9c= +github.com/aws/aws-sdk-go-v2 v1.21.2 h1:+LXZ0sgo8quN9UOKXXzAWRT3FWd4NxeXWOZom9pE7GA= +github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= +github.com/aws/aws-sdk-go-v2/config v1.1.1 h1:ZAoq32boMzcaTW9bcUacBswAmHTbvlvDJICgHFZuECo= +github.com/aws/aws-sdk-go-v2/config v1.18.45 h1:Aka9bI7n8ysuwPeFdm77nfbyHCAKQ3z9ghB3S/38zes= +github.com/aws/aws-sdk-go-v2/config v1.18.45/go.mod h1:ZwDUgFnQgsazQTnWfeLWk5GjeqTQTL8lMkoE1UXzxdE= +github.com/aws/aws-sdk-go-v2/credentials v1.1.1 h1:NbvWIM1Mx6sNPTxowHgS2ewXCRp+NGTzUYb/96FZJbY= +github.com/aws/aws-sdk-go-v2/credentials v1.13.43 h1:LU8vo40zBlo3R7bAvBVy/ku4nxGEyZe9N8MqAeFTzF8= +github.com/aws/aws-sdk-go-v2/credentials v1.13.43/go.mod h1:zWJBz1Yf1ZtX5NGax9ZdNjhhI4rgjfgsyk6vTY1yfVg= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2 h1:EtEU7WRaWliitZh2nmuxEXrN0Cb8EgPUFGIoTMeqbzI= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 h1:PIktER+hwIG286DqXyvVENjgLTAwGgoeriLDD5C+YlQ= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13/go.mod h1:f/Ib/qYjhV2/qdsf79H3QP/eRE4AkVyEf6sk7XfZ1tg= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 h1:nFBQlGtkbPzp/NjZLuFxRqmT91rLJkgvsEQs68h962Y= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43/go.mod h1:auo+PiyLl0n1l8A0e8RIeR8tOzYPfZZH/JNlrJ8igTQ= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 h1:JRVhO25+r3ar2mKGP7E0LDl8K9/G36gjlqca5iQbaqc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37/go.mod h1:Qe+2KtKml+FEsQF/DHmDV+xjtche/hwoF75EG4UlHW8= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 h1:hze8YsjSh8Wl1rYa1CJpRmXP21BvOBuc76YhW0HsuQ4= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45/go.mod h1:lD5M20o09/LCuQ2mE62Mb/iSdSlCNuj6H5ci7tW7OsE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2 h1:4AH9fFjUlVktQMznF+YN33aWNXaR4VgDXyP28qokJC0= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 h1:WWZA/I2K4ptBS1kg0kV1JbBtG/umed0vwHRrmcr9z7k= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37/go.mod h1:vBmDnwWXWxNPFRMmG2m/3MKOe+xEcMDo1tanpaWCcck= +github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1 h1:cKr6St+CtC3/dl/rEBJvlk7A/IN5D5F02GNkGzfbtVU= +github.com/aws/aws-sdk-go-v2/service/route53 v1.30.2 h1:/RPQNjh1sDIezpXaFIkZb7MlXnSyAqjVdAwcJuGYTqg= +github.com/aws/aws-sdk-go-v2/service/route53 v1.30.2/go.mod h1:TQZBt/WaQy+zTHoW++rnl8JBrmZ0VO6EUbVua1+foCA= +github.com/aws/aws-sdk-go-v2/service/sso v1.1.1 h1:37QubsarExl5ZuCBlnRP+7l1tNwZPBSTqpTBrPH98RU= +github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 h1:JuPGc7IkOP4AaqcZSIcyqLpFSqBWK32rM9+a1g6u73k= +github.com/aws/aws-sdk-go-v2/service/sso v1.15.2/go.mod h1:gsL4keucRCgW+xA85ALBpRFfdSLH4kHOVSnLMSuBECo= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 h1:HFiiRkf1SdaAmV3/BHOFZ9DjFynPHj8G/UIO1lQS+fk= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3/go.mod h1:a7bHA82fyUXOm+ZSWKU6PIoBxrjSprdLoM8xPYvzYVg= +github.com/aws/aws-sdk-go-v2/service/sts v1.1.1 h1:TJoIfnIFubCX0ACVeJ0w46HEH5MwjwYN4iFhuYIhfIY= +github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 h1:0BkLfgeDjfZnZ+MhB3ONb01u9pwFYTCZVhlsSSBvlbU= +github.com/aws/aws-sdk-go-v2/service/sts v1.23.2/go.mod h1:Eows6e1uQEsc4ZaHANmsPRzAKcVDrcmjjWiih2+HUUQ= +github.com/aws/smithy-go v1.1.0 h1:D6CSsM3gdxaGaqXnPgOBCeL6Mophqzu7KJOu7zW78sU= +github.com/aws/smithy-go v1.15.0 h1:PS/durmlzvAFpQHDs4wi4sNNP9ExsqZh6IlfdHXgKK8= +github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= +github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo= +github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng= +github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw= +github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd h1:qdGvebPBDuYDPGi1WCPjy1tGyMpmDK8IEapSsszn7HE= +github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723 h1:ZA/jbKoGcVAnER6pCHPEkGdZOV7U1oLUedErBHCUMs0= +github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3SkEwmHoWBmX1DNXhXZqlTpq6s4tyJGc= +github.com/btcsuite/winsvc v1.0.0 h1:J9B4L7e3oqhXOcm+2IuNApwzQec85lE+QaikUcCs+dk= +github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= +github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= +github.com/cloudflare/cloudflare-go v0.14.0 h1:gFqGlGl/5f9UGXAaKapCGUfaTCgRKKnzu2VvzMZlOFA= +github.com/cloudflare/cloudflare-go v0.79.0 h1:ErwCYDjFCYppDJlDJ/5WhsSmzegAUe2+K9qgFyQDg3M= +github.com/cloudflare/cloudflare-go v0.79.0/go.mod h1:gkHQf9xEubaQPEuerBuoinR9P8bf8a05Lq0X6WKy1Oc= +github.com/cockroachdb/errors v1.8.1 h1:A5+txlVZfOqFBDa4mGz2bUWSp0aHElvHX2bKkdbQu+Y= +github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY= +github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 h1:aPEJyR4rPBvDmeyi+l/FS/VtA00IWvjeFvjen1m1l1A= +github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= +github.com/cockroachdb/redact v1.0.8 h1:8QG/764wK+vmEYoOlfobpe12EQcS81ukx/a4hdVMxNw= +github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 h1:IKgmqgMQlVJIZj19CdocBeSfSaiCbEBZGKODaixqtHM= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= +github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f h1:C43yEtQ6NIf4ftFXD/V55gnGFgPbMQobd//YlnLjUJ8= +github.com/consensys/gnark-crypto v0.9.1-0.20230105202408-1a7a29904a7c h1:llSLg4o9EgH3SrXky+Q5BqEYqV76NGKo07K5Ps2pIKo= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/crate-crypto/go-ipa v0.0.0-20220523130400-f11357ae11c7 h1:6IrxszG5G+O7zhtkWxq6+unVvnrm1fqV2Pe+T95DUzw= +github.com/crate-crypto/go-ipa v0.0.0-20230601170251-1830d0757c80 h1:DuBDHVjgGMPki7bAyh91+3cF1Vh34sAEdH8JQgbc2R0= +github.com/crate-crypto/go-ipa v0.0.0-20230601170251-1830d0757c80/go.mod h1:gzbVz57IDJgQ9rLQwfSk696JGWof8ftznEL9GoAv3NI= +github.com/dchest/blake512 v1.0.0 h1:oDFEQFIqFSeuA34xLtXZ/rWxCXdSjirjzPhey5EUvmA= +github.com/dchest/blake512 v1.0.0/go.mod h1:FV1x7xPPLWukZlpDpWQ88rF/SFwZ5qbskrzhLMB92JI= +github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/deepmap/oapi-codegen v1.8.2 h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbzjuhfU= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954 h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4= +github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91 h1:Izz0+t1Z5nI16/II7vuEo/nHjodOg0p7+OiDpjX5t1E= +github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo= +github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf h1:sh8rkQZavChcmakYiSlqu2425CHyFXLZZnvm7PDpU8M= +github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v1.6.2 h1:HlFGsy+9/xrgMmhmN+NGhCc5SHGJ7I+kHosRR1xc/aI= +github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48 h1:iZOop7pqsg+56twTopWgwCGxdB5SI2yDO8Ti7eTRliQ= +github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja v0.0.0-20230122112309-96b1610dd4f7 h1:kgvzE5wLsLa7XKfV85VZl40QXaMCaeFtHpPwJ8fhotY= +github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127 h1:qwcF+vdFrvPSEUDSX5RVoRccG8a5DhOdWdQ4zN62zzo= +github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4= +github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c h1:CndMRAH4JIwxbW8KYq6Q+cGWcGHz0FjGR3QqcInWcW0= +github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e h1:bBLctRc7kr01YGvaDfgLbTwjFNW5jdp5y5rj8XXBHfY= +github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= +github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= +github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 h1:IZqZOB2fydHte3kUgxrzK5E1fW7RQGeDwE8F/ZZnUYc= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= +github.com/gballet/go-verkle v0.0.0-20220902153445-097bd83b7732 h1:AB7YjNrzlVHsYz06zCULVV2zYCEft82P86dSmtwxKL0= +github.com/gballet/go-verkle v0.0.0-20230607174250-df487255f46b h1:vMT47RYsrftsHSTQhqXwC3BYflo38OLC3Y4LtXtLyU0= +github.com/gballet/go-verkle v0.0.0-20230607174250-df487255f46b/go.mod h1:CDncRYVRSDqwakm282WEkjfaAj1hxU/v5RXxk5nXOiI= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= +github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= +github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa h1:Q75Upo5UN4JbPFURXZ8nLKYUvF85dyFRop/vQ0Rv+64= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= +github.com/google/pprof v0.0.0-20230207041349-798e818bf904 h1:4/hN5RUoecvl+RmJRE2YxKWtnnQls6rQjjW5oV7qg2U= +github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= +github.com/google/subcommands v1.2.0 h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE= +github.com/google/uuid v1.1.5 h1:kxhtnfFVi+rYdOALN0B3k9UT86zVJKfBimRaciULW4I= +github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/gotestyourself/gotestyourself v1.4.0 h1:CDSlSIuRL/Fsc72Ln5lMybtrCvSRDddsHsDRG/nP7Rg= +github.com/gotestyourself/gotestyourself v1.4.0/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= +github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29 h1:sezaKhEfPFg8W0Enm61B9Gs911H8iesGY5R8NDPtd1M= +github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= +github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY41SORZyNJ0= +github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= +github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZKHF9GxxWKDJGj8I0IqOUol//sw= +github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/huin/goupnp v1.0.2 h1:RfGLP+h3mvisuWEyybxNq5Eft3NWhHLPeUN72kpKZoI= +github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= +github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= +github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= +github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 h1:mV02weKRL81bEnm8A0HT1/CAelMQDBuQIfLw8n+d6xI= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/influxdata/influxdb v1.8.3 h1:WEypI1BQFTT4teLM+1qkEcvUi0dAvopAI/ir0vAiBg8= +github.com/influxdata/influxdb-client-go/v2 v2.4.0 h1:HGBfZYStlx3Kqvsv1h2pJixbCl/jhnFtxpKFAv9Tu5k= +github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c h1:qSHzRbhzK8RdXOsAdfDgO49TtqC1oZ+acxPrkfTxcCs= +github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 h1:vilfsDSy7TDxedi9gyBkMvAirat/oRcL0lFdJBf6tdM= +github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 h1:6OvNmYgJyexcZ3pYbTI9jWx5tHo1Dee/tWbLMfPe2TA= +github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= +github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e h1:UvSe12bq+Uj2hWd8aOlwPmoZ+CITRFrdit+sDGfAg8U= +github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 h1:TMtDYDHKYY15rFihtRfck/bfFqNfvcabqvXAFQfAUpY= +github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267/go.mod h1:h1nSAbGFqGVzn6Jyl1R/iCcBUHN4g+gW1u9CoBTrb9E= +github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89 h1:12K8AlpT0/6QUXSfV0yi4Q0jkbq8NDtIKFtF61AoqV0= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI= +github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= +github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g= +github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= +github.com/karalabe/usb v0.0.0-20211005121534-4c5740d64559 h1:0VWDXPNE0brOek1Q8bLfzKkvOzwbQE/snjGojlCr8CY= +github.com/karalabe/usb v0.0.0-20211005121534-4c5740d64559/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/karalabe/usb v0.0.2 h1:M6QQBNxF+CQ8OFvxrT90BA0qBOXymndZnk5q235mFc4= +github.com/kilic/bls12-381 v0.1.0 h1:encrdjqKMEvabVQ7qYOKu1OvhqpK4s47wDYtNiPtlp4= +github.com/kilic/bls12-381 v0.1.0/go.mod h1:vDTTHJONJ6G+P2R74EhnyotQDTliQDnFEwhdmfzw1ig= +github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 h1:FOOIBWrEkLgmlgGfMuZT83xIwfPDxEI2OHu6xUmJMFE= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d h1:oNAwILwmgWKFpuU+dXvI6dl9jG2mAWAZLX3r9s0PPiw= +github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= +github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= +github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= +github.com/mmcloughlin/profile v0.1.1 h1:jhDmAqPyebOsVDOCICJoINoLb/AnLBaUw58nFzxWS2w= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 h1:F9x/1yl3T2AeKLr2AMdilSD8+f9bvMnNN8VS5iDtovc= +github.com/naoina/go-stringutil v0.1.0 h1:rCUeRUHjBjGTSHl0VC00jUPLz8/F9dDzYI70Hzifhks= +github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416 h1:shk/vn9oCoOTmwcouEdwIeOtOGA/ELRUw/GwvxwfT+0= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= +github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= +github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= +github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 h1:oYW+YCJ1pachXTQmzR3rNLYGGz4g/UgFcjb28p/viDM= +github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM= +github.com/prometheus/client_golang v1.12.0 h1:C+UIj/QWtmqY13Arb8kwMt5j34/0Z2iKamrJ+ryC0Gg= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= +github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a h1:CmF68hwI0XsOQ5UwlBopMi2Ow4Pbg32akc4KIVCOm+Y= +github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/protolambda/bls12-381-util v0.0.0-20220416220906-d8552aa452c7 h1:cZC+usqsYgHtlBaGulVnZ1hfKAi8iWtujBnRLQE698c= +github.com/protolambda/bls12-381-util v0.0.0-20220416220906-d8552aa452c7/go.mod h1:IToEjHuttnUzwZI5KBSM/LOOW3qLbbrHOEfp3SbECGY= +github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE= +github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/scroll-tech/go-ethereum v1.10.14-0.20231108100028-cb76ecd42bf7 h1:xDtuJk3CjD46kHw87Xe9o/1PcvTVgNZYoT2vGgRmO5s= +github.com/scroll-tech/go-ethereum v1.10.14-0.20231108100028-cb76ecd42bf7/go.mod h1:4HrFcoStbViFVy/9l/rvKl1XmizVAaPdgqI8v0U8hOc= +github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= +github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg= +github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= +github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/supranational/blst v0.3.8-0.20220526154634-513d2456b344 h1:m+8fKfQwCAy1QjzINvKe/pYtLjo2dl59x2w9YSEJxuY= +github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef h1:wHSqTBrZW24CsNJDfeh9Ex6Pm0Rcpc7qrgKBiL44vF4= +github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= +github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa h1:5SqCsI/2Qya2bCzK15ozrqo2sZxkh0FHynJZOTVoV6Q= +github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= +github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= +github.com/yuin/goldmark v1.2.1 h1:ruQGxdhGHe7FWOJPT0mKs5+pD2Xs1Bm/kdGlHO04FmM= +github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= +go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME= +go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= +golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos= +golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= +golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= +golang.org/x/time v0.0.0-20220922220347-f3bd1da661af h1:Yx9k8YCG3dvF87UAn2tu2HQLf2dt/eR1bXxpLMWeH+Y= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e h1:4nW4NLDYnU28ojHaHO8OVxFHk/aQ33U01a9cjED+pzE= +golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 h1:a6cXbcDDUkSBlpnkWV1bJ+vv3mOgQEltEJ2rPxroVu0= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= +gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= +gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= +gotest.tools v1.4.0 h1:BjtEgfuw8Qyd+jPvQz8CfoxiO/UjFEidWinwEXZiWv0= +gotest.tools v1.4.0/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= diff --git a/integration-tests/tests/circuit_input_builder.rs b/integration-tests/tests/circuit_input_builder.rs index 2ff8cca015..d7acf846ad 100644 --- a/integration-tests/tests/circuit_input_builder.rs +++ b/integration-tests/tests/circuit_input_builder.rs @@ -1,9 +1,7 @@ #![feature(lazy_cell)] #![cfg(feature = "circuit_input_builder")] -use bus_mapping::circuit_input_builder::{ - build_state_code_db, get_state_accesses, BuilderClient, CircuitsParams, -}; +use bus_mapping::circuit_input_builder::{build_state_code_db, BuilderClient, CircuitsParams}; use integration_tests::{get_client, log_init, GenDataOutput}; use log::trace; use std::sync::LazyLock; @@ -37,7 +35,7 @@ async fn test_circuit_input_builder_block(block_num: u64) { cli.get_block(block_num).await.unwrap(); // 2. Get State Accesses from TxExecTraces - let access_set = get_state_accesses(ð_block, &geth_trace).unwrap(); + let access_set = cli.get_state_accesses(ð_block).await.unwrap(); trace!("AccessSet: {:#?}", access_set); // 3. Query geth for all accounts, storage keys, and codes from Accesses diff --git a/prover/Cargo.toml b/prover/Cargo.toml index 1bf513bbb3..845cba878e 100644 --- a/prover/Cargo.toml +++ b/prover/Cargo.toml @@ -33,7 +33,7 @@ rand_xorshift.workspace = true serde.workspace = true serde_derive = "1.0" serde_json = { workspace = true, features = ["unbounded_depth"] } -serde_stacker = "0.1" +serde_stacker.workspace = true sha2 ="0.10.2" [features] diff --git a/zkevm-circuits/src/evm_circuit/execution/error_invalid_opcode.rs b/zkevm-circuits/src/evm_circuit/execution/error_invalid_opcode.rs index af6a9fe98f..9ab8090dd0 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_invalid_opcode.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_invalid_opcode.rs @@ -85,7 +85,7 @@ mod test { &[0xf6], &[0xfe], // Multiple invalid opcodes - &[0x5c, 0x5e], + &[0x0c, 0x5e], ]; #[test]