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

EFM Integration Test Part 2 #6424

Merged

Conversation

kc1116
Copy link
Contributor

@kc1116 kc1116 commented Aug 30, 2024

This PR updates the current EFM integration test and ensures that the network can successfully transition into recovery epoch after processing recover epoch governance transaction.

ref: #6164

@kc1116 kc1116 requested review from jordanschalm and AlexHentschel and removed request for zhangchiqing August 30, 2024 15:37
Copy link
Member

@jordanschalm jordanschalm left a comment

Choose a reason for hiding this comment

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

The test itself looks good, but I think we need to move it or adjust some configs to make sure it will run when we want 👇.

The integration tests are run in CI jobs grouped by package. The new epoch recovery test is in a new package integration/tests/epochs/recover_epoch, but there is no corresponding CI configuration, so I don't think the new test will actually run in CI, or when we run eg. make epochs-tests.

The easiest fix is to just add the new test to an existing package (cohort1 or cohort2).

If it needs to be in a new package, then:

  • we'll need to configure the new package to run in CI etc.
    • Need to add an entry to the Makefile here
    • And a new CI job here
  • let's call the new package cohort3 to keep naming consistent

@durkmurder durkmurder changed the base branch from master to yurii/6495-convert-epoch-recover October 9, 2024 11:22
@durkmurder durkmurder self-assigned this Oct 9, 2024
2. Updated logic for converting Cadence structures.
3. Updated consensus logic to inject DKG private key from previous epoch in case of epoch recovery.
4. Added logging for errors in FVM Event Emitter.
5. !Temporary! disabled a check in storage/badger/dkg_state.go
Base automatically changed from yurii/6495-convert-epoch-recover to feature/efm-recovery October 21, 2024 12:41
An error occurred while trying to automatically change base from yurii/6495-convert-epoch-recover to feature/efm-recovery October 21, 2024 12:41
@codecov-commenter
Copy link

codecov-commenter commented Oct 21, 2024

Codecov Report

Attention: Patch coverage is 40.12739% with 188 lines in your changes missing coverage. Please review.

Project coverage is 41.71%. Comparing base (5ae48c4) to head (a5ac02c).

Files with missing lines Patch % Lines
cmd/bootstrap/run/epochs.go 0.00% 62 Missing ⚠️
storage/mock/epoch_recovery_my_beacon_key.go 0.00% 46 Missing ⚠️
storage/badger/dkg_state.go 40.00% 18 Missing ⚠️
integration/utils/transactions.go 0.00% 16 Missing ⚠️
engine/consensus/dkg/reactor_engine.go 0.00% 12 Missing ⚠️
cmd/consensus/main.go 0.00% 8 Missing ⚠️
fvm/environment/event_emitter.go 14.28% 6 Missing ⚠️
module/dkg/recovery.go 93.87% 4 Missing and 2 partials ⚠️
cmd/util/cmd/epochs/cmd/recover.go 63.63% 3 Missing and 1 partial ⚠️
storage/badger/operation/dkg.go 0.00% 4 Missing ⚠️
... and 3 more
Additional details and impacted files
@@                   Coverage Diff                    @@
##           feature/efm-recovery    #6424      +/-   ##
========================================================
- Coverage                 41.72%   41.71%   -0.01%     
========================================================
  Files                      2019     2030      +11     
  Lines                    179401   180462    +1061     
========================================================
+ Hits                      74849    75279     +430     
- Misses                    98395    98989     +594     
- Partials                   6157     6194      +37     
Flag Coverage Δ
unittests 41.71% <40.12%> (-0.01%) ⬇️

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.


🚨 Try these New Features:

EFM Recovery: Fixes from Benchnet Testing
cmd/bootstrap/run/epochs.go Outdated Show resolved Hide resolved
cmd/bootstrap/run/epochs.go Outdated Show resolved Hide resolved
cmd/bootstrap/run/epochs.go Show resolved Hide resolved
cmd/bootstrap/run/epochs.go Show resolved Hide resolved
storage/badger/dkg_state.go Outdated Show resolved Hide resolved
module/dkg/recovery.go Outdated Show resolved Hide resolved
module/dkg/recovery.go Outdated Show resolved Hide resolved
module/dkg/recovery.go Outdated Show resolved Hide resolved
module/dkg/recovery.go Outdated Show resolved Hide resolved
module/dkg/recovery.go Show resolved Hide resolved
cmd/bootstrap/run/epochs.go Outdated Show resolved Hide resolved
cmd/bootstrap/run/epochs.go Show resolved Hide resolved
cmd/bootstrap/run/epochs.go Show resolved Hide resolved
cmd/bootstrap/run/epochs.go Outdated Show resolved Hide resolved
cmd/bootstrap/run/epochs.go Outdated Show resolved Hide resolved
cmd/bootstrap/run/epochs.go Outdated Show resolved Hide resolved
cmd/util/cmd/epochs/cmd/recover_test.go Outdated Show resolved Hide resolved
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.

well done. Amazing tests - very thorough and very well documented 🏅

engine/consensus/dkg/reactor_engine.go Show resolved Hide resolved
engine/consensus/dkg/reactor_engine.go Outdated Show resolved Hide resolved
engine/consensus/dkg/reactor_engine.go Outdated Show resolved Hide resolved
model/flow/dkg.go Outdated Show resolved Hide resolved
// - node is in epoch committed phase
// - exception is thrown when trying to check if there is a safe beacon key for the next epoch
// This is an unexpected error and should be propagated to the caller.
func (s *BeaconKeyRecoverySuite) TestNewBeaconKeyRecovery_NextEpochRetrieveMyBeaconPrivateKeyException() {
Copy link
Member

Choose a reason for hiding this comment

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

I would recommend to include another test like this one, with the only difference that

_, safe, err := b.localDKGState.RetrieveMyBeaconPrivateKey(nextEpochCounter)
returns an storage.ErrNotFound. In this case, we would expect the code to proceed, right?

Copy link
Member

Choose a reason for hiding this comment

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

module/dkg/recovery_test.go Outdated Show resolved Hide resolved
module/dkg/recovery_test.go Outdated Show resolved Hide resolved
module/dkg/recovery_test.go Outdated Show resolved Hide resolved
cmd/bootstrap/run/epochs.go Outdated Show resolved Hide resolved
cmd/util/cmd/epochs/cmd/recover_test.go Outdated Show resolved Hide resolved
cmd/util/cmd/epochs/cmd/recover_test.go Outdated Show resolved Hide resolved
// This occurs only for epochs which are entered through the EFM Recovery process ([flow.EpochRecover] service event).
DKGEndStateRecovered
// RandomBeaconKeyRecovered - this node has recovered its beacon key from a previous epoch.
// This occurs only for epochs which are entered through the EFM Recovery process (`flow.EpochRecover` service event).
Copy link
Member

Choose a reason for hiding this comment

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

Minor point on the formatting:

Copy link
Member

Choose a reason for hiding this comment

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

Good to know, thanks. I will make a PR to feature/efm-recovery to fix any of those.

storage/badger/dkg_state.go Outdated Show resolved Hide resolved
@durkmurder durkmurder merged commit d0c9695 into feature/efm-recovery Nov 19, 2024
55 checks passed
@durkmurder durkmurder deleted the khalil/6164-efm-integration-test-part2 branch November 19, 2024 14:37
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.

5 participants