Skip to content

refactor(p2p): optimize p2p client's getTxsByHash and handleBlockStreamEvent#20539

Open
dipkakwani wants to merge 1 commit intoAztecProtocol:merge-train/spartanfrom
dipkakwani:dip/optimize-txs-by-hash-spartan
Open

refactor(p2p): optimize p2p client's getTxsByHash and handleBlockStreamEvent#20539
dipkakwani wants to merge 1 commit intoAztecProtocol:merge-train/spartanfrom
dipkakwani:dip/optimize-txs-by-hash-spartan

Conversation

@dipkakwani
Copy link

Summary

  • existing getTxsByHash has O(n^2) time complexity, reduce it to O(n).
  • optimize chain-finalized case in handleBlockStreamEvent to not fetch multiple blocks and only fetch the header of the last block.
  • in getPendingTxs, use getTxsByHash instead of multiple getTxByHash

@dipkakwani dipkakwani changed the title optimize getTxsByHash and handleBlockStreamEvent refactor(p2p): optimize p2p client's getTxsByHash and handleBlockStreamEvent Feb 16, 2026
@mralj mralj marked this pull request as ready for review February 17, 2026 08:46
@mralj mralj requested a review from mrzeszutko February 17, 2026 08:46
@mralj
Copy link
Contributor

mralj commented Feb 17, 2026

@dipkakwani please rebase :)

@dipkakwani dipkakwani force-pushed the dip/optimize-txs-by-hash-spartan branch from 1a45fa3 to 6cdad23 Compare February 17, 2026 08:53
@mralj mralj added ci-external Allow CI to run on this external pull request. ci-external-once Run CI on an external PR, but only once. labels Feb 17, 2026
@AztecBot AztecBot removed the ci-external-once Run CI on an external PR, but only once. label Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-external Allow CI to run on this external pull request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants