Skip to content

feat(execution-types): add receipts_iter helper#21162

Merged
mattsse merged 5 commits intomainfrom
feat/exex-log-iterator-helpers
Jan 17, 2026
Merged

feat(execution-types): add receipts_iter helper#21162
mattsse merged 5 commits intomainfrom
feat/exex-log-iterator-helpers

Conversation

@mattsse
Copy link
Collaborator

@mattsse mattsse commented Jan 17, 2026

Adds receipts_iter() method to ExecutionOutcome for ergonomic iteration over receipt slices.

/// Returns an iterator over receipt slices, one per block.
pub fn receipts_iter(&self) -> impl Iterator<Item = &[T]> + '_ {
    self.receipts.iter().map(|v| v.as_slice())
}

This is a more ergonomic alternative to receipts() that yields slices instead of requiring indexing into a nested Vec<Vec<T>>.

mattsse and others added 3 commits January 17, 2026 18:03
This PR reverts #21137 (the reth-chain crate) and adds the useful
LazyTrieData/SortedTrieData types directly to reth-trie-common.

Changes:
- Move Chain back to reth-execution-types
- Move DeferredTrieData back to reth-chain-state
- Remove the reth-chain crate
- Add LazyTrieData and SortedTrieData to reth-trie-common

The new types in reth-trie-common:
- SortedTrieData: Container bundling HashedPostStateSorted + TrieUpdatesSorted
- LazyTrieData: No-std compatible lazy wrapper with ready/deferred modes
…ions

Add ergonomic APIs to Chain and ExecutionOutcome to simplify log processing
in ExEx implementations. These helpers eliminate manual index tracking when
iterating over blocks, receipts, and logs.

New types:
- LogRef: A reference to a log with full block/tx/receipt context
- BlockOutcomeRef: A block paired with its execution outcome data
- LogFilter: Simple filter for address and/or topic0 matching

New Chain methods:
- blocks_with_outcome(): Iterator over blocks with their receipts
- logs_iter(): Flattening iterator over all logs with context
- logs_filtered(): Logs iterator with address/topic0 filtering

New ExecutionOutcome methods:
- receipts_by_index(): Access receipts by 0-indexed position
- block_number_at_index(): Convert index to block number
- receipts_iter(): Iterator over receipt slices

These additions target ExEx developers who currently must manually enumerate
blocks, index into receipt arrays, and track context while iterating logs.

Amp-Thread-ID: https://ampcode.com/threads/T-019bcc16-0a23-7033-bb19-566437952d61
Co-authored-by: Amp <amp@ampcode.com>
@mattsse mattsse force-pushed the feat/exex-log-iterator-helpers branch from 65b5f12 to c9a8471 Compare January 17, 2026 17:04
Copy link
Collaborator Author

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

Copy link
Collaborator Author

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's only keep this and remove the rest

@mattsse mattsse force-pushed the feat/exex-log-iterator-helpers branch from d5d3514 to 99935ff Compare January 17, 2026 18:00
@mattsse mattsse changed the title feat(execution-types): add log iteration helpers for ExEx implementations feat(execution-types): add receipts_iter helper Jan 17, 2026
@mattsse mattsse merged commit f624372 into main Jan 17, 2026
45 checks passed
@mattsse mattsse deleted the feat/exex-log-iterator-helpers branch January 17, 2026 18:20
@github-project-automation github-project-automation bot moved this from Backlog to Done in Reth Tracker Jan 17, 2026
Vui-Chee added a commit to okx/reth that referenced this pull request Jan 20, 2026
* tag 'v1.10.1': (49 commits)
  chore: bump version to 1.10.1 (paradigmxyz#21188)
  chore: rename extend_ref methods on sorted data structures (paradigmxyz#21043)
  fix(flashblocks): Add flashblock ws connection retry period (paradigmxyz#20510)
  chore(bench): add --disable-tx-gossip to benchmark node args (paradigmxyz#21171)
  refactor(stages): reuse history index cache buffers in `collect_history_indices` (paradigmxyz#21017)
  feat(download): resumable snapshot downloads with auto-retry (paradigmxyz#21161)
  ci: update to tempoxyz (paradigmxyz#21176)
  chore: apply spelling and typo fixes (paradigmxyz#21182)
  docs: document minimal storage mode in pruning FAQ (paradigmxyz#21025)
  chore(deps): weekly `cargo update` (paradigmxyz#21167)
  feat(execution-types): add receipts_iter helper (paradigmxyz#21162)
  revert: undo Chain crate, add LazyTrieData to trie-common (paradigmxyz#21155)
  feat(engine): add new_payload_interval metric (start-to-start) (paradigmxyz#21159)
  feat(engine): add time_between_new_payloads metric (paradigmxyz#21158)
  fix(storage-api): gate reth-chain dependency behind std feature
  perf(storage): batch trie updates across blocks in save_blocks (paradigmxyz#21142)
  refactor: use ExecutionOutcome::single instead of tuple From (paradigmxyz#21152)
  chore(chain-state): reorganize deferred_trie.rs impl blocks (paradigmxyz#21151)
  feat(primitives-traits): add try_recover_signers for parallel batch recovery (paradigmxyz#21103)
  perf: make Chain use DeferredTrieData (paradigmxyz#21137)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-exex Execution Extensions

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant