Remove duplicate read::hash()
and read::hash_by_height()
consensus-critical code
#5910
Labels
A-consensus
Area: Consensus rule updates
A-state
Area: State / database changes
C-bug
Category: This is a bug
Motivation
Zebra has two duplicate state functions for reading a block hash:
read::hash()
andread::hash_by_height()
. We don't want to have duplicate code in Zebra, because it risks breaking consensus. It's also hard to maintain and audit.This is a simple search-and-replace fix.
zebra/zebra-state/src/service/read/find.rs
Lines 111 to 112 in 53e836e
zebra/zebra-state/src/service/read/block.rs
Lines 187 to 190 in 53e836e
Testing
This change will improve testing, because the existing tests will all check the same function, rather than some tests checking one function, and some checking the other function.
Related Work
Discovered as part of PR #5894.
The text was updated successfully, but these errors were encountered: