diff options
Diffstat (limited to 'core/vm')
-rw-r--r-- | core/vm/oracle_contracts.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/vm/oracle_contracts.go b/core/vm/oracle_contracts.go index 4459b95b9..5ea4d4790 100644 --- a/core/vm/oracle_contracts.go +++ b/core/vm/oracle_contracts.go @@ -1968,7 +1968,15 @@ func (g *GovernanceContract) resetDKG(newSignedCRS []byte) ([]byte, error) { // If 2f + 1 of DKG set is finalized, check if DKG succeeded. if g.state.DKGFinalizedsCount().Uint64() >= threshold { - _, err := g.coreDKGUtils.NewGroupPublicKey(&g.state, nextRound, tsigThreshold) + gpk, err := g.coreDKGUtils.NewGroupPublicKey(&g.state, nextRound, tsigThreshold) + if gpk, ok := gpk.(*dkgTypes.GroupPublicKey); ok { + nextRound := new(big.Int).Add(g.evm.Round, big.NewInt(1)) + if len(gpk.QualifyNodeIDs) < coreUtils.GetDKGValidThreshold(&coreTypes.Config{ + NotarySetSize: uint32(g.configNotarySetSize(nextRound).Uint64())}) { + err = dkgTypes.ErrNotReachThreshold + } + } + // DKG success. if err == nil { return nil, errExecutionReverted |