From 90e38e73a85742575923e9e6dea8665bbfcb59af Mon Sep 17 00:00:00 2001 From: ChronosX88 Date: Sat, 14 Nov 2020 14:27:58 +0400 Subject: [PATCH] Add some docs of task validation process in consensus --- consensus/consensus.go | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/consensus/consensus.go b/consensus/consensus.go index 29f9068..219eaca 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -74,19 +74,15 @@ func (pcm *PBFTConsensusManager) handlePreparedMessage(message *models.Message) logrus.Debug("received prepared msg") data := pcm.Consensuses[consensusID] - //// validate payload data - //if data.test { - // rData := message.Payload["data"].(string) - // if rData != testValidData { - // logrus.Error("Incorrect data was received! Ignoring this message, because it was sent from fault node!") - // return - // } - //} else { - // // TODO - //} - + // TODO // here we can validate miner which produced this task, is he winner, and so on - // we must to reconstruct transaction here for validating task itself + // validation steps: + // 1. validate sender eligibility to mine (check if it has minimal stake) + // 2. validate sender wincount + // 3. validate randomness + // 4. validate vrf + // 5. validate payload signature + // 6. validate transaction (get from rpc client and compare with received) data.mutex.Lock() data.preparedCount++