diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-04-10 10:41:21 +0800 |
---|---|---|
committer | Jimmy Hu <jimmy.hu@dexon.org> | 2019-04-10 10:41:21 +0800 |
commit | e15c23f7cc9757118142940f1385031eed4dc05a (patch) | |
tree | 2aa45eff547dffb0f12ff5f53067ee67f37b383b /vendor | |
parent | 3a22fdf183c88a518c9836d625f2b8cf4d2baa76 (diff) | |
download | dexon-e15c23f7cc9757118142940f1385031eed4dc05a.tar dexon-e15c23f7cc9757118142940f1385031eed4dc05a.tar.gz dexon-e15c23f7cc9757118142940f1385031eed4dc05a.tar.bz2 dexon-e15c23f7cc9757118142940f1385031eed4dc05a.tar.lz dexon-e15c23f7cc9757118142940f1385031eed4dc05a.tar.xz dexon-e15c23f7cc9757118142940f1385031eed4dc05a.tar.zst dexon-e15c23f7cc9757118142940f1385031eed4dc05a.zip |
vendor: sync to latest core
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/configuration-chain.go | 62 | ||||
-rw-r--r-- | vendor/vendor.json | 42 |
2 files changed, 63 insertions, 41 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/configuration-chain.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/configuration-chain.go index 4a99d3dcc..76917a310 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/configuration-chain.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/configuration-chain.go @@ -580,31 +580,31 @@ func (cc *configurationChain) recoverDKGInfo( return ErrDKGNotReady } + threshold := utils.GetDKGThreshold( + utils.GetConfigWithPanic(cc.gov, round, cc.logger)) + cc.logger.Debug("Calling Governance.DKGMasterPublicKeys for recoverDKGInfo", + "round", round) + mpk := cc.gov.DKGMasterPublicKeys(round) + cc.logger.Debug("Calling Governance.DKGComplaints for recoverDKGInfo", + "round", round) + comps := cc.gov.DKGComplaints(round) + qualifies, _, err := typesDKG.CalcQualifyNodes(mpk, comps, threshold) + if err != nil { + return err + } + if len(qualifies) < + utils.GetDKGValidThreshold(utils.GetConfigWithPanic( + cc.gov, round, cc.logger)) { + return typesDKG.ErrNotReachThreshold + } + if !npksExists { - threshold := utils.GetDKGThreshold( - utils.GetConfigWithPanic(cc.gov, round, cc.logger)) - // Restore group public key. - cc.logger.Debug("Calling Governance.DKGMasterPublicKeys for recoverDKGInfo", - "round", round) - mpk := cc.gov.DKGMasterPublicKeys(round) - cc.logger.Debug("Calling Governance.DKGComplaints for recoverDKGInfo", - "round", round) - comps := cc.gov.DKGComplaints(round) - qualifies, _, err := typesDKG.CalcQualifyNodes(mpk, comps, threshold) - if err != nil { - return err - } - if len(qualifies) < - utils.GetDKGValidThreshold(utils.GetConfigWithPanic( - cc.gov, round, cc.logger)) { - return typesDKG.ErrNotReachThreshold - } npks, err := typesDKG.NewNodePublicKeys(round, cc.gov.DKGMasterPublicKeys(round), cc.gov.DKGComplaints(round), threshold) if err != nil { - cc.logger.Warn("Failed to create DKGGroupPublicKey", + cc.logger.Warn("Failed to create DKGNodePublicKeys", "round", round, "error", err) return err } @@ -620,7 +620,29 @@ func (cc *configurationChain) recoverDKGInfo( if err != nil { cc.logger.Warn("Failed to create DKGPrivateKey", "round", round, "error", err) - return err + dkgProtocolInfo, err := cc.db.GetDKGProtocol() + if err != nil { + cc.logger.Warn("Unable to recover DKGProtocolInfo", + "round", round, "error", err) + return err + } + if dkgProtocolInfo.Round != round { + cc.logger.Warn("DKGProtocolInfo round mismatch", + "round", round, "infoRound", dkgProtocolInfo.Round) + return err + } + prvKeyRecover, err := + dkgProtocolInfo.PrvShares.RecoverPrivateKey(qualifies) + if err != nil { + cc.logger.Warn("Failed to recover DKGPrivateKey", + "round", round, "error", err) + return err + } + if err = cc.db.PutDKGPrivateKey(round, *prvKeyRecover); err != nil { + cc.logger.Warn("Failed to save DKGPrivateKey", + "round", round, "error", err) + } + prvKey = *prvKeyRecover } func() { cc.dkgResult.Lock() diff --git a/vendor/vendor.json b/vendor/vendor.json index f98477f06..e07c1a557 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -141,16 +141,16 @@ { "checksumSHA1": "In6vBHYUsX7DUIGiFN2hQggBgvI=", "path": "github.com/dexon-foundation/dexon-consensus/common", - "revision": "948be08a7294e26f3b52f94f9af803f69680f9df", - "revisionTime": "2019-04-09T09:36:40Z", + "revision": "b9492bc09f8bb53b2a36e505ddad0d26373e71a3", + "revisionTime": "2019-04-10T01:52:20Z", "version": "single-chain", "versionExact": "single-chain" }, { - "checksumSHA1": "+omcW5A0/pD0ScXpN2SWIP6RC7A=", + "checksumSHA1": "lY1KAGWRuwd7OpzAz5yN7IysMvU=", "path": "github.com/dexon-foundation/dexon-consensus/core", - "revision": "948be08a7294e26f3b52f94f9af803f69680f9df", - "revisionTime": "2019-04-09T09:36:40Z", + "revision": "b9492bc09f8bb53b2a36e505ddad0d26373e71a3", + "revisionTime": "2019-04-10T01:52:20Z", "version": "single-chain", "versionExact": "single-chain" }, @@ -165,64 +165,64 @@ { "checksumSHA1": "tQSbYCu5P00lUhKsx3IbBZCuSLY=", "path": "github.com/dexon-foundation/dexon-consensus/core/crypto", - "revision": "948be08a7294e26f3b52f94f9af803f69680f9df", - "revisionTime": "2019-04-09T09:36:40Z", + "revision": "b9492bc09f8bb53b2a36e505ddad0d26373e71a3", + "revisionTime": "2019-04-10T01:52:20Z", "version": "single-chain", "versionExact": "single-chain" }, { "checksumSHA1": "m5lUT04qSHKtFukvxjnFX5Jo2hI=", "path": "github.com/dexon-foundation/dexon-consensus/core/crypto/dkg", - "revision": "948be08a7294e26f3b52f94f9af803f69680f9df", - "revisionTime": "2019-04-09T09:36:40Z", + "revision": "b9492bc09f8bb53b2a36e505ddad0d26373e71a3", + "revisionTime": "2019-04-10T01:52:20Z", "version": "single-chain", "versionExact": "single-chain" }, { "checksumSHA1": "BhLKK8RveoLaeXc9UyUKMwQqchU=", "path": "github.com/dexon-foundation/dexon-consensus/core/crypto/ecdsa", - "revision": "948be08a7294e26f3b52f94f9af803f69680f9df", - "revisionTime": "2019-04-09T09:36:40Z", + "revision": "b9492bc09f8bb53b2a36e505ddad0d26373e71a3", + "revisionTime": "2019-04-10T01:52:20Z", "version": "single-chain", "versionExact": "single-chain" }, { "checksumSHA1": "hj/KetWUHp+1CX+50V0QnCthfWc=", "path": "github.com/dexon-foundation/dexon-consensus/core/db", - "revision": "948be08a7294e26f3b52f94f9af803f69680f9df", - "revisionTime": "2019-04-09T09:36:40Z", + "revision": "b9492bc09f8bb53b2a36e505ddad0d26373e71a3", + "revisionTime": "2019-04-10T01:52:20Z", "version": "single-chain", "versionExact": "single-chain" }, { "checksumSHA1": "/OcEQKdtWDyRZibazIsAxJWHUyg=", "path": "github.com/dexon-foundation/dexon-consensus/core/syncer", - "revision": "948be08a7294e26f3b52f94f9af803f69680f9df", - "revisionTime": "2019-04-09T09:36:40Z", + "revision": "b9492bc09f8bb53b2a36e505ddad0d26373e71a3", + "revisionTime": "2019-04-10T01:52:20Z", "version": "single-chain", "versionExact": "single-chain" }, { "checksumSHA1": "zIgCdN4FJiAuPGMhB+/9YGK/Wgk=", "path": "github.com/dexon-foundation/dexon-consensus/core/types", - "revision": "948be08a7294e26f3b52f94f9af803f69680f9df", - "revisionTime": "2019-04-09T09:36:40Z", + "revision": "b9492bc09f8bb53b2a36e505ddad0d26373e71a3", + "revisionTime": "2019-04-10T01:52:20Z", "version": "single-chain", "versionExact": "single-chain" }, { "checksumSHA1": "lbG7yqVgzo2CV/CQPYjG78xp5jg=", "path": "github.com/dexon-foundation/dexon-consensus/core/types/dkg", - "revision": "948be08a7294e26f3b52f94f9af803f69680f9df", - "revisionTime": "2019-04-09T09:36:40Z", + "revision": "b9492bc09f8bb53b2a36e505ddad0d26373e71a3", + "revisionTime": "2019-04-10T01:52:20Z", "version": "single-chain", "versionExact": "single-chain" }, { "checksumSHA1": "1VsJIshz0loXnGwCtrMM8SuIo6Y=", "path": "github.com/dexon-foundation/dexon-consensus/core/utils", - "revision": "948be08a7294e26f3b52f94f9af803f69680f9df", - "revisionTime": "2019-04-09T09:36:40Z", + "revision": "b9492bc09f8bb53b2a36e505ddad0d26373e71a3", + "revisionTime": "2019-04-10T01:52:20Z", "version": "single-chain", "versionExact": "single-chain" }, |