diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-04-25 11:52:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-25 11:52:46 +0800 |
commit | 1ef1a2e7dc9f5e6ae2c586254156df7ffe73f785 (patch) | |
tree | 3a3153b020add8af35c037745f55b1e7e9384627 | |
parent | 32567bdc508391842c97b62abf446987d9827152 (diff) | |
download | dexon-1ef1a2e7dc9f5e6ae2c586254156df7ffe73f785.tar dexon-1ef1a2e7dc9f5e6ae2c586254156df7ffe73f785.tar.gz dexon-1ef1a2e7dc9f5e6ae2c586254156df7ffe73f785.tar.bz2 dexon-1ef1a2e7dc9f5e6ae2c586254156df7ffe73f785.tar.lz dexon-1ef1a2e7dc9f5e6ae2c586254156df7ffe73f785.tar.xz dexon-1ef1a2e7dc9f5e6ae2c586254156df7ffe73f785.tar.zst dexon-1ef1a2e7dc9f5e6ae2c586254156df7ffe73f785.zip |
vendor: sync to latest core (#394)v1.0.0
3 files changed, 30 insertions, 27 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 4e70ff087..3b4cdbbc8 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 @@ -70,6 +70,7 @@ type configurationChain struct { dkgLock sync.RWMutex dkgSigner map[uint64]*dkgShareSecret npks map[uint64]*typesDKG.NodePublicKeys + complaints []*typesDKG.Complaint dkgResult sync.RWMutex tsig map[common.Hash]*tsigProtocol tsigTouched map[common.Hash]struct{} @@ -321,8 +322,8 @@ func (cc *configurationChain) runDKGPhaseFour() { func (cc *configurationChain) runDKGPhaseFiveAndSix(round uint64, reset uint64) { // Phase 5(T = 2λ): Propose Anti nack complaint. cc.logger.Debug("Calling Governance.DKGComplaints", "round", round) - complaints := cc.gov.DKGComplaints(round) - if err := cc.dkg.processNackComplaints(complaints); err != nil { + cc.complaints = cc.gov.DKGComplaints(round) + if err := cc.dkg.processNackComplaints(cc.complaints); err != nil { cc.logger.Error("Failed to process NackComplaint", "round", round, "reset", reset, @@ -333,9 +334,9 @@ func (cc *configurationChain) runDKGPhaseFiveAndSix(round uint64, reset uint64) // Rebroadcast is done in `processPrivateShare`. } -func (cc *configurationChain) runDKGPhaseSeven(complaints []*typesDKG.Complaint) { +func (cc *configurationChain) runDKGPhaseSeven() { // Phase 7(T = 4λ): Enforce complaints and nack complaints. - cc.dkg.enforceNackComplaints(complaints) + cc.dkg.enforceNackComplaints(cc.complaints) // Enforce complaint is done in `processPrivateShare`. } @@ -425,8 +426,7 @@ func (cc *configurationChain) initDKGPhasesFunc() { return nil }, func(round uint64, reset uint64) error { - complaints := cc.gov.DKGComplaints(round) - cc.runDKGPhaseSeven(complaints) + cc.runDKGPhaseSeven() return nil }, func(round uint64, reset uint64) error { diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/dkg-tsig-protocol.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/dkg-tsig-protocol.go index 8383ad118..d4235a496 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/dkg-tsig-protocol.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/dkg-tsig-protocol.go @@ -392,6 +392,9 @@ func (d *dkgProtocol) processNackComplaints(complaints []*typesDKG.Complaint) ( func (d *dkgProtocol) enforceNackComplaints(complaints []*typesDKG.Complaint) { for _, complaint := range complaints { + if d.round != complaint.Round || d.reset != complaint.Reset { + continue + } if !complaint.IsNack() { continue } diff --git a/vendor/vendor.json b/vendor/vendor.json index 3eaeb7733..15a210812 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -141,16 +141,16 @@ { "checksumSHA1": "In6vBHYUsX7DUIGiFN2hQggBgvI=", "path": "github.com/dexon-foundation/dexon-consensus/common", - "revision": "3bc4cb2b9bb26c739d7e80daf42509628501758e", - "revisionTime": "2019-04-24T07:23:27Z", + "revision": "306d416fc794ddf803a1edc322ad7c7271743c9d", + "revisionTime": "2019-04-25T03:48:02Z", "version": "master", "versionExact": "master" }, { - "checksumSHA1": "q6i1dfbCBPnNz4w1NLF13v4++kg=", + "checksumSHA1": "ae/4yvDJ4EIe4hHn2GbHD/40mZ4=", "path": "github.com/dexon-foundation/dexon-consensus/core", - "revision": "3bc4cb2b9bb26c739d7e80daf42509628501758e", - "revisionTime": "2019-04-24T07:23:27Z", + "revision": "306d416fc794ddf803a1edc322ad7c7271743c9d", + "revisionTime": "2019-04-25T03:48:02Z", "version": "master", "versionExact": "master" }, @@ -165,64 +165,64 @@ { "checksumSHA1": "tQSbYCu5P00lUhKsx3IbBZCuSLY=", "path": "github.com/dexon-foundation/dexon-consensus/core/crypto", - "revision": "3bc4cb2b9bb26c739d7e80daf42509628501758e", - "revisionTime": "2019-04-24T07:23:27Z", + "revision": "306d416fc794ddf803a1edc322ad7c7271743c9d", + "revisionTime": "2019-04-25T03:48:02Z", "version": "master", "versionExact": "master" }, { "checksumSHA1": "4besQaa0rm8jRUAJjpEaLZ/ZOYs=", "path": "github.com/dexon-foundation/dexon-consensus/core/crypto/dkg", - "revision": "3bc4cb2b9bb26c739d7e80daf42509628501758e", - "revisionTime": "2019-04-24T07:23:27Z", + "revision": "306d416fc794ddf803a1edc322ad7c7271743c9d", + "revisionTime": "2019-04-25T03:48:02Z", "version": "master", "versionExact": "master" }, { "checksumSHA1": "BhLKK8RveoLaeXc9UyUKMwQqchU=", "path": "github.com/dexon-foundation/dexon-consensus/core/crypto/ecdsa", - "revision": "3bc4cb2b9bb26c739d7e80daf42509628501758e", - "revisionTime": "2019-04-24T07:23:27Z", + "revision": "306d416fc794ddf803a1edc322ad7c7271743c9d", + "revisionTime": "2019-04-25T03:48:02Z", "version": "master", "versionExact": "master" }, { "checksumSHA1": "3Ludp/1V4dMBZH/c1oIVjHj0CqY=", "path": "github.com/dexon-foundation/dexon-consensus/core/db", - "revision": "3bc4cb2b9bb26c739d7e80daf42509628501758e", - "revisionTime": "2019-04-24T07:23:27Z", + "revision": "306d416fc794ddf803a1edc322ad7c7271743c9d", + "revisionTime": "2019-04-25T03:48:02Z", "version": "master", "versionExact": "master" }, { "checksumSHA1": "sO5twEFTdLvkMuQo+I3vyzm9T3o=", "path": "github.com/dexon-foundation/dexon-consensus/core/syncer", - "revision": "3bc4cb2b9bb26c739d7e80daf42509628501758e", - "revisionTime": "2019-04-24T07:23:27Z", + "revision": "306d416fc794ddf803a1edc322ad7c7271743c9d", + "revisionTime": "2019-04-25T03:48:02Z", "version": "master", "versionExact": "master" }, { "checksumSHA1": "0BY+E0E2cM7IHIMqunXwoolDS5Y=", "path": "github.com/dexon-foundation/dexon-consensus/core/types", - "revision": "3bc4cb2b9bb26c739d7e80daf42509628501758e", - "revisionTime": "2019-04-24T07:23:27Z", + "revision": "306d416fc794ddf803a1edc322ad7c7271743c9d", + "revisionTime": "2019-04-25T03:48:02Z", "version": "master", "versionExact": "master" }, { "checksumSHA1": "yEPSfn48GaJmDbd2OFY+QRhjJ0w=", "path": "github.com/dexon-foundation/dexon-consensus/core/types/dkg", - "revision": "3bc4cb2b9bb26c739d7e80daf42509628501758e", - "revisionTime": "2019-04-24T07:23:27Z", + "revision": "306d416fc794ddf803a1edc322ad7c7271743c9d", + "revisionTime": "2019-04-25T03:48:02Z", "version": "master", "versionExact": "master" }, { "checksumSHA1": "51hQ5Wl/n9A5cu8t2yNIqfUuIR8=", "path": "github.com/dexon-foundation/dexon-consensus/core/utils", - "revision": "3bc4cb2b9bb26c739d7e80daf42509628501758e", - "revisionTime": "2019-04-24T07:23:27Z", + "revision": "306d416fc794ddf803a1edc322ad7c7271743c9d", + "revisionTime": "2019-04-25T03:48:02Z", "version": "master", "versionExact": "master" }, |