Skip to content

Commit

Permalink
[USER_OPS_INDEXER] Support geth traces via debug module (#816)
Browse files Browse the repository at this point in the history
* feat: support geth traces via debug module

* feat: debug_traceTransaction config

* fix: add create2

* chore: add flattened order test
  • Loading branch information
k1rill-fedoseev authored Apr 3, 2024
1 parent 9d7cbd4 commit eca113a
Show file tree
Hide file tree
Showing 3 changed files with 207 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
use crate::{
indexer::{common_transport::CommonTransport, settings::IndexerSettings},
indexer::{
common_transport::CommonTransport,
rpc_utils::{CallTracer, TraceType},
settings::IndexerSettings,
},
repository,
types::user_op::UserOp,
};
use anyhow::{anyhow, bail};
use ethers::prelude::{
abi::{AbiEncode, Error},
parse_log,
types::{Action, Address, Bytes, Filter, Log, TransactionReceipt},
types::{Address, Bytes, Filter, Log, TransactionReceipt},
EthEvent, Middleware, Provider, ProviderError, H256,
};
use futures::{
Expand Down Expand Up @@ -307,16 +311,15 @@ impl Indexer {
"tx contains more than one bundle or was sent indirectly, fetching tx trace"
);
self.client
.trace_transaction(tx_hash)
.common_trace_transaction(tx_hash)
.await?
.into_iter()
.filter_map(|t| {
if let Action::Call(cd) = t.action {
if cd.to == L::entry_point() && L::matches_handler_calldata(&cd.input) {
Some(cd.input)
} else {
None
}
if t.typ == TraceType::Call
&& t.to == Some(L::entry_point())
&& L::matches_handler_calldata(&t.input)
{
Some(t.input)
} else {
None
}
Expand Down
1 change: 1 addition & 0 deletions user-ops-indexer/user-ops-indexer-logic/src/indexer/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mod base_indexer;
mod common;
pub mod common_transport;
pub mod rpc_utils;
pub mod settings;
pub mod v06;
pub mod v07;
Expand Down
194 changes: 194 additions & 0 deletions user-ops-indexer/user-ops-indexer-logic/src/indexer/rpc_utils.rs

Large diffs are not rendered by default.

0 comments on commit eca113a

Please sign in to comment.