babylonchain / babylon

Main repo for Babylon full node
https://babylonchain.io
Other
230 stars 153 forks source link

finality: Merkle tree based public randomness commitment #655

Closed SebastianElvis closed 2 months ago

SebastianElvis commented 2 months ago

Closes #647

This PR implements the Merkle tree based public randomness commitment. This includes

Future works in subsequent PRs

SebastianElvis commented 2 months ago

Thanks guys for the comments! I have addressed all of them, most notably verifying proof index and removing public randomness storage. Please take a look again

SebastianElvis commented 2 months ago

One final note, I noticed that we store in state only half of the signature:

FinalitySig *github_com_babylonchain_babylon_types.SchnorrEOTSSig 

and I somehow though we store whole thine ie (R, s), thats why i was in favour of not storing R separately. I have a feeling, that it would be beneficial to store whole thing as otherwise other consumers do not have possibility of verifying those halfs. Not for this pr, but something to keep in mind.

Good point. Actually this is a reason why we should keep the pub rand storage. I added the pub rand storage back for this scenario in case a consumer wants to prove BTC staking finality to others.