-
Notifications
You must be signed in to change notification settings - Fork 517
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
Use nonce for snark work and tx gossips #13535
Conversation
[%%versioned | ||
module Stable = struct | ||
module V1 = struct | ||
type 'a t = { message : 'a; nonce : int } [@@deriving compare, sexp, yojson] |
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.
Could you add a comment here describing why this is needed?
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.
Added the following comment:
Appending a nonce to messages emitted by transaction and snark pools allows to circumvent
libp2p's gossip deduplication logic and allow broadcasts to be broadcasted over and over again.
!ci-build-me |
Version linter failure is ok here as the changes were made to a V2 type |
|
||
let broadcast_snark_pool_diff t diff = | ||
let broadcast_snark_pool_diff ?nonce t diff = |
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.
Why is nonce optional?
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.
It's not set for initial broadcast (underlying layer will set 0
for it to be used in wire format).
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.
For rebroadcasts we generate a random number for a nonce
c43b3c3
to
c39fa10
Compare
!ci-build-me |
c39fa10
to
7a4650c
Compare
!ci-build-me |
Problem: with hash-based message ids rebroadcast mechanism became invalid. Solution: add integer nonce to snark/tx gossip messages in the old topic.
7a4650c
to
68c5c98
Compare
!ci-build-me |
!approved-for-mainnet |
Problem: with hash-based message ids rebroadcast mechanism became invalid.
Solution: add integer nonce to snark/tx gossip messages in the old topic.
Explain how you tested your changes:
Checklist: