Skip to content

Conversation

@Savid
Copy link
Member

@Savid Savid commented Jan 22, 2026

Introduce abstraction layer for execution nodes to support both RPC-based and embedded usage patterns.

  • Add Node interface defining the contract for execution data providers
  • Add DataSource interface for hosts to provide data directly
  • Add EmbeddedNode implementation that delegates to a DataSource
  • Rename existing implementation to RPCNode
  • Add NewPoolWithNodes() for creating pools with pre-created nodes
  • Update pool to work with Node interface instead of concrete types
  • Replace go-ethereum types (Block, Transaction, Receipt) with abstract interfaces to enable library embedding without CGO.
  • Move geth-specific RPC implementation to pkg/ethereum/execution/geth/ subpackage with build tags, allowing clean separation between embedded and RPC modes.

mattevans and others added 14 commits January 14, 2026 10:15
Introduce CallTracker to assign sequential frame IDs and maintain
call paths during opcode traversal. This enables accurate
identification of which contract call each opcode belongs to,
even when the same contract is called multiple times.

Extend Structlog with CallFrameID and CallFramePath fields to
persist the tracking information alongside each opcode record.

Update extractCallAddress to handle all CALL-type opcodes
(CALL, CALLCODE, DELEGATECALL, STATICCALL) for complete
call target extraction.
feat: detect CREATE/CREATE2 opcodes and fetch contract address from receipt
refactor: replace extractCallAddress with extractCallAddressWithCreate to
handle contract creation addresses
… trace-based computation

- Remove fetchCreateAddress and hasCreateOpcode helpers
- Introduce ComputeCreateAddresses to extract addresses directly from trace
- Update extractCallAddressWithCreate signature to accept index and map
- Rename queue name from "transaction-structlog" to "transaction_structlog"
- Expand test coverage for nested and failed CREATE scenarios
The root frame now starts at depth 1 instead of 0 to match the
actual EVM structlog output, where execution begins at depth 1.
All tests updated to reflect the new depth semantics.
…om child gas

Introduce GasSelf to represent the gas consumed by an opcode *excluding*
any gas spent in child frames. For CALL/CREATE opcodes this yields the
pure call overhead (warm/cold access, memory expansion, value transfer);
for all other opcodes GasSelf equals GasUsed. This allows accurate
aggregation of total execution gas without double counting.

- Add ComputeGasSelf() helper that subtracts the sum of *direct* child
 GasUsed values from each CALL/CREATE opcode’s GasUsed.
- Extend Structlog struct and ClickHouse schema with new GasSelf column.
- Update both ProcessTransaction() and ExtractStructlogs() to populate
 the new field.
- Provide extensive unit tests covering nested, sibling and edge cases.
…odes

test(structlog): add comprehensive format_address tests for 20-byte padding
refactor(structlog): introduce formatAddress to normalize stack values to 42-char addresses
…ic frames

Replace heuristic precompile check with go-ethereum's canonical list to
avoid mis-classifying early EOAs/contracts as precompiles. Tighten the
EOA detection logic to only create synthetic frames when call depth
remains unchanged (depth == nextDepth) instead of the previous
nextDepth <= depth, eliminating phantom frames for failed calls and
out-of-gas scenarios.
Introduce abstraction layer for execution nodes to support both RPC-based
and embedded usage patterns.

- Add Node interface defining the contract for execution data providers
- Add DataSource interface for hosts to provide data directly
- Add EmbeddedNode implementation that delegates to a DataSource
- Rename existing implementation to RPCNode
- Add NewPoolWithNodes() for creating pools with pre-created nodes
- Update pool to work with Node interface instead of concrete types
Replace go-ethereum types (Block, Transaction, Receipt) with abstract
interfaces to enable library embedding without CGO. Move geth-specific
RPC implementation to pkg/ethereum/execution/geth/ subpackage with
build tags, allowing clean separation between embedded and RPC modes.
…ack allocations

Introduce dual-mode processing (RPC vs embedded) in StructLog to reduce
memory pressure. Embedded mode pre-computes GasUsed and CallToAddress
in the tracer, avoiding post-processing passes and stack allocations.

- Add GasUsed and CallToAddress fields to StructLog
- Document operation modes and field semantics
- Extract call address via new helper, supporting both modes
- Add opcode constants and isCallOpcode utility
… for embedded mode

Reduces memory pressure by skipping full stack capture; the tracer
already extracts CallToAddress directly for CALL-family opcodes.
Introduce hasPrecomputedGasUsed() to detect when the tracer already
populates GasUsed (embedded mode). Skip expensive post-processing
computation in that case, falling back to RPC mode calculation only
when needed. This maintains backward compatibility while optimizing
performance for embedded mode traces.
* master:
  fix(ethereum): improve error message for unsupported chain IDs
  refactor(ethereum): change ChainID from int32 to int64 across services and processors
…matty

refactor(structlog): dual-mode processing (RPC vs embedded)
* master:
  fix(ethereum): improve error message for unsupported chain IDs
  refactor(ethereum): change ChainID from int32 to int64 across services and processors
docs: remove trailing whitespace in README
* feat/call-frames:
  refactor: remove unused ParityTrace types and helper from execution package
  chore: accidental commit
  fix(structlog): correct EOA call detection to prevent phantom synthetic frames
  WIP: current changes
  test(structlog): fix and expand address extraction tests for CALL opcodes test(structlog): add comprehensive format_address tests for 20-byte padding refactor(structlog): introduce formatAddress to normalize stack values to 42-char addresses
  feat(structlog): add GasSelf field to isolate CALL/CREATE overhead from child gas
  fix(call_tracker): align root frame depth with EVM traces (depth 1)
  refactor(processor): replace receipt-based CREATE address lookup with trace-based computation
  style(transaction_processing.go): move comment to line above log to match Go style
  test: add unit tests for CREATE/CREATE2 address extraction feat: detect CREATE/CREATE2 opcodes and fetch contract address from receipt refactor: replace extractCallAddress with extractCallAddressWithCreate to handle contract creation addresses
  test: add comprehensive unit tests for extractCallAddress function
  feat(structlog): add call frame tracking to identify EVM call contexts
Eliminates race condition where MarkReady() could fire before
callbacks were registered, causing missed ready events.
…tion

refactor(pool): add debug logging for OnReady callback registration and execution
…rom structlogs in embedded mode instead of skipping post-processing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants