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
[Bootstrap] Extracted rootblock
and updated finalize
#1371
Conversation
… Added encoding and writing to disk encoded root block and votes
…ementing reading/writing of DKG and root block
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.
Thanks Yurii - looks good, had 2 main comments:
- We are losing DKG index information when converting between types. This will cause verification to fail.
- I added a suggestion to avoid needing to load a private key to aggregate the QC. This is not strictly a blocker, but I think it's worth removing the unneeded flag and logic.
cmd/bootstrap/run/qc.go
Outdated
|
||
// GenerateQCSignerParticipantData generates participant data for creating QC. | ||
// Caller needs to pass dkg participants that will be taking part in building QC. | ||
func GenerateQCSignerParticipantData(internalNodes []bootstrap.NodeInfo, dkgParticipant dkg.DKGParticipantPriv, dkgData inmem.EncodableDKG) (*ParticipantData, error) { |
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.
As mentioned in the other comment, we don't actually need a private key to generate a QC from existing votes.
I wrote up a function that should do the trick to generate a signer/validator which can be used, without needing to load any private data (which ultimately isn't used anyway):
func createAggregator(participantData *ParticipantData) (hotstuff.Validator, hotstuff.SignerVerifier, error) {
identities := participantData.Identities()
var (
unusedLocalNodeID = flow.ZeroID
unusedModuleLocal module.Local = nil
unusedPrivateKey crypto.PrivateKey = nil
)
// create consensus committee's state
committee, err := committees.NewStaticCommittee(identities, unusedLocalNodeID, participantData.Lookup, participantData.GroupKey)
if err != nil {
return nil, nil, err
}
merger := signature.NewCombiner(encodable.ConsensusVoteSigLen, encodable.RandomBeaconSigLen)
stakingSigner := signature.NewAggregationProvider(encoding.ConsensusVoteTag, unusedModuleLocal)
beaconVerifier := signature.NewThresholdVerifier(encoding.RandomBeaconTag)
beaconSigner := signature.NewThresholdProvider(encoding.RandomBeaconTag, unusedPrivateKey)
beaconStore := signature.NewSingleSignerStore(beaconSigner)
signer := verification.NewCombinedSigner(committee, stakingSigner, beaconVerifier, merger, beaconStore, flow.ZeroID)
validator := validator.New(committee, new(mocks.ForksReader), signer)
return validator, signer, nil
}
…w/flow-go into yurii/5891-update-finalize
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 to me
…re _reading_ the infos and not generating them
Codecov Report
@@ Coverage Diff @@
## master #1371 +/- ##
==========================================
+ Coverage 56.36% 56.44% +0.07%
==========================================
Files 504 505 +1
Lines 31210 31332 +122
==========================================
+ Hits 17593 17684 +91
- Misses 11247 11271 +24
- Partials 2370 2377 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
🎉
Porting #1371 to `v0.21_consensus_test`
dapperlabs/flow-go#5889
dapperlabs/flow-go#5891
Context
This PR implements
rootblock
command for bootstrap utility and updatesfinalize
.As result of
rootblock
we output DKG info and root block + votes into separate files.finalize
will consume public DKG data, root block and votes to construct QC and initialize collection clusters.