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

feat: cache lastTail in txindexer to avoid read from db #157

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

bnoieh
Copy link
Contributor

@bnoieh bnoieh commented Aug 30, 2024

Description

This PR fix engine_forkchoiceUpdated api performance issue, which is introduced from upstream geth code.

Rationale

  1. engine_forkchoiceUpdated api blocks on chainHeadFeed.Send, which waits for all the feed subscribers to receive.
  2. txIndexer is one of subscribers, it may take about 800ms to receive, and the bad apple is rawdb.ReadTxIndexTail. You could find more details here
  3. opBNB block time is 1s, and can not afford this high latency of engine api

Example

n/a

Changes

  1. cache lastTail in txindexer.go to avoid read from db

redhdx
redhdx previously approved these changes Aug 30, 2024
Copy link
Contributor

@redhdx redhdx left a comment

Choose a reason for hiding this comment

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

LGTM

@owen-reorg owen-reorg changed the title fix: txIndexer should use bufferd headCh feat: cache lastTail in txindexer to avoid read from db Sep 2, 2024
@owen-reorg owen-reorg merged commit 9aaf907 into bnb-chain:develop Sep 2, 2024
1 check passed
bnoieh pushed a commit to bnoieh/op-geth that referenced this pull request Nov 29, 2024
…_for_mainnet_superchains

Bump the geth cache on OP stack mainnet chains
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.

4 participants