-
Notifications
You must be signed in to change notification settings - Fork 41
Added block validation before broadcast #1001
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
Added block validation before broadcast #1001
Conversation
d07c188 to
1fb0caf
Compare
|
@0xMimir when you think this is ready please expand the summary in the PR with mode details about the changes to ease reviewing (like for example what the new flow looks like compared to what it was before, how cleanup works , etc) |
451d363 to
96369ab
Compare
9e9b439 to
0c895ba
Compare
0c895ba to
d2b78db
Compare
node/src/transition_frontier/sync/transition_frontier_sync_effects.rs
Outdated
Show resolved
Hide resolved
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.
I left a bunch of comments, some are about issues that are probably easy to solve, but there are two aspects that may need a bit more discussion:
- When the block message really needs to be re-broadcasted (now it is happening too early)
- That the block validation callback is not going through the full flow (right now it only considers block pre-validation, not block application, it is only after that point that you really know if it is
Valid)
e1ff8bf to
9c419ff
Compare
9c419ff to
43f3d2f
Compare
4585b73 to
c198521
Compare
c198521 to
ee2186e
Compare
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.
LGTM
@0xMimir not for this PR, but for the future. How hard do you think it would be to write tests for the different situations handled here?
Added callback to prevalidate pubsub message before broadcasting them to peers, delayed block broadcast until block is applied.
Previous flow when pubsub message is received:
Flow after this PR will be:
After block is received in pubsub it gets stored in state, message gets removed from state either by being to old, (older than 10minutes), or by being broadcasted, message cleanup is trigger by dispatching
P2pNetworkPubsubAction::PruneMessageswhich is done fromP2pState::p2p_timeout_dispatch