KomodoPlatform / zebra

An ongoing Rust implementation of a Komodo node. 🦓
Apache License 2.0
3 stars 5 forks source link

Add block Sapling/Sprout Root check rules #58

Open dimxy opened 1 year ago

dimxy commented 1 year ago

Motivation

In zebra private transaction rules before the Canopy upgrade are not implemented as they are but covered by checkpoints. In komodo we must implement pre-Canopy block rules for the Sapling upgrade (as the Sapling upgrade is actual for komodo blockchain although private transactions are disabled now)

Specifications

Add code calculating the new sapling root, updated for block transactions (this actually must be a constant value as private transactions are disabled in komodo since 2019). Add a rule checking the block commitment which must contain valid Final Sapling Root hash (actual for the Sapling upgrade).

Note: komodo block index also contains calculated Final Sprout Root hash but it is never used so we do not need to implement it in komodo zebra.