-
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
[EFM] Fix bugs from Benchnet testing #6898
base: feature/efm-recovery
Are you sure you want to change the base?
Changes from 5 commits
b5c16a2
5413e57
d15fb2f
1d4b8a2
c241558
f0c22c5
a188c37
0a4cc75
623b3b3
04bd4a6
21f9688
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -284,8 +284,13 @@ func (e *ReactorEngine) handleEpochCommittedPhaseStarted(currentEpochCounter uin | |
|
||
return | ||
} | ||
if currentState == flow.RandomBeaconKeyCommitted { | ||
// this can happen if a healthy node which succeeded the DKG restarts in the EpochCommit phase | ||
log.Debug().Msg("checking beacon key consistency after EpochCommit: observed committed beacon key for most recent dkg - exiting") | ||
jordanschalm marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this only for better traces? Functionality it doesn't change anything. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is for more accurate logs - there is no functional change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it does change something, because it shortcuts the sanity check that all (repeated) calls to committing the same epoch don't have inconsistent information. See my comment below for details. |
||
return | ||
} | ||
if currentState != flow.DKGStateCompleted { | ||
jordanschalm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
log.Warn().Msgf("checking beacon key consistency: exiting because dkg didn't reach completed state: %s", currentState.String()) | ||
log.Warn().Msgf("checking beacon key consistency after EpochCommit: exiting because dkg didn't reach completed state: %s", currentState.String()) | ||
return | ||
} | ||
snapshot := e.State.AtBlockID(firstBlock.ID()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,6 +6,7 @@ import ( | |||||
"fmt" | ||||||
|
||||||
"github.com/dgraph-io/badger/v2" | ||||||
"github.com/rs/zerolog" | ||||||
|
||||||
"github.com/onflow/flow-go/model/encodable" | ||||||
"github.com/onflow/flow-go/model/flow" | ||||||
|
@@ -81,7 +82,7 @@ func RetrieveDKGStateForEpoch(epochCounter uint64, currentState *flow.DKGState) | |||||
// It reads already stored data by deprecated prefix and writes it to the new prefix with values converted to the new representation. | ||||||
// TODO(EFM, #6794): This function is introduced to implement a backward-compatible upgrade from v1 to v2. | ||||||
// Remove this once we complete the network upgrade. | ||||||
func MigrateDKGEndStateFromV1() func(txn *badger.Txn) error { | ||||||
func MigrateDKGEndStateFromV1(log zerolog.Logger) func(txn *badger.Txn) error { | ||||||
return func(txn *badger.Txn) error { | ||||||
var ops []func(*badger.Txn) error | ||||||
err := traverse(makePrefix(codeDKGEndState), func() (checkFunc, createFunc, handleFunc) { | ||||||
|
@@ -110,6 +111,7 @@ func MigrateDKGEndStateFromV1() func(txn *badger.Txn) error { | |||||
ops = append(ops, | ||||||
UpsertDKGStateForEpoch(epochCounter, newState), | ||||||
remove(makePrefix(codeDKGEndState, epochCounter))) | ||||||
log.Debug().Msgf("removing %d->%d, writing %d->%d", epochCounter, oldState, epochCounter, newState) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This doesn't happen often so maybe info is better to understand if we have migrated or not. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||||||
|
||||||
return nil | ||||||
} | ||||||
|
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.
How about making it
Info
and moving it into the method itself and log only if we have actually migrated. Additionally we could have a debug msg which shows that we have entered and exitedPostInit
itselfThere 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.
+1