diff --git a/zebra-state/src/service/finalized_state.rs b/zebra-state/src/service/finalized_state.rs index 85d99491..b78a2ec5 100644 --- a/zebra-state/src/service/finalized_state.rs +++ b/zebra-state/src/service/finalized_state.rs @@ -246,9 +246,10 @@ impl FinalizedState { // TODO: sprout and sapling anchors (per block) - // Consensus-critical bug in zcashd: transactions in the - // genesis block are ignored. - if block.header.previous_block_hash == block::Hash([0; 32]) { + // "A transaction MUST NOT spend an output of the genesis block coinbase transaction. + // (There is one such zero-valued output, on each of Testnet and Mainnet .)" + // https://zips.z.cash/protocol/protocol.pdf#txnconsensus + if block.header.previous_block_hash == GENESIS_PREVIOUS_BLOCK_HASH { return batch; } @@ -258,7 +259,6 @@ impl FinalizedState { } // Index each transaction, spent inputs, nullifiers - // TODO: move computation into FinalizedBlock as with transparent outputs for (transaction_index, (transaction, transaction_hash)) in block .transactions .iter() diff --git a/zebra-state/src/service/finalized_state/disk_format.rs b/zebra-state/src/service/finalized_state/disk_format.rs index 4da8886d..fce669e9 100644 --- a/zebra-state/src/service/finalized_state/disk_format.rs +++ b/zebra-state/src/service/finalized_state/disk_format.rs @@ -235,7 +235,8 @@ impl IntoDisk for transparent::OutPoint { /// Helper trait for inserting (Key, Value) pairs into rocksdb with a consistently /// defined format pub trait DiskSerialize { - /// Serialize and insert the given key and value into a rocksdb column family. + /// Serialize and insert the given key and value into a rocksdb column family, + /// overwriting any existing `value` for `key`. fn zs_insert(&mut self, cf: &rocksdb::ColumnFamily, key: K, value: V) where K: IntoDisk + Debug,