filecoin-project / eudico

lotus, but also other things
Other
19 stars 14 forks source link

Decouple the block reward logic and make it configurable #239

Open adlrocha opened 2 years ago

adlrocha commented 2 years ago

We currently use a flat reward logic in Eudico, where the validator that signs the block gets the full reward: https://github.com/filecoin-project/eudico/blob/b85d68f996bcc57a9c0e1bed62eee075a642370d/chain/consensus/common/executor.go#L222

This makes sense for longest-chain protocols, but in other consensus algorithms (like BFT) where the block validation is "collaborative", we should support other reward strategies. Having a configurable block reward also enables subnets to choose the incentive system that better suits them.

I propose to implement an interface for the block reward, and pass the desired reward scheme as an argument in subnets and consensus algorithms.