From b742657e45e3310c63fae16aa9cfef11bd7ae969 Mon Sep 17 00:00:00 2001 From: teor Date: Thu, 29 Oct 2020 21:29:45 +1000 Subject: [PATCH] State RFC: Clarify genesis sprout anchors --- book/src/dev/rfcs/0005-state-updates.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/book/src/dev/rfcs/0005-state-updates.md b/book/src/dev/rfcs/0005-state-updates.md index ec97e5df..8a7e351f 100644 --- a/book/src/dev/rfcs/0005-state-updates.md +++ b/book/src/dev/rfcs/0005-state-updates.md @@ -663,13 +663,14 @@ check that `block`'s parent hash is `null` (all zeroes) and its height is `0`. - `(height, hash)` into `hash_by_height`; - `(height, block)` into `block_by_height`. -3. If the block is a genesis block, skip any transaction updates. +3. Update the `sprout_anchors` and `sapling_anchors` trees with the Sprout and + Sapling anchors. + +4. If the block is a genesis block, skip any transaction updates. (Due to a [bug in zcashd](https://github.com/ZcashFoundation/zebra/issues/559), genesis block transactions are ignored during validation.) -4. Update the `sprout_anchors` and `sapling_anchors` trees with the Sprout and Sapling anchors. - 5. Iterate over the enumerated transactions in the block. For each transaction: 1. Insert `(transaction_hash, BE32(block_height) || BE32(tx_index))` to @@ -695,6 +696,10 @@ transaction(s) in the block that have `JoinSplit`s in the Sprout case and/or `Spend`/`Output` descriptions in the Sapling case. These should be passed as fields in the `Commit*Block` requests. +Due to the coinbase maturity rules, the Sprout root is the empty root +for the first 100 blocks. (These rules are already implemented in contextual +validation and the anchor calculations.) + [`JoinSplit`]: https://doc.zebra.zfnd.org/zebra_chain/transaction/struct.JoinSplit.html [`Spend`]: https://doc.zebra.zfnd.org/zebra_chain/transaction/struct.Spend.html