bosagora / agora

POC Node implementation for CoinNet
https://bosagora.io
MIT License
37 stars 23 forks source link

Validator shouldn't be able to sign when it is slashed at the current height #3296

Closed mkykadir closed 2 years ago

mkykadir commented 2 years ago

We've the following note; https://github.com/bosagora/agora/blob/ef399df66e9cf66def1406b0c34b4b25f668de30/source/agora/consensus/state/Ledger.d#L894-L896

and currently this block has this situation; where Validator 23 didn't revealed its preimage but looks like signed the block.

This prevents block sync from the network with following error;

Error [Ledger] Block#282: Signature's `s` mismatch: Expected **SCALAR**, got **SCALAR**
Info [Manager] - Retrieving blocks [282..444] from [agora://eu-002.bosagora.io:4826/].
hewison-chris commented 2 years ago

Will take a look at this one today.

linked0 commented 2 years ago

I found the same error on my validator enrolled at height 281, running on AWS.

[agora.network.Manager] - Retrieving blocks [282..438] from [agora://na-001.bosagora.io:3826/].
[agora.network.Manager] - Received blocks [282..305]
[agora.consensus.state.Ledger] - Block#282: Signature's `s` mismatch: Expected **SCALAR**, got **SCALAR**
hewison-chris commented 2 years ago

There are two bugs here: 1) The header should never have a signature added without the corresponding pre-image included. 2) The header should never pass validation with a signature added without the corresponding pre-image included.