cleanup(state): Update some outdated comments in the state & rpcs (#7434)

* Add a module cleanup TODO

* Fix an unrelated comment

* Update the comments about the bincode legacy format
This commit is contained in:
teor 2023-09-01 02:25:11 +10:00 committed by GitHub
parent 349af4d575
commit 735330618e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 5 deletions

View File

@ -41,6 +41,8 @@ use crate::methods::{
check_miner_address, check_synced_to_tip, fetch_mempool_transactions, check_miner_address, check_synced_to_tip, fetch_mempool_transactions,
fetch_state_tip_and_local_time, validate_block_proposal, fetch_state_tip_and_local_time, validate_block_proposal,
}, },
// TODO: move the types/* modules directly under get_block_template_rpcs,
// and combine any modules with the same names.
types::{ types::{
get_block_template::GetBlockTemplate, get_block_template::GetBlockTemplate,
get_mining_info, get_mining_info,

View File

@ -31,6 +31,13 @@ impl FromDisk for ValueBalance<NonNegative> {
} }
} }
// The following implementations for history trees use `serde` and
// `bincode`. `serde` serializations depend on the inner structure of the type.
// They should not be used in new code. (This is an issue for any derived serialization format.)
//
// We explicitly use `bincode::DefaultOptions` to disallow trailing bytes; see
// https://docs.rs/bincode/1.3.3/bincode/config/index.html#options-struct-vs-bincode-functions
#[derive(serde::Serialize, serde::Deserialize)] #[derive(serde::Serialize, serde::Deserialize)]
struct HistoryTreeParts { struct HistoryTreeParts {
network: Network, network: Network,

View File

@ -96,10 +96,10 @@ impl FromDisk for orchard::tree::Root {
} }
// The following implementations for the note commitment trees use `serde` and // The following implementations for the note commitment trees use `serde` and
// `bincode` because currently the inner Merkle tree frontier (from // `bincode`. `serde` serializations depend on the inner structure of the type.
// `incrementalmerkletree`) only supports `serde` for serialization. `bincode` // They should not be used in new code. (This is an issue for any derived serialization format.)
// was chosen because it is small and fast. We explicitly use `DefaultOptions` //
// in particular to disallow trailing bytes; see // We explicitly use `bincode::DefaultOptions` to disallow trailing bytes; see
// https://docs.rs/bincode/1.3.3/bincode/config/index.html#options-struct-vs-bincode-functions // https://docs.rs/bincode/1.3.3/bincode/config/index.html#options-struct-vs-bincode-functions
impl IntoDisk for sprout::tree::NoteCommitmentTree { impl IntoDisk for sprout::tree::NoteCommitmentTree {