Skip to content

specialize send_raw_transaction_sync for op-reth #18372

@mattsse

Description

@mattsse

Describe the feature

similar to #18371

but in addition to the regular notification:

while let Some(notification) = stream.next().await {

this should also lookup the flashblocks

TODO

  • extract the stream await logic to a standalone helper type

tokio::time::timeout(TIMEOUT_DURATION, async {
while let Some(notification) = stream.next().await {
let chain = notification.committed();
for block in chain.blocks_iter() {
if block.body().contains_transaction(&hash) {
if let Some(receipt) = this.transaction_receipt(hash).await? {
return Ok(receipt);
}
}
}
}
Err(Self::Error::from_eth_err(TransactionConfirmationTimeout {
hash,
duration: TIMEOUT_DURATION,
}))
})
.await
.unwrap_or_else(|_elapsed| {
Err(Self::Error::from_eth_err(TransactionConfirmationTimeout {
hash,
duration: TIMEOUT_DURATION,
}))
})

that operates on stream of blocks instead, this way we can reuse this logic more easily in op-reth
then specialize this endpoint in the opethapi:

impl<N, Rpc> EthTransactions for OpEthApi<N, Rpc>

using both the canonstream+ a watch stream over the recent flashblocks

Additional context

No response

Metadata

Metadata

Assignees

Labels

A-op-rethRelated to Optimism and op-rethA-rpcRelated to the RPC implementationC-enhancementNew feature or requestD-good-first-issueNice and easy! A great choice to get started

Type

No type

Projects

Status

Backlog

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions