Skip to content

[CGKIELE-154] stabilize sync for iele testnet #442

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

Merged
merged 1 commit into from
Apr 17, 2018

Conversation

rtkaczyk
Copy link
Contributor

No description provided.

broadcastNewBlockHash(newBlock, peersWithoutBlock)

if (syncConfig.broadcastNewBlockHashes) {
// the usefulness of this message is debatable, especially in private networks
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we may need to make a decision in the future, can we start the comment as // NOTE or // Note, so that it is easily grep-able?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What decision do you mean? The message is part of ETH protocol, and other clients support it, so I think we also should retain it.

That said, I really don't know why it was introduced in the protocol or what are its practical applications. Maybe @KonradStaniec can shed light upon it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it used to inform other peers about the new blocks we have? Why do you think it's not needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

(I think what Christos means is adding a "Note" prefix to comments)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, adding a Note prefix to comments. But no stopper here.

Copy link
Contributor

@KonradStaniec KonradStaniec Apr 17, 2018

Choose a reason for hiding this comment

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

@rtkaczyk newBlocks message is only sent to a subset of peers (if I remember correctly sqrt(n) peers, where n is the number of current peers), newBlockHashes is sent to all peers.
And main reason for both of them to exist is that newBlockHashes is much more lightweight and not load peer network that much (newBlockHashes is only a hash, and then peer needs to download block directly, newBlocks is the whole new block )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added the "NOTE" just in case, but I still don't think there's anything to decide here

Copy link
Contributor Author

@rtkaczyk rtkaczyk Apr 17, 2018

Choose a reason for hiding this comment

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

The main problems with NewBlockHashes:

  • it's sent to the same peers that receive NewBlock, which is redundant
  • it's handled differently than NewBlock, where orphaned block is ignored, which is just weird
  • NewBlock should be completely sufficient, because nodes that received the message should forward it to the ones that didn't

Copy link
Contributor

@loverdos loverdos left a comment

Choose a reason for hiding this comment

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

The patch has been tested on the cluster and the expected behavior is observed.

@rtkaczyk rtkaczyk force-pushed the fix/stabilizeSyncForIeleTestnet branch from 278f509 to 36c0368 Compare April 17, 2018 08:52
@rtkaczyk rtkaczyk merged commit 36c0368 into phase/iele_testnet Apr 17, 2018
@rtkaczyk rtkaczyk deleted the fix/stabilizeSyncForIeleTestnet branch April 17, 2018 09:18
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