Skip to content

feat(flashblock): Enable eth_getTransactionByHash support for flashblock#19954

Merged
mattsse merged 5 commits intoparadigmxyz:mainfrom
0x00101010:flashblock-get-tx-by-hash
Nov 25, 2025
Merged

feat(flashblock): Enable eth_getTransactionByHash support for flashblock#19954
mattsse merged 5 commits intoparadigmxyz:mainfrom
0x00101010:flashblock-get-tx-by-hash

Conversation

@0x00101010
Copy link
Contributor

@0x00101010 0x00101010 commented Nov 25, 2025

Enable eth_getTransactionByHash support for flashblock, bring it at parity with existing support

OpEthApiError: FromEvmError<N::Evm>,
Rpc: RpcConvert<Primitives = N::Primitives, Error = OpEthApiError>,
{
async fn transaction_by_hash(
Copy link
Contributor Author

@0x00101010 0x00101010 Nov 25, 2025

Choose a reason for hiding this comment

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

Note: Steps 1 and 3 duplicate logic from the default trait implementation rather than extracting to a helper method. This keeps the override self-contained and avoids adding a helper method to the trait API that would only exist to support this one override.

Also we check flashblocks first before checking pool (in case people are using nodes with txpool gossip enabled to serve rpc requests)

async move {
// Try to find the transaction on disk
let mut resp = self
if let Some((tx, meta)) = self
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reworked the function a bit to avoid unnecessary nested loops and improve readability

.cloned();

let meta = indexed_tx.meta();
return Ok(Some(TransactionSource::Block {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did not choose to add a new FlashBlock source type, current Block type seem to represent the situation well

@0x00101010 0x00101010 marked this pull request as ready for review November 25, 2025 01:31
@0x00101010 0x00101010 force-pushed the flashblock-get-tx-by-hash branch from d28b3b1 to de6f424 Compare November 25, 2025 01:41
Copy link
Collaborator

@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.

lgtm, ty

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Nov 25, 2025
@mattsse mattsse added this pull request to the merge queue Nov 25, 2025
Merged via the queue into paradigmxyz:main with commit ba862da Nov 25, 2025
43 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Nov 25, 2025
sieniven pushed a commit to okx/reth that referenced this pull request Dec 10, 2025
…ock (paradigmxyz#19954)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Vui-Chee added a commit to okx/reth that referenced this pull request Dec 11, 2025
* dev:
  chore: Update cargo deps (#65)
  feat(flashblock): Enable eth_getTransactionByHash support for flashblock (paradigmxyz#19954)
  feat(flashblocks): Cache recent flashblocks (paradigmxyz#19786)
  feat(flashblock): improve state root calculation condition (paradigmxyz#19667)
  feat(flashblocks): add metrics for current block and index (paradigmxyz#19712)
  refactor(flashblock): Move all flashblocks related data structure to op-alloy (paradigmxyz#19608)
  chore: add target: flashblock for all flashblock related traces (paradigmxyz#19656)
  feat(metrics): implement RAII-based block timing with Prometheus support (#60)
  Fix fmt (#62)
sieniven pushed a commit to okx/reth that referenced this pull request Dec 11, 2025
…ock (paradigmxyz#19954)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 22, 2026
…ock (paradigmxyz/reth#19954)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Feb 11, 2026
…ock (paradigmxyz/reth#19954)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants