From 269c1bbfac15235dd83db89e8fd3387606047386 Mon Sep 17 00:00:00 2001
From: capossele <angelocapossele@gmail.com>
Date: Fri, 20 Mar 2020 21:47:25 +0000
Subject: [PATCH] :lock: adds check on round and instance ID

---
 .../drng/subtypes/collectiveBeacon/collective_beacon.go   | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/packages/binary/drng/subtypes/collectiveBeacon/collective_beacon.go b/packages/binary/drng/subtypes/collectiveBeacon/collective_beacon.go
index f5f3a560..3e5d8fa0 100644
--- a/packages/binary/drng/subtypes/collectiveBeacon/collective_beacon.go
+++ b/packages/binary/drng/subtypes/collectiveBeacon/collective_beacon.go
@@ -52,6 +52,14 @@ func VerifyCollectiveBeacon(state *state.State, data *events.CollectiveBeaconEve
 		return errors.New("Distributed Public Key does not match")
 	}
 
+	if data.Round <= state.Randomness().Round {
+		return errors.New("invalid Round")
+	}
+
+	if data.InstanceID != state.Committee().InstanceID {
+		return errors.New("invalid instanceID")
+	}
+
 	if err := verifySignature(data); err != nil {
 		return err
 	}
-- 
GitLab