Skip to content

Commit

Permalink
Updates deferred pool funding stream name to "Lockbox", moves post-NU…
Browse files Browse the repository at this point in the history
…6 height ranges to constants, updates TODO
  • Loading branch information
arya2 committed Aug 1, 2024
1 parent 126fdab commit bf49432
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
27 changes: 24 additions & 3 deletions zebra-chain/src/parameters/network/subsidy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl FundingStreamReceiver {
FundingStreamReceiver::ZcashFoundation => "Zcash Foundation",
FundingStreamReceiver::MajorGrants => "Major Grants",
// TODO: Find out what this should be called and update the funding stream name
FundingStreamReceiver::Deferred => "Deferred Fund",
FundingStreamReceiver::Deferred => "Lockbox",
}
}
}
Expand Down Expand Up @@ -209,7 +209,7 @@ lazy_static! {
// TODO: Add a reference to lockbox stream ZIP, this is currently based on https://zips.z.cash/draft-nuttycom-funding-allocation
pub static ref POST_NU6_FUNDING_STREAMS_MAINNET: FundingStreams = FundingStreams {
// TODO: Adjust this height range and recipient list once a proposal is selected
height_range: Height(2_726_400)..Height(3_146_400),
height_range: POST_NU6_FUNDING_STREAM_START_RANGE_MAINNET,
recipients: [
(
FundingStreamReceiver::Deferred,
Expand Down Expand Up @@ -252,7 +252,7 @@ lazy_static! {
// start and end heights for Mainnet in https://zips.z.cash/draft-nuttycom-funding-allocation
pub static ref POST_NU6_FUNDING_STREAMS_TESTNET: FundingStreams = FundingStreams {
// TODO: Adjust this height range and recipient list once a proposal is selected
height_range: Height(2_942_000)..Height(3_362_000),
height_range: POST_NU6_FUNDING_STREAM_START_RANGE_TESTNET,
recipients: [
(
FundingStreamReceiver::Deferred,
Expand All @@ -269,6 +269,27 @@ lazy_static! {
};
}

/// The start height of post-NU6 funding streams on Mainnet
// TODO: Add a reference to lockbox stream ZIP, this is currently based on https://zips.z.cash/draft-nuttycom-funding-allocation
const POST_NU6_FUNDING_STREAM_START_HEIGHT_MAINNET: u32 = 2_726_400;

/// The start height of post-NU6 funding streams on Testnet
// TODO: Add a reference to lockbox stream ZIP, this is currently based on https://zips.z.cash/draft-nuttycom-funding-allocation
const POST_NU6_FUNDING_STREAM_START_HEIGHT_TESTNET: u32 = 2_942_000;

/// The number of blocks contained in the post-NU6 funding streams height ranges on Mainnet or Testnet.
const POST_NU6_FUNDING_STREAM_NUM_BLOCKS: u32 = 420_000;

/// The post-NU6 funding stream height range on Mainnet
const POST_NU6_FUNDING_STREAM_START_RANGE_MAINNET: std::ops::Range<Height> =
Height(POST_NU6_FUNDING_STREAM_START_HEIGHT_MAINNET)
..Height(POST_NU6_FUNDING_STREAM_START_HEIGHT_MAINNET + POST_NU6_FUNDING_STREAM_NUM_BLOCKS);

/// The post-NU6 funding stream height range on Testnet
const POST_NU6_FUNDING_STREAM_START_RANGE_TESTNET: std::ops::Range<Height> =
Height(POST_NU6_FUNDING_STREAM_START_HEIGHT_TESTNET)
..Height(POST_NU6_FUNDING_STREAM_START_HEIGHT_TESTNET + POST_NU6_FUNDING_STREAM_NUM_BLOCKS);

/// Address change interval function here as a constant
/// as described in [protocol specification §7.10.1][7.10.1].
///
Expand Down
2 changes: 1 addition & 1 deletion zebra-consensus/src/block/subsidy/general.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub fn output_amounts(transaction: &Transaction) -> HashSet<Amount<NonNegative>>
///
/// Assumes a constant funding stream amount per block.
// TODO: Cache the lockbox value balance in zebra-state (will be required for tracking lockbox
// value balance after ZSF ZIPs or after a ZIP for spending from the deferred pool)
// value balance after the Zcash Sustainability Fund ZIPs or after a ZIP for spending from the deferred pool)
#[allow(dead_code)]
fn lockbox_input_value(network: &Network, height: Height) -> Amount<NonNegative> {
let Some(nu6_activation_height) = Nu6.activation_height(network) else {
Expand Down

0 comments on commit bf49432

Please sign in to comment.