From 480ffac2b02d827f36163d56e90f5e99250adf28 Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Tue, 14 Jan 2025 13:26:51 -0800 Subject: [PATCH 1/3] protos(view): add subaccount index to `OwnedPositionIds` rpc --- crates/proto/src/gen/penumbra.view.v1.rs | 6 ++++ .../proto/src/gen/penumbra.view.v1.serde.rs | 34 ++++++++++++++++++ .../proto/src/gen/proto_descriptor.bin.no_lfs | Bin 649637 -> 650000 bytes proto/penumbra/penumbra/view/v1/view.proto | 9 +++-- 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/crates/proto/src/gen/penumbra.view.v1.rs b/crates/proto/src/gen/penumbra.view.v1.rs index 5ec54bf491..662c7df3e8 100644 --- a/crates/proto/src/gen/penumbra.view.v1.rs +++ b/crates/proto/src/gen/penumbra.view.v1.rs @@ -1543,6 +1543,9 @@ pub struct OwnedPositionIdsRequest { pub trading_pair: ::core::option::Option< super::super::core::component::dex::v1::TradingPair, >, + /// If present, return only positions for this subaccount index. + #[prost(message, optional, tag = "3")] + pub subaccount: ::core::option::Option, } impl ::prost::Name for OwnedPositionIdsRequest { const NAME: &'static str = "OwnedPositionIdsRequest"; @@ -1558,6 +1561,9 @@ pub struct OwnedPositionIdsResponse { pub position_id: ::core::option::Option< super::super::core::component::dex::v1::PositionId, >, + /// The subaccount this position belongs to. + #[prost(message, optional, tag = "2")] + pub subaccount: ::core::option::Option, } impl ::prost::Name for OwnedPositionIdsResponse { const NAME: &'static str = "OwnedPositionIdsResponse"; diff --git a/crates/proto/src/gen/penumbra.view.v1.serde.rs b/crates/proto/src/gen/penumbra.view.v1.serde.rs index d5b11ff8db..44858b4f5f 100644 --- a/crates/proto/src/gen/penumbra.view.v1.serde.rs +++ b/crates/proto/src/gen/penumbra.view.v1.serde.rs @@ -4196,6 +4196,9 @@ impl serde::Serialize for OwnedPositionIdsRequest { if self.trading_pair.is_some() { len += 1; } + if self.subaccount.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("penumbra.view.v1.OwnedPositionIdsRequest", len)?; if let Some(v) = self.position_state.as_ref() { struct_ser.serialize_field("positionState", v)?; @@ -4203,6 +4206,9 @@ impl serde::Serialize for OwnedPositionIdsRequest { if let Some(v) = self.trading_pair.as_ref() { struct_ser.serialize_field("tradingPair", v)?; } + if let Some(v) = self.subaccount.as_ref() { + struct_ser.serialize_field("subaccount", v)?; + } struct_ser.end() } } @@ -4217,12 +4223,14 @@ impl<'de> serde::Deserialize<'de> for OwnedPositionIdsRequest { "positionState", "trading_pair", "tradingPair", + "subaccount", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { PositionState, TradingPair, + Subaccount, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -4247,6 +4255,7 @@ impl<'de> serde::Deserialize<'de> for OwnedPositionIdsRequest { match value { "positionState" | "position_state" => Ok(GeneratedField::PositionState), "tradingPair" | "trading_pair" => Ok(GeneratedField::TradingPair), + "subaccount" => Ok(GeneratedField::Subaccount), _ => Ok(GeneratedField::__SkipField__), } } @@ -4268,6 +4277,7 @@ impl<'de> serde::Deserialize<'de> for OwnedPositionIdsRequest { { let mut position_state__ = None; let mut trading_pair__ = None; + let mut subaccount__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::PositionState => { @@ -4282,6 +4292,12 @@ impl<'de> serde::Deserialize<'de> for OwnedPositionIdsRequest { } trading_pair__ = map_.next_value()?; } + GeneratedField::Subaccount => { + if subaccount__.is_some() { + return Err(serde::de::Error::duplicate_field("subaccount")); + } + subaccount__ = map_.next_value()?; + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -4290,6 +4306,7 @@ impl<'de> serde::Deserialize<'de> for OwnedPositionIdsRequest { Ok(OwnedPositionIdsRequest { position_state: position_state__, trading_pair: trading_pair__, + subaccount: subaccount__, }) } } @@ -4307,10 +4324,16 @@ impl serde::Serialize for OwnedPositionIdsResponse { if self.position_id.is_some() { len += 1; } + if self.subaccount.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("penumbra.view.v1.OwnedPositionIdsResponse", len)?; if let Some(v) = self.position_id.as_ref() { struct_ser.serialize_field("positionId", v)?; } + if let Some(v) = self.subaccount.as_ref() { + struct_ser.serialize_field("subaccount", v)?; + } struct_ser.end() } } @@ -4323,11 +4346,13 @@ impl<'de> serde::Deserialize<'de> for OwnedPositionIdsResponse { const FIELDS: &[&str] = &[ "position_id", "positionId", + "subaccount", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { PositionId, + Subaccount, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -4351,6 +4376,7 @@ impl<'de> serde::Deserialize<'de> for OwnedPositionIdsResponse { { match value { "positionId" | "position_id" => Ok(GeneratedField::PositionId), + "subaccount" => Ok(GeneratedField::Subaccount), _ => Ok(GeneratedField::__SkipField__), } } @@ -4371,6 +4397,7 @@ impl<'de> serde::Deserialize<'de> for OwnedPositionIdsResponse { V: serde::de::MapAccess<'de>, { let mut position_id__ = None; + let mut subaccount__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::PositionId => { @@ -4379,6 +4406,12 @@ impl<'de> serde::Deserialize<'de> for OwnedPositionIdsResponse { } position_id__ = map_.next_value()?; } + GeneratedField::Subaccount => { + if subaccount__.is_some() { + return Err(serde::de::Error::duplicate_field("subaccount")); + } + subaccount__ = map_.next_value()?; + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -4386,6 +4419,7 @@ impl<'de> serde::Deserialize<'de> for OwnedPositionIdsResponse { } Ok(OwnedPositionIdsResponse { position_id: position_id__, + subaccount: subaccount__, }) } } diff --git a/crates/proto/src/gen/proto_descriptor.bin.no_lfs b/crates/proto/src/gen/proto_descriptor.bin.no_lfs index 895f0f725959cf9de6b287980a762aa4d11be6ff..4c9fd7802b5a9aa7677fc3dc5748a000c76c7db3 100644 GIT binary patch delta 13393 zcmY*gdwf;JwLW|H?8(VKgd{sWLI_DnLVzSE34{a)AX-uJtsu23t%B8xwopZ@wfFWQ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|En diff --git a/proto/penumbra/penumbra/view/v1/view.proto b/proto/penumbra/penumbra/view/v1/view.proto index 5f1ffb41b5..2af3e5cc52 100644 --- a/proto/penumbra/penumbra/view/v1/view.proto +++ b/proto/penumbra/penumbra/view/v1/view.proto @@ -153,8 +153,7 @@ service ViewService { // There's only one transparent address per wallet, so this request has no parameters; // the message exists to satisfy forward-compatibility properties. -message TransparentAddressRequest { -} +message TransparentAddressRequest {} message TransparentAddressResponse { // The raw (binary) transparent address @@ -700,10 +699,14 @@ message OwnedPositionIdsRequest { core.component.dex.v1.PositionState position_state = 1; // If present, return only positions for this trading pair. core.component.dex.v1.TradingPair trading_pair = 2; + // If present, return only positions for this subaccount index. + core.keys.v1.AddressIndex subaccount = 3; } message OwnedPositionIdsResponse { core.component.dex.v1.PositionId position_id = 1; + // The subaccount this position belongs to. + core.keys.v1.AddressIndex subaccount = 2; } // Requests information on an asset by asset id @@ -786,4 +789,4 @@ message UnbondingTokensByAddressIndexResponse { // `true` if the `unbonding_delay` (from `StakeParameters`) has passed or the // validator has unbonded. bool claimable = 2; -} \ No newline at end of file +} From 4c3c816f1eada38d72875a12592bc906379a7208 Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Tue, 14 Jan 2025 13:59:37 -0800 Subject: [PATCH 2/3] view: ignore the subaccount field in the client/server --- crates/view/src/client.rs | 1 + crates/view/src/service.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/crates/view/src/client.rs b/crates/view/src/client.rs index be7edbccd8..25fdf2315f 100644 --- a/crates/view/src/client.rs +++ b/crates/view/src/client.rs @@ -709,6 +709,7 @@ where tonic::Request::new(pb::OwnedPositionIdsRequest { trading_pair: trading_pair.map(TryInto::try_into).transpose()?, position_state: position_state.map(TryInto::try_into).transpose()?, + ..Default::default() }), ); diff --git a/crates/view/src/service.rs b/crates/view/src/service.rs index 8e3c8ce26c..cd116b4cfa 100644 --- a/crates/view/src/service.rs +++ b/crates/view/src/service.rs @@ -1717,6 +1717,7 @@ impl ViewService for ViewServer { let pb::OwnedPositionIdsRequest { position_state, trading_pair, + subaccount: _, } = request.into_inner(); let position_state: Option = position_state @@ -1741,6 +1742,9 @@ impl ViewService for ViewServer { for id in ids { yield pb::OwnedPositionIdsResponse{ position_id: Some(id.into()), + // The rust view server does not index positions by subaccount, + // so this information is invisible to it. + subaccount: None, } } }; From c5ae0ba99c3ea7680978ee1d45448875daf656a2 Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Fri, 17 Jan 2025 10:23:13 -0800 Subject: [PATCH 3/3] view: use explicit struct instantiation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lúcás Meier Signed-off-by: Erwan Or --- crates/view/src/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/view/src/client.rs b/crates/view/src/client.rs index 25fdf2315f..18d3a11a25 100644 --- a/crates/view/src/client.rs +++ b/crates/view/src/client.rs @@ -709,7 +709,7 @@ where tonic::Request::new(pb::OwnedPositionIdsRequest { trading_pair: trading_pair.map(TryInto::try_into).transpose()?, position_state: position_state.map(TryInto::try_into).transpose()?, - ..Default::default() + subaccount: None, }), );