aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-03-17 22:52:40 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:23 +0800
commit76d5bfcaf0a4c816842b561e3b3b995c1e766d1f (patch)
tree7eaee3fe61da79f7916ee1b654e5a6a6bab01e5c /core
parent6d4dd6853393014e6a355995dd91ecefd7a3095d (diff)
downloadgo-tangerine-76d5bfcaf0a4c816842b561e3b3b995c1e766d1f.tar
go-tangerine-76d5bfcaf0a4c816842b561e3b3b995c1e766d1f.tar.gz
go-tangerine-76d5bfcaf0a4c816842b561e3b3b995c1e766d1f.tar.bz2
go-tangerine-76d5bfcaf0a4c816842b561e3b3b995c1e766d1f.tar.lz
go-tangerine-76d5bfcaf0a4c816842b561e3b3b995c1e766d1f.tar.xz
go-tangerine-76d5bfcaf0a4c816842b561e3b3b995c1e766d1f.tar.zst
go-tangerine-76d5bfcaf0a4c816842b561e3b3b995c1e766d1f.zip
core: check reset of dkg types when adding (#268)
* vendor: sync to latest core * core: check dkg reset
Diffstat (limited to 'core')
-rw-r--r--core/vm/oracle_contracts.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/vm/oracle_contracts.go b/core/vm/oracle_contracts.go
index 56e82f7df..e58133990 100644
--- a/core/vm/oracle_contracts.go
+++ b/core/vm/oracle_contracts.go
@@ -1242,6 +1242,10 @@ func (g *GovernanceContract) addDKGComplaint(round *big.Int, comp []byte) ([]byt
return g.penalize()
}
+ if dkgComplaint.Reset != g.state.DKGResetCount(round).Uint64() {
+ return g.penalize()
+ }
+
// DKGComplaint must belongs to someone in DKG set.
if !g.inDKGSet(round, dkgComplaint.ProposerID) {
return g.penalize()
@@ -1324,6 +1328,10 @@ func (g *GovernanceContract) addDKGMasterPublicKey(round *big.Int, mpk []byte) (
return g.penalize()
}
+ if dkgMasterPK.Reset != g.state.DKGResetCount(round).Uint64() {
+ return g.penalize()
+ }
+
// DKGMasterPublicKey must belongs to someone in DKG set.
if !g.inDKGSet(round, dkgMasterPK.ProposerID) {
return g.penalize()
@@ -1350,6 +1358,10 @@ func (g *GovernanceContract) addDKGMPKReady(round *big.Int, ready []byte) ([]byt
return g.penalize()
}
+ if dkgReady.Reset != g.state.DKGResetCount(round).Uint64() {
+ return g.penalize()
+ }
+
// DKGFInalize must belongs to someone in DKG set.
if !g.inDKGSet(round, dkgReady.ProposerID) {
return g.penalize()
@@ -1380,6 +1392,10 @@ func (g *GovernanceContract) addDKGFinalize(round *big.Int, finalize []byte) ([]
return g.penalize()
}
+ if dkgFinalize.Reset != g.state.DKGResetCount(round).Uint64() {
+ return g.penalize()
+ }
+
// DKGFInalize must belongs to someone in DKG set.
if !g.inDKGSet(round, dkgFinalize.ProposerID) {
return g.penalize()