-
Notifications
You must be signed in to change notification settings - Fork 180
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
DKG Result Submission Backward Compatibility #6827
DKG Result Submission Backward Compatibility #6827
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/efm-recovery #6827 +/- ##
========================================================
- Coverage 41.73% 41.71% -0.03%
========================================================
Files 2033 2033
Lines 181328 181418 +90
========================================================
- Hits 75681 75680 -1
- Misses 99417 99503 +86
- Partials 6230 6235 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
👍
// CASE 2: we aren't sure whether FlowDKG is v2 compatible - fallback to v1 submission | ||
if err != nil { | ||
c.Log.Warn().Err(err).Msg("unable to determine FlowDKG compatibility - falling back to v1 result submission") | ||
return c.submitResult_ProtocolV1(groupPublicKey, publicKeys) | ||
} |
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.
This is probably not a question that we can address as part of this PR. When reading these lines, I am wondering what would happen if the protocol was on version 2 already, but script execution failed and we would submit with version 1 ... not sure how unlikely that is and what the consequences could be. Probably something best to be discussed in person.
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.
In that case, the v1 result submission would fail, and we would retry (execute both the script execution and resubmission again). So if script execution transiently fails, it's not a big deal -- if it fails consistently (where the transaction submission otherwise would have succeeded), it could cause a failure.
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.
Looks good!
This PR implements backward-compatibility for DKG result submission.
The implementation here uses differences in the smart contract to decide which transaction to use for result submission. Compared to the protocol-version-based approach described in the issue, this has the benefit that the smart contract upgrade does not need to be coordinated with the Protocol HCU.