eudico
eudico copied to clipboard
Verify block proposer belongs to the shard.
We currently accept every block from a valid miner that has followed the consensus algorithm we see in the shard's pubsub topic. We should only accept blocks that have been mined by a miner with mining rights in the shard (i.e. it is in the list of miners with enough stake in the shard). We need to add this check to validate blocks. This requires:
- Getting the state of the shard actor of the shards parent chain.
- Verifying that the block signer is one of the valid miners.
This may be quite straightforward: use a similar check to the one we use in delegated consensus to verify that the block was created by the designated producer: https://github.com/filecoin-project/eudico/blob/eudico/chain/consensus/delegcns/delegated.go#L120-L125