2020-08-15 21:55:28 -07:00
|
|
|
//! Consensus-critical serialization.
|
2019-09-15 06:37:16 -07:00
|
|
|
//!
|
|
|
|
//! This module contains four traits: `ZcashSerialize` and `ZcashDeserialize`,
|
|
|
|
//! analogs of the Serde `Serialize` and `Deserialize` traits but intended for
|
|
|
|
//! consensus-critical Zcash serialization formats, and `WriteZcashExt` and
|
|
|
|
//! `ReadZcashExt`, extension traits for `io::Read` and `io::Write` with utility functions
|
|
|
|
//! for reading and writing data (e.g., the Bitcoin variable-integer format).
|
2019-09-14 07:00:36 -07:00
|
|
|
|
2021-11-04 08:57:30 -07:00
|
|
|
mod compact_size;
|
2021-04-19 23:22:25 -07:00
|
|
|
mod constraint;
|
2021-05-30 19:52:34 -07:00
|
|
|
mod date_time;
|
2020-08-14 22:18:46 -07:00
|
|
|
mod error;
|
|
|
|
mod read_zcash;
|
|
|
|
mod write_zcash;
|
|
|
|
mod zcash_deserialize;
|
|
|
|
mod zcash_serialize;
|
|
|
|
|
2020-08-14 22:45:11 -07:00
|
|
|
pub mod sha256d;
|
|
|
|
|
2021-11-04 08:57:30 -07:00
|
|
|
pub(crate) mod serde_helpers;
|
|
|
|
|
2021-05-24 08:10:07 -07:00
|
|
|
#[cfg(any(test, feature = "proptest-impl"))]
|
|
|
|
pub mod arbitrary;
|
|
|
|
|
2021-11-04 08:57:30 -07:00
|
|
|
#[cfg(test)]
|
|
|
|
pub mod tests;
|
|
|
|
|
|
|
|
pub use compact_size::{CompactSize64, CompactSizeMessage};
|
2021-04-19 23:22:25 -07:00
|
|
|
pub use constraint::AtLeastOne;
|
2021-06-28 22:12:27 -07:00
|
|
|
pub use date_time::{DateTime32, Duration32};
|
2020-08-14 22:18:46 -07:00
|
|
|
pub use error::SerializationError;
|
2021-11-09 12:47:50 -08:00
|
|
|
pub use read_zcash::ReadZcashExt;
|
2020-08-14 22:18:46 -07:00
|
|
|
pub use write_zcash::WriteZcashExt;
|
2021-04-15 15:23:00 -07:00
|
|
|
pub use zcash_deserialize::{
|
Halborn 2023 02 20 (#6297)
* Limit version user agents to 256 bytes, rather than 2MB, needs failure tests
* Limit all inv messages to 50,000 entries, existing tests cover this
* Limit reject message strings based on network protocol, needs success and failure tests
* Catch up as fast as possible if inventory rotation is delayed, existing tests cover this
* Truncate inv channel hashes to 1000, needs success and failure tests
* Limit inv registry size to 4 MB, needs over-limit tests for inv and addr
* Test size constraints on version user agent, reject command, and reject reason (#13)
* Test inventory registry memory limits for hashes and peers (#14)
Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
---------
Co-authored-by: teor <teor@riseup.net>
Co-authored-by: Arya <aryasolhi@gmail.com>
2023-03-13 11:10:15 -07:00
|
|
|
zcash_deserialize_bytes_external_count, zcash_deserialize_external_count,
|
|
|
|
zcash_deserialize_string_external_count, TrustedPreallocate, ZcashDeserialize,
|
|
|
|
ZcashDeserializeInto,
|
2021-04-15 15:23:00 -07:00
|
|
|
};
|
|
|
|
pub use zcash_serialize::{
|
2021-11-04 08:57:30 -07:00
|
|
|
zcash_serialize_bytes, zcash_serialize_bytes_external_count, zcash_serialize_empty_list,
|
|
|
|
zcash_serialize_external_count, FakeWriter, ZcashSerialize, MAX_PROTOCOL_MESSAGE_LEN,
|
2021-04-15 15:23:00 -07:00
|
|
|
};
|