Skip to content

Conversation

@heifner
Copy link
Contributor

@heifner heifner commented Jul 28, 2025

Track last_block_num_received across all connections and use that instead of chain head for determination if block nack reset should be sent. Also reset consecutive_blocks_nacks when block nacks are not consecutive.

Resolves #1784

… that instead of chain head for determination if block nack reset should be sent. Also reset consecutive_blocks_nacks when block nacks are not consecutive.
@heifner heifner added the OCI Work exclusive to OCI team label Jul 28, 2025
@heifner heifner linked an issue Jul 28, 2025 that may be closed by this pull request
fc::raw::unpack( peek_ds, bh );
const block_id_type blk_id = bh.calculate_id();
const uint32_t blk_num = last_received_block_num = block_header::num_from_id(blk_id);
my_impl->last_block_num_received = blk_num;
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't it be something like:
my_impl->last_block_num_received = std::max(blk_num, my_impl->last_block_num_received);

or are we guaranteed to receive blocks from only one connection at a time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can't do that because if we receive a large invalid block then my_impl->last_block_num_received would stay that value. Really what we are trying to accomplish here is just knowing if we are receiving blocks from this connection. Maybe it would be better to add a last_block_received_time to connection and compare that to say 5 seconds in close and use that as the determination.

@heifner heifner merged commit 19e7047 into release/1.2 Jul 29, 2025
36 checks passed
@heifner heifner deleted the GH-1784-block-nack-reset-1.2 branch July 29, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCI Work exclusive to OCI team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

P2P: close not sending block nack reset for active connection

3 participants