Skip to content

Conversation

@sieniven
Copy link

Summary

  • Enable support for eth_getBlockTransactionCountByNumber and eth_getBlockTransactionCountByHash apis for flashblock
  • Note that we duplicate the logic from the default trait implementation in the underlying helper method to contain the flashblocks implementation inside the optimism ethapi

* feat: overriding option to add new APIs to support flashblock

* fmt

* chore: remove code
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.

that makes sense but should we perhaps change

if block_id.is_pending() {
// Pending block can be fetched directly without need for caching
return Ok(self
.provider()
.pending_block()
.map_err(Self::Error::from_eth_err)?
.map(|block| block.body().transaction_count()));

to just

// If no pending block from provider, build the pending block locally.
if let Some(pending) = self.local_pending_block().await? {
return Ok(Some((pending.block, pending.receipts)));
}

instead?

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Dec 11, 2025
@limyeechern
Copy link

Hi @mattsse, we have made changes according to your suggestion. We now do not duplicate the logic but update the block_transaction_count function in the EthBlocks trait

@mattsse mattsse enabled auto-merge December 12, 2025 08:58
block_id: BlockId,
) -> impl Future<Output = Result<Option<usize>, Self::Error>> + Send {
async move {
if block_id.is_pending() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

ah we need to keep this check actually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants