Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish confirmed transactions by address #1198

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

kaladinlight
Copy link
Contributor

Currently in order to push confirmed transaction notifications to a client, you have to:

  • Subscribe to new blocks
  • Fetch block from blockbook on new block
  • Check if any subsccribed addresses are associated with any transactions in the block

Historically this has worked without any noticeable issue, however in integrating Base, I have noticed this no longer holds up due to the fast block times and high transaction throughput on chain. The node gets oversaturated with network requests causing it to fall out of sync along with blockbook. Even when they are staying in sync, I was seeing calls to get a block taking more than 30 minutes. I did make many attempts at increasing resources, cache sizes, etc. to improve performance without avail.

To reduce most overhead related to this scenario, I chose to add an optional newBlockTxs param to subscribeAddresses which will allow subscribing to addresses for mempool AND confirmed transactions now. By leveraging the mostly parsed sync blocks, we can detect all associated addresses for a transaction to determine if a confirmed transaction should be published to a client and only then, fetch the evm transaction receipt to ensure an api.Tx is sent to the client. This update cuts down nearly all of the previously seen network requests and completely fixed the performance issues seen in the above scenario.

(I went with newBlockTxs just to tie into the new block vernacular, but could update to confirmedTxs if that sounds better.)

@kaladinlight kaladinlight force-pushed the pub-new-block-txs branch 2 times, most recently from b5dd84c to fe7b7fa Compare February 6, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants