diff --git a/Cargo.lock b/Cargo.lock index 54c2b7f43b..a548a129e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5129,6 +5129,7 @@ dependencies = [ "once_cell", "pbjson-types", "penumbra-asset", + "penumbra-auction", "penumbra-community-pool", "penumbra-dex", "penumbra-distributions", diff --git a/crates/bin/pcli/src/command/tx/proposal.rs b/crates/bin/pcli/src/command/tx/proposal.rs index 7027a884cd..19e1585240 100644 --- a/crates/bin/pcli/src/command/tx/proposal.rs +++ b/crates/bin/pcli/src/command/tx/proposal.rs @@ -97,6 +97,7 @@ impl ProposalKindCmd { ProposalKindCmd::ParameterChange => ProposalPayload::ParameterChange { old: Box::new(app_params.as_changed_params()), new: Box::new(ChangedAppParameters { + auction_params: None, community_pool_params: None, distributions_params: None, ibc_params: None, diff --git a/crates/cnidarium/src/gen/proto_descriptor.bin.no_lfs b/crates/cnidarium/src/gen/proto_descriptor.bin.no_lfs index 67d781308d..d50e1bd881 100644 Binary files a/crates/cnidarium/src/gen/proto_descriptor.bin.no_lfs and b/crates/cnidarium/src/gen/proto_descriptor.bin.no_lfs differ diff --git a/crates/core/app/src/app/mod.rs b/crates/core/app/src/app/mod.rs index e64db70186..f918e1c642 100644 --- a/crates/core/app/src/app/mod.rs +++ b/crates/core/app/src/app/mod.rs @@ -6,6 +6,7 @@ use cnidarium::{ArcStateDeltaExt, Snapshot, StateDelta, StateRead, StateWrite, S use cnidarium_component::Component; use ibc_types::core::connection::ChainId; use jmt::RootHash; +use penumbra_auction::component::{Auction, StateReadExt as _, StateWriteExt as _}; use penumbra_community_pool::component::{CommunityPool, StateWriteExt as _}; use penumbra_community_pool::StateReadExt as _; use penumbra_compact_block::component::CompactBlockManager; @@ -118,6 +119,7 @@ impl App { ) .await; Ibc::init_chain(&mut state_tx, Some(&genesis.ibc_content)).await; + Auction::init_chain(&mut state_tx, Some(&genesis.auction_content)).await; Dex::init_chain(&mut state_tx, Some(&genesis.dex_content)).await; CommunityPool::init_chain(&mut state_tx, Some(&genesis.community_pool_content)) .await; @@ -245,6 +247,9 @@ impl App { if let Some(dex_params) = app_params.new.dex_params { state_tx.put_dex_params(dex_params); } + if let Some(auction_params) = app_params.new.auction_params { + state_tx.put_auction_params(auction_params); + } } // Run each of the begin block handlers for each component, in sequence: @@ -257,6 +262,7 @@ impl App { begin_block, ) .await; + Auction::begin_block(&mut arc_state_tx, begin_block).await; Dex::begin_block(&mut arc_state_tx, begin_block).await; CommunityPool::begin_block(&mut arc_state_tx, begin_block).await; Governance::begin_block(&mut arc_state_tx, begin_block).await; @@ -387,6 +393,7 @@ impl App { ShieldedPool::end_block(&mut arc_state_tx, end_block).await; Distributions::end_block(&mut arc_state_tx, end_block).await; Ibc::end_block(&mut arc_state_tx, end_block).await; + Auction::end_block(&mut arc_state_tx, end_block).await; Dex::end_block(&mut arc_state_tx, end_block).await; CommunityPool::end_block(&mut arc_state_tx, end_block).await; Governance::end_block(&mut arc_state_tx, end_block).await; @@ -496,6 +503,9 @@ impl App { Ibc::end_epoch(&mut arc_state_tx) .await .expect("able to call end_epoch on IBC component"); + Auction::end_epoch(&mut arc_state_tx) + .await + .expect("able to call end_epoch on auction component"); Dex::end_epoch(&mut arc_state_tx) .await .expect("able to call end_epoch on dex component"); @@ -691,9 +701,11 @@ pub trait StateReadExt: StateRead { let shielded_pool_params = self.get_shielded_pool_params().await?; let stake_params = self.get_stake_params().await?; let dex_params = self.get_dex_params().await?; + let auction_params = self.get_auction_params().await?; Ok(AppParameters { chain_id, + auction_params, community_pool_params, distributions_params, fee_params, diff --git a/crates/core/app/src/genesis.rs b/crates/core/app/src/genesis.rs index 942cd80331..32d01944bf 100644 --- a/crates/core/app/src/genesis.rs +++ b/crates/core/app/src/genesis.rs @@ -1,3 +1,4 @@ +use penumbra_auction::genesis::Content as AuctionContent; use penumbra_community_pool::genesis::Content as CommunityPoolContent; use penumbra_dex::genesis::Content as DexContent; use penumbra_distributions::genesis::Content as DistributionsContent; @@ -47,6 +48,8 @@ pub struct Content { pub stake_content: StakeContent, /// Dex component genesis state. pub dex_content: DexContent, + /// Auction component genesis state. + pub auction_content: AuctionContent, } impl DomainType for Content { @@ -78,6 +81,7 @@ impl From for pb::GenesisContent { fn from(genesis: Content) -> Self { pb::GenesisContent { chain_id: genesis.chain_id, + auction_content: Some(genesis.auction_content.into()), community_pool_content: Some(genesis.community_pool_content.into()), distributions_content: Some(genesis.distributions_content.into()), fee_content: Some(genesis.fee_content.into()), @@ -116,6 +120,10 @@ impl TryFrom for Content { fn try_from(msg: pb::GenesisContent) -> Result { Ok(Content { chain_id: msg.chain_id, + auction_content: msg + .auction_content + .ok_or_else(|| anyhow::anyhow!("proto response missing Auction content"))? + .try_into()?, community_pool_content: msg .community_pool_content .ok_or_else(|| anyhow::anyhow!("proto response missing Community Pool content"))? diff --git a/crates/core/app/src/params.rs b/crates/core/app/src/params.rs index ab89d130b0..691999fb42 100644 --- a/crates/core/app/src/params.rs +++ b/crates/core/app/src/params.rs @@ -1,3 +1,4 @@ +use penumbra_auction::params::AuctionParameters; use penumbra_community_pool::params::CommunityPoolParameters; use penumbra_dex::DexParameters; use penumbra_distributions::DistributionsParameters; @@ -19,6 +20,7 @@ pub mod change; #[serde(try_from = "pb::AppParameters", into = "pb::AppParameters")] pub struct AppParameters { pub chain_id: String, + pub auction_params: AuctionParameters, pub community_pool_params: CommunityPoolParameters, pub distributions_params: DistributionsParameters, pub dex_params: DexParameters, @@ -41,6 +43,10 @@ impl TryFrom for AppParameters { fn try_from(msg: pb::AppParameters) -> anyhow::Result { Ok(AppParameters { chain_id: msg.chain_id, + auction_params: msg + .auction_params + .ok_or_else(|| anyhow::anyhow!("proto response missing auction params"))? + .try_into()?, community_pool_params: msg .community_pool_params .ok_or_else(|| anyhow::anyhow!("proto response missing community pool params"))? @@ -89,6 +95,7 @@ impl From for pb::AppParameters { fn from(params: AppParameters) -> Self { pb::AppParameters { chain_id: params.chain_id, + auction_params: Some(params.auction_params.into()), community_pool_params: Some(params.community_pool_params.into()), distributions_params: Some(params.distributions_params.into()), fee_params: Some(params.fee_params.into()), diff --git a/crates/core/app/src/params/change.rs b/crates/core/app/src/params/change.rs index 78ff79d57d..1b25faf869 100644 --- a/crates/core/app/src/params/change.rs +++ b/crates/core/app/src/params/change.rs @@ -1,6 +1,7 @@ use std::fmt::Display; use anyhow::Result; +use penumbra_auction::params::AuctionParameters; use penumbra_community_pool::params::CommunityPoolParameters; use penumbra_dex::DexParameters; use penumbra_distributions::params::DistributionsParameters; @@ -27,6 +28,7 @@ impl AppParameters { // Tracked by #3593 let AppParameters { chain_id, + auction_params: AuctionParameters {}, community_pool_params: CommunityPoolParameters { community_pool_spend_proposals_enabled: _, @@ -122,6 +124,7 @@ impl AppParameters { pub fn check_valid(&self) -> Result<()> { let AppParameters { chain_id, + auction_params: AuctionParameters {}, community_pool_params: CommunityPoolParameters { community_pool_spend_proposals_enabled: _, @@ -252,6 +255,7 @@ impl AppParameters { /// Converts an `AppParameters` instance to a complete `ChangedAppParameters`. pub fn as_changed_params(&self) -> ChangedAppParameters { ChangedAppParameters { + auction_params: Some(self.auction_params.clone()), community_pool_params: Some(self.community_pool_params.clone()), distributions_params: Some(self.distributions_params.clone()), fee_params: Some(self.fee_params.clone()), @@ -283,7 +287,8 @@ impl AppParameters { || new.ibc_params.is_none() || new.sct_params.is_none() || new.shielded_pool_params.is_none() - || new.stake_params.is_none()) + || new.stake_params.is_none() + || new.auction_params.is_none()) { anyhow::bail!("all parameters must be specified if no old parameters are provided"); } @@ -296,6 +301,11 @@ impl AppParameters { .expect("old should be set if new has any None values") .chain_id .clone(), + auction_params: new.auction_params.clone().unwrap_or_else(|| { + old.expect("old should be set if new has any None values") + .auction_params + .clone() + }), community_pool_params: new.community_pool_params.clone().unwrap_or_else(|| { old.expect("old should be set if new has any None values") .community_pool_params diff --git a/crates/core/component/auction/src/component/auction.rs b/crates/core/component/auction/src/component/auction.rs index 2cd60cdc33..7a7e215431 100644 --- a/crates/core/component/auction/src/component/auction.rs +++ b/crates/core/component/auction/src/component/auction.rs @@ -3,21 +3,29 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; use cnidarium_component::Component; +use penumbra_proto::StateReadProto; +use penumbra_proto::StateWriteProto; use std::sync::Arc; use tendermint::v0_37::abci; use tracing::instrument; +use crate::{params::AuctionParameters, state_key}; + pub struct Auction {} #[async_trait] impl Component for Auction { - type AppState = (); + // Note: this is currently empty, but will make future + // addition easy to do. + type AppState = crate::genesis::Content; - #[instrument(name = "auction", skip(_state, app_state))] - async fn init_chain(_state: S, app_state: Option<&Self::AppState>) { + #[instrument(name = "auction", skip(state, app_state))] + async fn init_chain(mut state: S, app_state: Option<&Self::AppState>) { match app_state { None => { /* perform upgrade specific check */ } - Some(&()) => {} + Some(content) => { + state.put_auction_params(content.auction_params.clone()); + } } } @@ -46,14 +54,30 @@ impl Component for Auction { /// Extension trait providing read access to auction data. #[async_trait] pub trait StateReadExt: StateRead { - // Params accessors + async fn get_auction_params(&self) -> Result { + self.get(state_key::parameters::key()) + .await + .expect("no deserialization errors") + .ok_or_else(|| anyhow::anyhow!("Missing AuctionParameters")) + } + + fn auction_params_updated(&self) -> bool { + self.object_get::<()>(state_key::parameters::updated_flag()) + .is_some() + } } impl StateReadExt for T {} /// Extension trait providing write access to auction data. #[async_trait] -pub trait StateWriteExt: StateWrite {} +pub trait StateWriteExt: StateWrite { + /// Writes the provided auction parameters to the chain state. + fn put_auction_params(&mut self, params: AuctionParameters) { + self.object_put(state_key::parameters::updated_flag(), ()); + self.put(state_key::parameters::key().into(), params) + } +} impl StateWriteExt for T {} diff --git a/crates/core/component/auction/src/component/mod.rs b/crates/core/component/auction/src/component/mod.rs index 58d81c2f8e..f669f55bbb 100644 --- a/crates/core/component/auction/src/component/mod.rs +++ b/crates/core/component/auction/src/component/mod.rs @@ -6,6 +6,7 @@ pub mod metrics; pub mod rpc; mod trigger_data; +pub use auction::Auction; pub use auction::{StateReadExt, StateWriteExt}; pub(crate) use auction_store::AuctionStoreRead; pub(crate) use dutch_auction::DutchAuctionManager; diff --git a/crates/core/component/auction/src/genesis.rs b/crates/core/component/auction/src/genesis.rs index 77a6f93fee..84ee043ec1 100644 --- a/crates/core/component/auction/src/genesis.rs +++ b/crates/core/component/auction/src/genesis.rs @@ -18,7 +18,7 @@ impl DomainType for Content { impl From for pb::GenesisContent { fn from(value: Content) -> Self { pb::GenesisContent { - auction_params: Some(value.auction_params.into()), + params: Some(value.auction_params.into()), } } } @@ -29,7 +29,7 @@ impl TryFrom for Content { fn try_from(msg: pb::GenesisContent) -> Result { Ok(Content { auction_params: msg - .auction_params + .params .context("auction params not present in protobuf message")? .try_into()?, }) diff --git a/crates/core/component/auction/src/lib.rs b/crates/core/component/auction/src/lib.rs index cf2f70ab1d..fead922719 100644 --- a/crates/core/component/auction/src/lib.rs +++ b/crates/core/component/auction/src/lib.rs @@ -3,6 +3,7 @@ #![deny(clippy::unwrap_used)] pub mod auction; +pub mod genesis; pub mod params; pub mod state_key; diff --git a/crates/core/component/auction/src/params.rs b/crates/core/component/auction/src/params.rs index b60752e7af..a257468c28 100644 --- a/crates/core/component/auction/src/params.rs +++ b/crates/core/component/auction/src/params.rs @@ -23,3 +23,9 @@ impl TryFrom for AuctionParameters { Ok(AuctionParameters {}) } } + +impl Default for AuctionParameters { + fn default() -> Self { + AuctionParameters {} + } +} diff --git a/crates/core/component/governance/Cargo.toml b/crates/core/component/governance/Cargo.toml index b0153836ea..48cb7b75e3 100644 --- a/crates/core/component/governance/Cargo.toml +++ b/crates/core/component/governance/Cargo.toml @@ -50,6 +50,7 @@ metrics = {workspace = true} once_cell = {workspace = true} pbjson-types = {workspace = true} penumbra-asset = {workspace = true, default-features = false} +penumbra-auction = {workspace = true, default-features = false} penumbra-community-pool = {workspace = true, default-features = false} penumbra-distributions = {workspace = true, default-features = false} penumbra-fee = {workspace = true, default-features = false} diff --git a/crates/core/component/governance/src/proposal.rs b/crates/core/component/governance/src/proposal.rs index fc1f75429a..15acff232e 100644 --- a/crates/core/component/governance/src/proposal.rs +++ b/crates/core/component/governance/src/proposal.rs @@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize}; use std::str::FromStr; use crate::params::GovernanceParameters; +use penumbra_auction::params::AuctionParameters; use penumbra_community_pool::params::CommunityPoolParameters; use penumbra_dex::DexParameters; use penumbra_distributions::params::DistributionsParameters; @@ -436,6 +437,7 @@ impl ProposalPayload { into = "pb::ChangedAppParameters" )] pub struct ChangedAppParameters { + pub auction_params: Option, pub community_pool_params: Option, pub distributions_params: Option, pub ibc_params: Option, @@ -457,6 +459,7 @@ impl TryFrom for ChangedAppParameters { fn try_from(msg: pb::ChangedAppParameters) -> anyhow::Result { Ok(ChangedAppParameters { + auction_params: msg.auction_params.map(TryInto::try_into).transpose()?, community_pool_params: msg .community_pool_params .map(TryInto::try_into) @@ -483,6 +486,7 @@ impl TryFrom for ChangedAppParameters { impl From for pb::ChangedAppParameters { fn from(params: ChangedAppParameters) -> Self { pb::ChangedAppParameters { + auction_params: params.auction_params.map(Into::into), community_pool_params: params.community_pool_params.map(Into::into), distributions_params: params.distributions_params.map(Into::into), fee_params: params.fee_params.map(Into::into), diff --git a/crates/proto/src/gen/penumbra.core.app.v1.rs b/crates/proto/src/gen/penumbra.core.app.v1.rs index 03f022040f..0fea6965d8 100644 --- a/crates/proto/src/gen/penumbra.core.app.v1.rs +++ b/crates/proto/src/gen/penumbra.core.app.v1.rs @@ -89,6 +89,11 @@ pub struct AppParameters { pub dex_params: ::core::option::Option< super::super::component::dex::v1::DexParameters, >, + /// Auction module parameters. + #[prost(message, optional, tag = "12")] + pub auction_params: ::core::option::Option< + super::super::component::auction::v1alpha1::AuctionParameters, + >, } impl ::prost::Name for AppParameters { const NAME: &'static str = "AppParameters"; @@ -201,6 +206,11 @@ pub struct GenesisContent { pub dex_content: ::core::option::Option< super::super::component::dex::v1::GenesisContent, >, + /// Auction component genesis state. + #[prost(message, optional, tag = "12")] + pub auction_content: ::core::option::Option< + super::super::component::auction::v1alpha1::GenesisContent, + >, } impl ::prost::Name for GenesisContent { const NAME: &'static str = "GenesisContent"; diff --git a/crates/proto/src/gen/penumbra.core.app.v1.serde.rs b/crates/proto/src/gen/penumbra.core.app.v1.serde.rs index 6175e5c32d..9b910dd7fe 100644 --- a/crates/proto/src/gen/penumbra.core.app.v1.serde.rs +++ b/crates/proto/src/gen/penumbra.core.app.v1.serde.rs @@ -39,6 +39,9 @@ impl serde::Serialize for AppParameters { if self.dex_params.is_some() { len += 1; } + if self.auction_params.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("penumbra.core.app.v1.AppParameters", len)?; if !self.chain_id.is_empty() { struct_ser.serialize_field("chainId", &self.chain_id)?; @@ -73,6 +76,9 @@ impl serde::Serialize for AppParameters { if let Some(v) = self.dex_params.as_ref() { struct_ser.serialize_field("dexParams", v)?; } + if let Some(v) = self.auction_params.as_ref() { + struct_ser.serialize_field("auctionParams", v)?; + } struct_ser.end() } } @@ -105,6 +111,8 @@ impl<'de> serde::Deserialize<'de> for AppParameters { "shieldedPoolParams", "dex_params", "dexParams", + "auction_params", + "auctionParams", ]; #[allow(clippy::enum_variant_names)] @@ -120,6 +128,7 @@ impl<'de> serde::Deserialize<'de> for AppParameters { FundingParams, ShieldedPoolParams, DexParams, + AuctionParams, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -153,6 +162,7 @@ impl<'de> serde::Deserialize<'de> for AppParameters { "fundingParams" | "funding_params" => Ok(GeneratedField::FundingParams), "shieldedPoolParams" | "shielded_pool_params" => Ok(GeneratedField::ShieldedPoolParams), "dexParams" | "dex_params" => Ok(GeneratedField::DexParams), + "auctionParams" | "auction_params" => Ok(GeneratedField::AuctionParams), _ => Ok(GeneratedField::__SkipField__), } } @@ -183,6 +193,7 @@ impl<'de> serde::Deserialize<'de> for AppParameters { let mut funding_params__ = None; let mut shielded_pool_params__ = None; let mut dex_params__ = None; + let mut auction_params__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::ChainId => { @@ -251,6 +262,12 @@ impl<'de> serde::Deserialize<'de> for AppParameters { } dex_params__ = map_.next_value()?; } + GeneratedField::AuctionParams => { + if auction_params__.is_some() { + return Err(serde::de::Error::duplicate_field("auctionParams")); + } + auction_params__ = map_.next_value()?; + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -268,6 +285,7 @@ impl<'de> serde::Deserialize<'de> for AppParameters { funding_params: funding_params__, shielded_pool_params: shielded_pool_params__, dex_params: dex_params__, + auction_params: auction_params__, }) } } @@ -598,6 +616,9 @@ impl serde::Serialize for GenesisContent { if self.dex_content.is_some() { len += 1; } + if self.auction_content.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("penumbra.core.app.v1.GenesisContent", len)?; if !self.chain_id.is_empty() { struct_ser.serialize_field("chainId", &self.chain_id)?; @@ -632,6 +653,9 @@ impl serde::Serialize for GenesisContent { if let Some(v) = self.dex_content.as_ref() { struct_ser.serialize_field("dexContent", v)?; } + if let Some(v) = self.auction_content.as_ref() { + struct_ser.serialize_field("auctionContent", v)?; + } struct_ser.end() } } @@ -664,6 +688,8 @@ impl<'de> serde::Deserialize<'de> for GenesisContent { "fundingContent", "dex_content", "dexContent", + "auction_content", + "auctionContent", ]; #[allow(clippy::enum_variant_names)] @@ -679,6 +705,7 @@ impl<'de> serde::Deserialize<'de> for GenesisContent { DistributionsContent, FundingContent, DexContent, + AuctionContent, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -712,6 +739,7 @@ impl<'de> serde::Deserialize<'de> for GenesisContent { "distributionsContent" | "distributions_content" => Ok(GeneratedField::DistributionsContent), "fundingContent" | "funding_content" => Ok(GeneratedField::FundingContent), "dexContent" | "dex_content" => Ok(GeneratedField::DexContent), + "auctionContent" | "auction_content" => Ok(GeneratedField::AuctionContent), _ => Ok(GeneratedField::__SkipField__), } } @@ -742,6 +770,7 @@ impl<'de> serde::Deserialize<'de> for GenesisContent { let mut distributions_content__ = None; let mut funding_content__ = None; let mut dex_content__ = None; + let mut auction_content__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::ChainId => { @@ -810,6 +839,12 @@ impl<'de> serde::Deserialize<'de> for GenesisContent { } dex_content__ = map_.next_value()?; } + GeneratedField::AuctionContent => { + if auction_content__.is_some() { + return Err(serde::de::Error::duplicate_field("auctionContent")); + } + auction_content__ = map_.next_value()?; + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -827,6 +862,7 @@ impl<'de> serde::Deserialize<'de> for GenesisContent { distributions_content: distributions_content__, funding_content: funding_content__, dex_content: dex_content__, + auction_content: auction_content__, }) } } diff --git a/crates/proto/src/gen/penumbra.core.component.governance.v1.rs b/crates/proto/src/gen/penumbra.core.component.governance.v1.rs index a6a86c12b5..59ede0ba17 100644 --- a/crates/proto/src/gen/penumbra.core.component.governance.v1.rs +++ b/crates/proto/src/gen/penumbra.core.component.governance.v1.rs @@ -1046,6 +1046,11 @@ pub struct ChangedAppParameters { /// DEX component parameters #[prost(message, optional, tag = "10")] pub dex_params: ::core::option::Option, + /// Auction module parameters. + #[prost(message, optional, tag = "11")] + pub auction_params: ::core::option::Option< + super::super::auction::v1alpha1::AuctionParameters, + >, } impl ::prost::Name for ChangedAppParameters { const NAME: &'static str = "ChangedAppParameters"; diff --git a/crates/proto/src/gen/penumbra.core.component.governance.v1.serde.rs b/crates/proto/src/gen/penumbra.core.component.governance.v1.serde.rs index 7782c8ea80..a531d38884 100644 --- a/crates/proto/src/gen/penumbra.core.component.governance.v1.serde.rs +++ b/crates/proto/src/gen/penumbra.core.component.governance.v1.serde.rs @@ -248,6 +248,9 @@ impl serde::Serialize for ChangedAppParameters { if self.dex_params.is_some() { len += 1; } + if self.auction_params.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("penumbra.core.component.governance.v1.ChangedAppParameters", len)?; if let Some(v) = self.sct_params.as_ref() { struct_ser.serialize_field("sctParams", v)?; @@ -279,6 +282,9 @@ impl serde::Serialize for ChangedAppParameters { if let Some(v) = self.dex_params.as_ref() { struct_ser.serialize_field("dexParams", v)?; } + if let Some(v) = self.auction_params.as_ref() { + struct_ser.serialize_field("auctionParams", v)?; + } struct_ser.end() } } @@ -309,6 +315,8 @@ impl<'de> serde::Deserialize<'de> for ChangedAppParameters { "shieldedPoolParams", "dex_params", "dexParams", + "auction_params", + "auctionParams", ]; #[allow(clippy::enum_variant_names)] @@ -323,6 +331,7 @@ impl<'de> serde::Deserialize<'de> for ChangedAppParameters { FundingParams, ShieldedPoolParams, DexParams, + AuctionParams, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -355,6 +364,7 @@ impl<'de> serde::Deserialize<'de> for ChangedAppParameters { "fundingParams" | "funding_params" => Ok(GeneratedField::FundingParams), "shieldedPoolParams" | "shielded_pool_params" => Ok(GeneratedField::ShieldedPoolParams), "dexParams" | "dex_params" => Ok(GeneratedField::DexParams), + "auctionParams" | "auction_params" => Ok(GeneratedField::AuctionParams), _ => Ok(GeneratedField::__SkipField__), } } @@ -384,6 +394,7 @@ impl<'de> serde::Deserialize<'de> for ChangedAppParameters { let mut funding_params__ = None; let mut shielded_pool_params__ = None; let mut dex_params__ = None; + let mut auction_params__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::SctParams => { @@ -446,6 +457,12 @@ impl<'de> serde::Deserialize<'de> for ChangedAppParameters { } dex_params__ = map_.next_value()?; } + GeneratedField::AuctionParams => { + if auction_params__.is_some() { + return Err(serde::de::Error::duplicate_field("auctionParams")); + } + auction_params__ = map_.next_value()?; + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -462,6 +479,7 @@ impl<'de> serde::Deserialize<'de> for ChangedAppParameters { funding_params: funding_params__, shielded_pool_params: shielded_pool_params__, dex_params: dex_params__, + auction_params: auction_params__, }) } } diff --git a/crates/proto/src/gen/proto_descriptor.bin.no_lfs b/crates/proto/src/gen/proto_descriptor.bin.no_lfs index 08c1adaeae..6ffdd0c103 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/app/v1/app.proto b/proto/penumbra/penumbra/core/app/v1/app.proto index be62b0b129..32f51d495f 100644 --- a/proto/penumbra/penumbra/core/app/v1/app.proto +++ b/proto/penumbra/penumbra/core/app/v1/app.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package penumbra.core.app.v1; +import "penumbra/core/component/auction/v1alpha1/auction.proto"; import "penumbra/core/component/community_pool/v1/community_pool.proto"; import "penumbra/core/component/dex/v1/dex.proto"; import "penumbra/core/component/distributions/v1/distributions.proto"; @@ -58,6 +59,8 @@ message AppParameters { core.component.shielded_pool.v1.ShieldedPoolParameters shielded_pool_params = 10; // DEX module parameters. core.component.dex.v1.DexParameters dex_params = 11; + // Auction module parameters. + core.component.auction.v1alpha1.AuctionParameters auction_params = 12; } // Requests the global configuration data for the app. @@ -97,4 +100,6 @@ message GenesisContent { core.component.funding.v1.GenesisContent funding_content = 10; // DEX component genesis state. core.component.dex.v1.GenesisContent dex_content = 11; + // Auction component genesis state. + core.component.auction.v1alpha1.GenesisContent auction_content = 12; } diff --git a/proto/penumbra/penumbra/core/component/governance/v1/governance.proto b/proto/penumbra/penumbra/core/component/governance/v1/governance.proto index eebc212283..f9ce96f9ea 100644 --- a/proto/penumbra/penumbra/core/component/governance/v1/governance.proto +++ b/proto/penumbra/penumbra/core/component/governance/v1/governance.proto @@ -3,6 +3,7 @@ package penumbra.core.component.governance.v1; import "google/protobuf/any.proto"; import "penumbra/core/asset/v1/asset.proto"; +import "penumbra/core/component/auction/v1alpha1/auction.proto"; import "penumbra/core/component/community_pool/v1/community_pool.proto"; import "penumbra/core/component/dex/v1/dex.proto"; import "penumbra/core/component/distributions/v1/distributions.proto"; @@ -452,6 +453,8 @@ message ChangedAppParameters { core.component.shielded_pool.v1.ShieldedPoolParameters shielded_pool_params = 9; // DEX component parameters core.component.dex.v1.DexParameters dex_params = 10; + // Auction module parameters. + core.component.auction.v1alpha1.AuctionParameters auction_params = 11; } message ChangedAppParametersSet {