Skip to main content

platform_version/version/fee/private_document/
mod.rs

1use bincode::{Decode, Encode};
2
3pub mod v1;
4
5/// Fees of an entry a `PrivateDocumentCreateFromShieldedPool` appends to a private document
6/// type's store (protocol version 15).
7///
8/// The transition pays a fixed fee out of the credit shielded pool, so it cannot be metered:
9/// its value balance must equal the fee exactly, and a wallet computes it before building the
10/// bundle. On top of the bundle's shielded fee, each entry pays its own bytes and
11/// `entry_overhead_bytes` at the storage rate, plus `entry_processing_fee`.
12///
13/// Every earlier schedule carries the same group; it is unread there because the transition
14/// is refused before protocol version 15.
15#[derive(Clone, Debug, Encode, Decode, Default, PartialEq, Eq)]
16pub struct FeePrivateDocumentVersion {
17    /// The flat credits each entry pays on top of its storage. It prices the scan every wallet
18    /// of the type makes of the entry, more than the work of storing it, so a flood of entries
19    /// costs what it makes others download.
20    pub entry_processing_fee: u64,
21    /// The bytes each entry is charged for beyond its own: Drive's 16-byte header, and what
22    /// GroveDB's append into the store adds per entry, the compaction of a full chunk shared out
23    /// among its entries, for every chunk power a store can take.
24    pub entry_overhead_bytes: u64,
25}