Skip to content

Conversation

@fed-franz
Copy link
Contributor

@fed-franz fed-franz commented Sep 28, 2024

Addresses unresolved comments in #2484

  • Resolves problems with borrow checker to set last_request in request_pool_missing_blocks
  • Handle sync timeout events the same way in on_heartbeat and on_block_event
    • This also fixes a potential flood attack from the sync peer
  • Improves logs and adds notes

Copy link
Member

@autholykos autholykos left a comment

Choose a reason for hiding this comment

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

LGTM (just a very little nit that can be ignored)

}
}

if !inv.inv_list.is_empty() {
Copy link
Member

Choose a reason for hiding this comment

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

nit: since we are at it, can we simply return early if inv.inv_list.is_empty() rather than nesting logic in the opposite case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally in favor!

Copy link
Member

@herr-seppia herr-seppia left a comment

Choose a reason for hiding this comment

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

RFT (Request for test)

// Transit back to InSync mode
// We check the timeout here to prevent the peer from keeping us in
// outofsync by flooding our node with blocks
if self.on_sync_timeout().await {
Copy link
Member

Choose a reason for hiding this comment

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

On_sync_timeout try to acquire a write lock from the acceptor (but you already acquired it, so probably it get stuck)

Try this before merge

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do!

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