Errors are being bubbled up too much before causing a panic, leading to non-descriptive, shallow stack-traces.
Signatures of error-prone, None-prone functions are inconsistent. Some of them feature just Results, some of them feature just Options, and yet some of them feature Options wrapped in Results.
Multiple error cases are being quietly ignored because of improper use of if let statements.
Bug in how DataLen is being serialized (it is being serialized as a usize, whereas it is being deserialized as a u32).
KVGet trait does two different things at two different levels of abstraction: 1. Defines the interface of a readable key-value store, 2. Defines how to get the state variables of the Block Tree.
40.
Proposed organization
mod kv_store: Traits for pluggable state persistence.
trait KVStore: Read-and-write client for a generic key-value store.
trait KVSnapshot: Read-only, point-in-time view of a generic key-value store.
trait KVWriteBatch: Set of puts and deletes on a generic key-value store that are applied atomically.
mod block_tree: The persistent state of a replica.
pub mod common_getters: Getter functions common to BlockTreeSingleton and BlockTreeSnapshot.
pub mod common_setters: Setter functions common to BlockTreeSingleton and BlockTreeWriteBatch.
pub mod variables: Byte-prefixes that specify where each Block Tree Variable is stored.
pub(crate) mod safety: Predicates that ensure that the Block Tree is updated in a "safe" way.
pub mod singleton: Singleton used internally by the subprotocols to mutate the Block Tree.
pub mod snapshot: Read-only, point-in-time view of the Block Tree.
pub mod write_batch: Set of puts and deletes on the Block Tree that are applied atomically.
pub mod app_block_tree_view: Special, read-only, point-in-time view of the Block Tree used only by Apps.
Affected version
v0.4 (
dev/v0.4
)Problems
None
-prone functions are inconsistent. Some of them feature justResult
s, some of them feature justOption
s, and yet some of them featureOption
s wrapped inResult
s.if let
statements.DataLen
is being serialized (it is being serialized as ausize
, whereas it is being deserialized as au32
).KVGet
trait does two different things at two different levels of abstraction: 1. Defines the interface of a readable key-value store, 2. Defines how to get the state variables of the Block Tree.40.
Proposed organization
mod kv_store
: Traits for pluggable state persistence.trait KVStore
: Read-and-write client for a generic key-value store.trait KVSnapshot
: Read-only, point-in-time view of a generic key-value store.trait KVWriteBatch
: Set of puts and deletes on a generic key-value store that are applied atomically.mod block_tree
: The persistent state of a replica.pub mod common_getters
: Getter functions common toBlockTreeSingleton
andBlockTreeSnapshot
.pub mod common_setters
: Setter functions common toBlockTreeSingleton
andBlockTreeWriteBatch
.pub mod variables
: Byte-prefixes that specify where each Block Tree Variable is stored.pub(crate) mod safety
: Predicates that ensure that the Block Tree is updated in a "safe" way.pub mod singleton
: Singleton used internally by the subprotocols to mutate the Block Tree.pub mod snapshot
: Read-only, point-in-time view of the Block Tree.pub mod write_batch
: Set of puts and deletes on the Block Tree that are applied atomically.pub mod app_block_tree_view
: Special, read-only, point-in-time view of the Block Tree used only byApp
s.