Skip to content
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

Merged
merged 6 commits into from
Jan 7, 2025

Conversation

jordanschalm
Copy link
Member

@jordanschalm jordanschalm commented Dec 19, 2024

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.

@jordanschalm jordanschalm marked this pull request as ready for review December 19, 2024 20:01
@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 93 lines in your changes missing coverage. Please review.

Project coverage is 41.71%. Comparing base (7e6e79d) to head (8fee2f4).

Files with missing lines Patch % Lines
module/dkg/client.go 0.00% 92 Missing ⚠️
integration/localnet/builder/bootstrap.go 0.00% 1 Missing ⚠️
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     
Flag Coverage Δ
unittests 41.71% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@AlexHentschel AlexHentschel left a comment

Choose a reason for hiding this comment

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

👍

module/dkg/client.go Outdated Show resolved Hide resolved
Comment on lines +329 to +333
// 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)
}
Copy link
Member

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.

Copy link
Member Author

@jordanschalm jordanschalm Jan 6, 2025

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.

Copy link
Member

@durkmurder durkmurder left a comment

Choose a reason for hiding this comment

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

Looks good!

@jordanschalm jordanschalm merged commit 3cfafb6 into feature/efm-recovery Jan 7, 2025
55 checks passed
@jordanschalm jordanschalm deleted the jord/6816-dkg-submission-compat branch January 7, 2025 20:52
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