-
Notifications
You must be signed in to change notification settings - Fork 40
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
unsafe warp sync #2366
base: master
Are you sure you want to change the base?
unsafe warp sync #2366
Conversation
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
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.
- CI
core/network/warp/sync.cpp
Outdated
while (true) { | ||
auto m = scale::encode(vote.message, j.round_number, set).value(); | ||
auto ok = ed25519.verify(vote.signature, m, vote.id); | ||
if (ok and ok.value()) { | ||
break; | ||
} | ||
++set; | ||
} |
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.
Malicious peer can do DoS...
- needed reasonable limit of
set
value. - failure on encoding or verifying should break loop immediately with error (does not matter to continue in this case).
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.
Yes, new protocols should learn from this mistake by storing some redundant information like set id.
Added limit of block number (new set each block).
Signed-off-by: turuslan <[email protected]> # Conflicts: # core/application/app_configuration.hpp # core/application/impl/app_configuration_impl.cpp # core/application/impl/app_configuration_impl.hpp # core/network/warp/sync.cpp
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
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.
Generally approved, please fix the comments.
Would the node stop after sync or continue with full sync when launched with --unsafe-sync-to?
Should it be launched at the same time with --sync Warp? or just --unsafe-sync-to is enough?
Please address these questions in the pr description.
const GrandpaJustification &j, | ||
consensus::grandpa::AuthoritySetId set) { | ||
HasAuthoritySetChange{header}.scheduled.value(); | ||
SL_INFO(log_, "unsafe, block {}, set {}", header.number, set); |
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.
Now it looks like developer's debugging printf. Since it has info log level, please reword it to be more friendly - replace "unsafe" with meaningful description - what this log line should tell.
Was it started, accomplished, in progress or something else?
Referenced issues
Description of the Change
Possible Drawbacks