diff options
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go | 12 | ||||
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/crypto/dkg/dkg.go | 50 | ||||
-rw-r--r-- | vendor/vendor.json | 44 |
3 files changed, 33 insertions, 73 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go index 370df72cf..0f665f29a 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go @@ -891,13 +891,11 @@ MessageLoop: ch, e := con.baConfirmedBlock[val.Hash] return ch, e }(); exist { - if err := con.bcModule.sanityCheck(val); err != nil { - if err == ErrRetrySanityCheckLater { - err = nil - } else { - con.logger.Error("SanityCheck failed", "error", err) - continue MessageLoop - } + if err := utils.VerifyBlockSignature(val); err != nil { + con.logger.Error("VerifyBlockSignature failed", + "block", val, + "error", err) + continue MessageLoop } func() { con.lock.Lock() diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/crypto/dkg/dkg.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/crypto/dkg/dkg.go index e43ebc806..f6b3e0e1b 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/crypto/dkg/dkg.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/crypto/dkg/dkg.go @@ -138,13 +138,6 @@ type PublicKeyShares struct { masterPublicKey []bls.PublicKey } -type rlpPublicKeyShares struct { - ShareCaches [][]byte - ShareCacheIndexK [][]byte - ShareCacheIndexV []uint32 - MasterPublicKey [][]byte -} - // Equal checks equality of two PublicKeyShares instance. func (pubs *PublicKeyShares) Equal(other *PublicKeyShares) bool { // Check shares. @@ -172,53 +165,22 @@ func (pubs *PublicKeyShares) Equal(other *PublicKeyShares) bool { // EncodeRLP implements rlp.Encoder func (pubs *PublicKeyShares) EncodeRLP(w io.Writer) error { - var rps rlpPublicKeyShares - for _, share := range pubs.shareCaches { - rps.ShareCaches = append(rps.ShareCaches, share.Serialize()) + mpks := make([][]byte, len(pubs.masterPublicKey)) + for i, m := range pubs.masterPublicKey { + mpks[i] = m.Serialize() } - - for id, v := range pubs.shareCacheIndex { - rps.ShareCacheIndexK = append( - rps.ShareCacheIndexK, id.GetLittleEndian()) - rps.ShareCacheIndexV = append(rps.ShareCacheIndexV, uint32(v)) - } - - for _, m := range pubs.masterPublicKey { - rps.MasterPublicKey = append(rps.MasterPublicKey, m.Serialize()) - } - - return rlp.Encode(w, rps) + return rlp.Encode(w, mpks) } // DecodeRLP implements rlp.Decoder func (pubs *PublicKeyShares) DecodeRLP(s *rlp.Stream) error { - var dec rlpPublicKeyShares + var dec [][]byte if err := s.Decode(&dec); err != nil { return err } - if len(dec.ShareCacheIndexK) != len(dec.ShareCacheIndexV) { - return fmt.Errorf("invalid shareIndex") - } - ps := NewEmptyPublicKeyShares() - for _, share := range dec.ShareCaches { - var publicKey PublicKey - if err := publicKey.Deserialize(share); err != nil { - return err - } - ps.shareCaches = append(ps.shareCaches, publicKey) - } - - for i, k := range dec.ShareCacheIndexK { - id, err := BytesID(k) - if err != nil { - return err - } - ps.shareCacheIndex[id] = int(dec.ShareCacheIndexV[i]) - } - - for _, k := range dec.MasterPublicKey { + for _, k := range dec { var key bls.PublicKey if err := key.Deserialize(k); err != nil { return err diff --git a/vendor/vendor.json b/vendor/vendor.json index 0955ef4dd..f23bffa07 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -141,16 +141,16 @@ { "checksumSHA1": "8EuKVkP1v/w5fRuuvUaXX5k/F+I=", "path": "github.com/dexon-foundation/dexon-consensus/common", - "revision": "d4b4c8a05e94f66c85e7b4238ae5947b26f13c40", - "revisionTime": "2019-03-04T10:30:03Z", + "revision": "aff897fd2385152a7bfd8a8ac0846ef5ad736b96", + "revisionTime": "2019-03-06T06:32:02Z", "version": "single-chain", "versionExact": "single-chain" }, { - "checksumSHA1": "RD3L08SnpZty2qH5mNERxYxB7gg=", + "checksumSHA1": "lBrWTbcqhk1+yYRdQ3185yJP5MQ=", "path": "github.com/dexon-foundation/dexon-consensus/core", - "revision": "d4b4c8a05e94f66c85e7b4238ae5947b26f13c40", - "revisionTime": "2019-03-04T10:30:03Z", + "revision": "aff897fd2385152a7bfd8a8ac0846ef5ad736b96", + "revisionTime": "2019-03-06T06:32:02Z", "version": "single-chain", "versionExact": "single-chain" }, @@ -165,64 +165,64 @@ { "checksumSHA1": "tQSbYCu5P00lUhKsx3IbBZCuSLY=", "path": "github.com/dexon-foundation/dexon-consensus/core/crypto", - "revision": "d4b4c8a05e94f66c85e7b4238ae5947b26f13c40", - "revisionTime": "2019-03-04T10:30:03Z", + "revision": "aff897fd2385152a7bfd8a8ac0846ef5ad736b96", + "revisionTime": "2019-03-06T06:32:02Z", "version": "single-chain", "versionExact": "single-chain" }, { - "checksumSHA1": "Nlv7pi1DIBftY+r6CFP8LBIQA3U=", + "checksumSHA1": "vTI0nncFqZ052WvofDhFxLw1Bk4=", "path": "github.com/dexon-foundation/dexon-consensus/core/crypto/dkg", - "revision": "d4b4c8a05e94f66c85e7b4238ae5947b26f13c40", - "revisionTime": "2019-03-04T10:30:03Z", + "revision": "aff897fd2385152a7bfd8a8ac0846ef5ad736b96", + "revisionTime": "2019-03-06T06:32:02Z", "version": "single-chain", "versionExact": "single-chain" }, { "checksumSHA1": "BhLKK8RveoLaeXc9UyUKMwQqchU=", "path": "github.com/dexon-foundation/dexon-consensus/core/crypto/ecdsa", - "revision": "d4b4c8a05e94f66c85e7b4238ae5947b26f13c40", - "revisionTime": "2019-03-04T10:30:03Z", + "revision": "aff897fd2385152a7bfd8a8ac0846ef5ad736b96", + "revisionTime": "2019-03-06T06:32:02Z", "version": "single-chain", "versionExact": "single-chain" }, { "checksumSHA1": "zpuCdMT8MGsy4pLgHKpg/Wd4izU=", "path": "github.com/dexon-foundation/dexon-consensus/core/db", - "revision": "d4b4c8a05e94f66c85e7b4238ae5947b26f13c40", - "revisionTime": "2019-03-04T10:30:03Z", + "revision": "aff897fd2385152a7bfd8a8ac0846ef5ad736b96", + "revisionTime": "2019-03-06T06:32:02Z", "version": "single-chain", "versionExact": "single-chain" }, { "checksumSHA1": "T9TNx0oUpaRdlbCuy7AvkK1eQ18=", "path": "github.com/dexon-foundation/dexon-consensus/core/syncer", - "revision": "d4b4c8a05e94f66c85e7b4238ae5947b26f13c40", - "revisionTime": "2019-03-04T10:30:03Z", + "revision": "aff897fd2385152a7bfd8a8ac0846ef5ad736b96", + "revisionTime": "2019-03-06T06:32:02Z", "version": "single-chain", "versionExact": "single-chain" }, { "checksumSHA1": "id8imcgp3SqYhIx0k3Chd0VZrUQ=", "path": "github.com/dexon-foundation/dexon-consensus/core/types", - "revision": "d4b4c8a05e94f66c85e7b4238ae5947b26f13c40", - "revisionTime": "2019-03-04T10:30:03Z", + "revision": "aff897fd2385152a7bfd8a8ac0846ef5ad736b96", + "revisionTime": "2019-03-06T06:32:02Z", "version": "single-chain", "versionExact": "single-chain" }, { "checksumSHA1": "s28gYj+iji8oT7N7Su6HIFHMuwI=", "path": "github.com/dexon-foundation/dexon-consensus/core/types/dkg", - "revision": "d4b4c8a05e94f66c85e7b4238ae5947b26f13c40", - "revisionTime": "2019-03-04T10:30:03Z", + "revision": "aff897fd2385152a7bfd8a8ac0846ef5ad736b96", + "revisionTime": "2019-03-06T06:32:02Z", "version": "single-chain", "versionExact": "single-chain" }, { "checksumSHA1": "C8Q8sfOSs+FPw/5sPwAR04QFc3U=", "path": "github.com/dexon-foundation/dexon-consensus/core/utils", - "revision": "d4b4c8a05e94f66c85e7b4238ae5947b26f13c40", - "revisionTime": "2019-03-04T10:30:03Z", + "revision": "aff897fd2385152a7bfd8a8ac0846ef5ad736b96", + "revisionTime": "2019-03-06T06:32:02Z", "version": "single-chain", "versionExact": "single-chain" }, |