-
Notifications
You must be signed in to change notification settings - Fork 38.6k
validation, zmq: pass block in UpdatedBlockTip to avoid duplicate read #26375
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
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
8685a97 to
7b631dc
Compare
aureleoules
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 7b631dc - LGTM
w0xlt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crACK 7b631dc
|
This will increase the memory use even if not using zmq. I guess it is fine because the queue is limited? |
That sounds accurate. It seems |
Github-Pull: bitcoin#26375 Rebased-From: 4a16416
Github-Pull: bitcoin#26375 Rebased-From: 7b631dc
Github-Pull: bitcoin#26375 Rebased-From: 4a16416
Github-Pull: bitcoin#26375 Rebased-From: 7b631dc
When
CZMQPublishRawBlockNotifier::NotifyBlockis called it callsReadBlockFromDiskwith the passed in block index. However, we will always have already read this block into memory duringActivateBestChainand use it to callBlockConnected. We can check for the tip block there and pass that intoUpdatedBlockTipto avoid having the zmq notifier read the block. This also has the benefit of removing thenode/blockstorage.hdependency entirely from the zmq code, so we can continue working to removeReadBlockFromDiskout of global scope (#26316 (comment)).