diff --git a/crates/core/app/src/params/change.rs b/crates/core/app/src/params/change.rs index 6a88269091..d58b5c4b05 100644 --- a/crates/core/app/src/params/change.rs +++ b/crates/core/app/src/params/change.rs @@ -68,6 +68,7 @@ impl AppParameters { distributions_params: DistributionsParameters { staking_issuance_per_block: _, + liquidity_tournament_incentive_per_block: _, }, fee_params: FeeParameters { @@ -163,6 +164,7 @@ impl AppParameters { distributions_params: DistributionsParameters { staking_issuance_per_block: _, + liquidity_tournament_incentive_per_block: _, }, fee_params: FeeParameters { diff --git a/crates/core/component/distributions/src/params.rs b/crates/core/component/distributions/src/params.rs index 87c05730a7..62360e6a59 100644 --- a/crates/core/component/distributions/src/params.rs +++ b/crates/core/component/distributions/src/params.rs @@ -9,6 +9,7 @@ use serde::{Deserialize, Serialize}; )] pub struct DistributionsParameters { pub staking_issuance_per_block: u64, + pub liquidity_tournament_incentive_per_block: u64, } impl DomainType for DistributionsParameters { @@ -21,6 +22,7 @@ impl TryFrom for DistributionsParameters { fn try_from(msg: pb::DistributionsParameters) -> anyhow::Result { Ok(DistributionsParameters { staking_issuance_per_block: msg.staking_issuance_per_block, + liquidity_tournament_incentive_per_block: msg.liquidity_tournament_incentive_per_block, }) } } @@ -29,6 +31,8 @@ impl From for pb::DistributionsParameters { fn from(params: DistributionsParameters) -> Self { pb::DistributionsParameters { staking_issuance_per_block: params.staking_issuance_per_block, + liquidity_tournament_incentive_per_block: params + .liquidity_tournament_incentive_per_block, } } } @@ -37,6 +41,7 @@ impl Default for DistributionsParameters { fn default() -> Self { Self { staking_issuance_per_block: 1_000_000, + liquidity_tournament_incentive_per_block: 0, } } } diff --git a/crates/proto/src/gen/penumbra.core.component.distributions.v1.rs b/crates/proto/src/gen/penumbra.core.component.distributions.v1.rs index 8ad924095d..5c819c4835 100644 --- a/crates/proto/src/gen/penumbra.core.component.distributions.v1.rs +++ b/crates/proto/src/gen/penumbra.core.component.distributions.v1.rs @@ -5,6 +5,9 @@ pub struct DistributionsParameters { /// The amount of staking token issued per block. #[prost(uint64, tag = "1")] pub staking_issuance_per_block: u64, + /// The amount of staking token flowing from the community pool to the liquidity tournament each block. + #[prost(uint64, tag = "2")] + pub liquidity_tournament_incentive_per_block: u64, } impl ::prost::Name for DistributionsParameters { const NAME: &'static str = "DistributionsParameters"; diff --git a/crates/proto/src/gen/penumbra.core.component.distributions.v1.serde.rs b/crates/proto/src/gen/penumbra.core.component.distributions.v1.serde.rs index efe1238b66..228b37042a 100644 --- a/crates/proto/src/gen/penumbra.core.component.distributions.v1.serde.rs +++ b/crates/proto/src/gen/penumbra.core.component.distributions.v1.serde.rs @@ -9,12 +9,20 @@ impl serde::Serialize for DistributionsParameters { if self.staking_issuance_per_block != 0 { len += 1; } + if self.liquidity_tournament_incentive_per_block != 0 { + len += 1; + } let mut struct_ser = serializer.serialize_struct("penumbra.core.component.distributions.v1.DistributionsParameters", len)?; if self.staking_issuance_per_block != 0 { #[allow(clippy::needless_borrow)] #[allow(clippy::needless_borrows_for_generic_args)] struct_ser.serialize_field("stakingIssuancePerBlock", ToString::to_string(&self.staking_issuance_per_block).as_str())?; } + if self.liquidity_tournament_incentive_per_block != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("liquidityTournamentIncentivePerBlock", ToString::to_string(&self.liquidity_tournament_incentive_per_block).as_str())?; + } struct_ser.end() } } @@ -27,11 +35,14 @@ impl<'de> serde::Deserialize<'de> for DistributionsParameters { const FIELDS: &[&str] = &[ "staking_issuance_per_block", "stakingIssuancePerBlock", + "liquidity_tournament_incentive_per_block", + "liquidityTournamentIncentivePerBlock", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { StakingIssuancePerBlock, + LiquidityTournamentIncentivePerBlock, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -55,6 +66,7 @@ impl<'de> serde::Deserialize<'de> for DistributionsParameters { { match value { "stakingIssuancePerBlock" | "staking_issuance_per_block" => Ok(GeneratedField::StakingIssuancePerBlock), + "liquidityTournamentIncentivePerBlock" | "liquidity_tournament_incentive_per_block" => Ok(GeneratedField::LiquidityTournamentIncentivePerBlock), _ => Ok(GeneratedField::__SkipField__), } } @@ -75,6 +87,7 @@ impl<'de> serde::Deserialize<'de> for DistributionsParameters { V: serde::de::MapAccess<'de>, { let mut staking_issuance_per_block__ = None; + let mut liquidity_tournament_incentive_per_block__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::StakingIssuancePerBlock => { @@ -85,6 +98,14 @@ impl<'de> serde::Deserialize<'de> for DistributionsParameters { Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } + GeneratedField::LiquidityTournamentIncentivePerBlock => { + if liquidity_tournament_incentive_per_block__.is_some() { + return Err(serde::de::Error::duplicate_field("liquidityTournamentIncentivePerBlock")); + } + liquidity_tournament_incentive_per_block__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -92,6 +113,7 @@ impl<'de> serde::Deserialize<'de> for DistributionsParameters { } Ok(DistributionsParameters { staking_issuance_per_block: staking_issuance_per_block__.unwrap_or_default(), + liquidity_tournament_incentive_per_block: liquidity_tournament_incentive_per_block__.unwrap_or_default(), }) } } diff --git a/crates/proto/src/gen/proto_descriptor.bin.no_lfs b/crates/proto/src/gen/proto_descriptor.bin.no_lfs index f613403ab9..0a7803f013 100644 Binary files a/crates/proto/src/gen/proto_descriptor.bin.no_lfs and b/crates/proto/src/gen/proto_descriptor.bin.no_lfs differ diff --git a/proto/penumbra/penumbra/core/component/distributions/v1/distributions.proto b/proto/penumbra/penumbra/core/component/distributions/v1/distributions.proto index 035037e807..d91096d975 100644 --- a/proto/penumbra/penumbra/core/component/distributions/v1/distributions.proto +++ b/proto/penumbra/penumbra/core/component/distributions/v1/distributions.proto @@ -5,6 +5,8 @@ package penumbra.core.component.distributions.v1; message DistributionsParameters { // The amount of staking token issued per block. uint64 staking_issuance_per_block = 1; + // The amount of staking token flowing from the community pool to the liquidity tournament each block. + uint64 liquidity_tournament_incentive_per_block = 2; } // Genesis data for the distributions module.