forked from monero-project/monero
-
Notifications
You must be signed in to change notification settings - Fork 26
fix(p2p): correlate NOTIFY responses with prior requests; cap flash heights #198
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
Open
raw391
wants to merge
4
commits into
Beldex-Coin:dev
Choose a base branch
from
raw391:fix/p2p-response-correlation-gate
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
27d94d9
fix(p2p): correlate NOTIFY responses with prior requests; cap flash h…
tunacanfinder bf8c16d
fix(p2p): cap outbound flash-height request to the object limit
tunacanfinder 0bad311
fix(p2p): serialize flash-height requests to avoid dropping honest peers
tunacanfinder 1217c16
Merge branch 'dev' into fix/p2p-response-correlation-gate
victor-tucci File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Cap outbound flash-height requests to the same 500-item protocol limit.
process_payload_sync_data()still accepts up to 1000 advertised flash heights (Lines 391-394), but this path sends every needed height in a singleNOTIFY_REQUEST_BLOCK_FLASHES. Oncer.heights.size()exceedsCURRENCY_PROTOCOL_MAX_OBJECT_REQUEST_COUNT, a patched peer will reject our request inhandle_request_block_flashes()and disconnect us. Batch the request here or leave the overflow heights pending for a follow-up request.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents
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.
Capped the sender to match the receiver limit. Overflow heights stay flagged in
m_flash_staterather than re-armingm_need_flash_synchere, since the flags aren't cleared until a response lands and re-arming would re-request the in-flight batch.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.
@raw391, the cap itself is correct, and I agree that immediately re-armingm_need_flash_syncwould risk re-requesting the in-flight batch.However, the overflow is not currently guaranteed a follow-up: on the next unchanged flash advertisement, an existing
m_flash_stateentry takes theelse continuepath, so it does not setm_need_flash_syncagain. Those overflow heights can therefore remain flagged indefinitely unless that peer advertises a different checksum.A follow-up should be scheduled only after the current batch is resolved, while ensuring the next request excludes heights already in
m_requested_flash_heights(or otherwise tracks completed/requested batches separately).