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

alter ActiveP2pNetwork concept of close to in sync #8853

Merged

Conversation

rolfyone
Copy link
Contributor

  • isInSync is often set when there's no other peers to sync to so its not a great measure

  • moved the isCloseToInSync into recentChaindata

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

 - `isInSync` is often set when there's no other peers to sync to so its not a great measure

 - moved the isCloseToInSync into recentChaindata

Signed-off-by: Paul Harris <[email protected]>
Signed-off-by: Paul Harris <[email protected]>
@rolfyone rolfyone marked this pull request as ready for review November 28, 2024 09:41
@rolfyone
Copy link
Contributor Author

i've done a few syncs on different networks, and its behaving as I expect, ready to review.

@tbenr
Copy link
Contributor

tbenr commented Nov 29, 2024

There is a side effect with this, which can be replicated this way:

  1. run a single interop node and let it progress the chain for a while
  2. stop the node and wait until isCloseToInSync will return false
  3. start the node again
  4. the node SyncStateTracker service start will timeout and call onStartupTimeout
  5. we are not in a state where the single node start building the chain again but never starts the gossip again (so it will never communicate with an eventual node joining the network later)

previous behaviour
image

new behaviour:
image
image

so if a new node connects you end up in this weird situation where we don't publish messages to the other peer even if it is connected and just synced to the head.
image
image

@tbenr
Copy link
Contributor

tbenr commented Nov 29, 2024

I think we need ActiveEth2P2PNetwork to subscribe like network.subscribeConnect(peer -> onPeerConnected()); and make sure we start gossip when we are in sync and we got peers connected onPeerConnected

@tbenr
Copy link
Contributor

tbenr commented Nov 29, 2024

@rolfyone pushed a commit to cover the condition i was mentioning.

Copy link
Contributor

@tbenr tbenr left a comment

Choose a reason for hiding this comment

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

maybe we could provide isCloseToInSync on the onSyncStateChanged method, instead of isInSync. The consumer doesn't get much value by just receiving that event and most likely need to call recenChainData to get the info. Doing that we could avoid multiple calls (for each subscriber) to recentChainData (and also avoid subscriber to require recenChainData dep injection)

@rolfyone rolfyone merged commit 93ab4a8 into Consensys:master Dec 1, 2024
17 checks passed
@rolfyone rolfyone deleted the rate-limit-sync-committee-warning branch December 1, 2024 22:04
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.

2 participants