KomodoPlatform / zebra

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

Pull getblocktemplate code from upstream and add features for komodo #52

Open dimxy opened 1 year ago

dimxy commented 1 year ago

Description

Pull updates for the getblocktemplate rpc from the upstream repository Add komodo dPoW feature: ability to generate a special block (maybe better a different rpc?) Add support for the final sapling root hash in the block commitment

Details

1) The code must create a proper block template for mining. In addition to normally mined block creation, the code should also check if the current node is a notary (by looking a config param 'notary_pubkey' in the current season pubkey list). If it is a notary the code must check if it is possible to create a special block (no duplicate within last 65 blocks). If a special block is possible then create and return it to the caller. The special block should be marked in the rpc output by a property like 'is_special' But maybe better to create a special rpc for that?

2) The origin zebra does not support z-transaction before Canopy upgrade, but we need support for the sapling upgrade in block generation. So let's put the sapling root hash into the block commitment field in created block templates.