Skip to content

Commit

Permalink
proto: remove options field from GetFullCheckpointRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed Feb 20, 2025
1 parent 0c55efd commit b24b871
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 485 deletions.
34 changes: 18 additions & 16 deletions crates/sui-e2e-tests/tests/rpc/checkpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use sui_rpc_api::field_mask::FieldMaskUtil;
use sui_rpc_api::proto::node::v2::node_service_client::NodeServiceClient;
use sui_rpc_api::proto::node::v2::{
FullCheckpointObject, FullCheckpointTransaction, GetCheckpointRequest, GetCheckpointResponse,
GetFullCheckpointOptions, GetFullCheckpointRequest, GetFullCheckpointResponse,
GetFullCheckpointRequest, GetFullCheckpointResponse,
};
use test_cluster::TestClusterBuilder;

Expand Down Expand Up @@ -245,10 +245,7 @@ async fn get_full_checkpoint() {
contents_bcs,
transactions,
} = grpc_client
.get_full_checkpoint(
GetFullCheckpointRequest::by_sequence_number(checkpoint)
.with_options(GetFullCheckpointOptions::none()),
)
.get_full_checkpoint(GetFullCheckpointRequest::by_sequence_number(checkpoint))
.await
.unwrap()
.into_inner();
Expand Down Expand Up @@ -293,8 +290,18 @@ async fn get_full_checkpoint() {
// Request all fields
let response = grpc_client
.get_full_checkpoint(
GetFullCheckpointRequest::by_sequence_number(checkpoint)
.with_options(GetFullCheckpointOptions::all()),
GetFullCheckpointRequest::by_sequence_number(checkpoint).with_read_mask(
FieldMaskUtil::from_paths([
"sequence_number",
"digest",
"summary",
"summary_bcs",
"signature",
"contents",
"contents_bcs",
"transactions",
]),
),
)
.await
.unwrap()
Expand Down Expand Up @@ -368,21 +375,17 @@ async fn get_full_checkpoint() {

// Request by digest
let response = grpc_client
.get_full_checkpoint(
GetFullCheckpointRequest::by_digest(digest.clone().unwrap())
.with_options(GetFullCheckpointOptions::none()),
)
.get_full_checkpoint(GetFullCheckpointRequest::by_digest(digest.clone().unwrap()))
.await
.unwrap()
.into_inner();
assert_eq!(response.digest, digest.to_owned());

// Request by sequence_number
let response = grpc_client
.get_full_checkpoint(
GetFullCheckpointRequest::by_sequence_number(sequence_number.unwrap())
.with_options(GetFullCheckpointOptions::none()),
)
.get_full_checkpoint(GetFullCheckpointRequest::by_sequence_number(
sequence_number.unwrap(),
))
.await
.unwrap()
.into_inner();
Expand All @@ -394,7 +397,6 @@ async fn get_full_checkpoint() {
.get_full_checkpoint(GetFullCheckpointRequest {
sequence_number: Some(sequence_number.unwrap()),
digest: Some(digest.clone().unwrap()),
options: None,
read_mask: None,
})
.await
Expand Down
80 changes: 0 additions & 80 deletions crates/sui-rpc-api/proto/sui/node/v2/node_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -287,91 +287,11 @@ message GetFullCheckpointRequest {
// Optional. The digest of the requested checkpoint.
optional sui.types.Digest digest = 2;

// DEPRECATED To be removed in the next release
optional GetFullCheckpointOptions options = 3;
// Optional. Mask for specifying which parts of the `GetFullCheckpointResponse`
// should be returned.
optional google.protobuf.FieldMask read_mask = 4;
}

// DEPRECATED To be removed in the next release
message GetFullCheckpointOptions {
// Include the `sui.types.CheckpointSummary` in the response.
//
// Defaults to `false` if not included.
optional bool summary = 3;

// Include the `CheckpointSummary` formatted as BCS in the response.
//
// Defaults to `false` if not included.
optional bool summary_bcs = 4;

// Include the `sui.types.ValidatorAggregatedSignature` in the response.
//
// Defaults to `false` if not included.
optional bool signature = 5;

// Include the `sui.types.CheckpointContents` message in the response.
//
// Defaults to `false` if not included.
optional bool contents = 6;

// Include the `CheckpointContents` formatted as BCS in the response.
//
// Defaults to `false` if not included.
optional bool contents_bcs = 7;

// Include the `sui.types.Transaction` message in the response.
//
// Defaults to `false` if not included.
optional bool transaction = 8;

// Include the transaction formatted as BCS in the response.
//
// Defaults to `false` if not included.
optional bool transaction_bcs = 9;

// Include the `sui.types.TransactionEffects` message in the response.
//
// Defaults to `false` if not included.
optional bool effects = 10;

// Include the `TransactionEffects` formatted as BCS in the response.
//
// Defaults to `false` if not included.
optional bool effects_bcs = 11;

// Include the `sui.types.TransactionEvents` message in the response.
//
// Defaults to `false` if not included.
optional bool events = 12;

// Include the `TransactionEvents` formatted as BCS in the response.
//
// Defaults to `false` if not included.
optional bool events_bcs = 13;

// Include the input objects for transactions in the response.
//
// Defaults to `false` if not included.
optional bool input_objects = 14;

// Include the output objects for transactions in the response.
//
// Defaults to `false` if not included.
optional bool output_objects = 15;

// Include the `sui.types.Object` message in the response.
//
// Defaults to `false` if not included.
optional bool object = 16;

// Include the object formatted as BCS in the response.
//
// Defaults to `false` if not included.
optional bool object_bcs = 17;
}

// Response message for `NodeService.GetFullCheckpoint`.
message GetFullCheckpointResponse {
// The sequence number of this checkpoint.
Expand Down
17 changes: 0 additions & 17 deletions crates/sui-rpc-api/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,6 @@ impl Client {
let request = crate::proto::node::v2::GetFullCheckpointRequest {
sequence_number: Some(sequence_number),
digest: None,
options: Some(crate::proto::node::v2::GetFullCheckpointOptions {
summary: Some(false),
summary_bcs: Some(true),
signature: Some(true),
contents: Some(false),
contents_bcs: Some(true),
transaction: Some(false),
transaction_bcs: Some(true),
effects: Some(false),
effects_bcs: Some(true),
events: Some(false),
events_bcs: Some(true),
input_objects: Some(true),
output_objects: Some(true),
object: Some(false),
object_bcs: Some(true),
}),
read_mask: FieldMaskUtil::from_paths([
"summary_bcs",
"signature",
Expand Down
10 changes: 3 additions & 7 deletions crates/sui-rpc-api/src/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,9 @@ impl crate::proto::node::v2::node_service_server::NodeService for crate::RpcServ
}
};

let options = if let Some(read_mask) = request.read_mask {
crate::types::GetFullCheckpointOptions::from_read_mask(read_mask)
} else if let Some(options) = request.options {
options.into()
} else {
Default::default()
};
let options = crate::types::GetFullCheckpointOptions::from_read_mask(
request.read_mask.unwrap_or_default(),
);

self.get_full_checkpoint(checkpoint, &options)
.map(Into::into)
Expand Down
Binary file modified crates/sui-rpc-api/src/proto/generated/sui.node.v2.fds.bin
Binary file not shown.
82 changes: 0 additions & 82 deletions crates/sui-rpc-api/src/proto/generated/sui.node.v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,93 +213,11 @@ pub struct GetFullCheckpointRequest {
/// Optional. The digest of the requested checkpoint.
#[prost(message, optional, tag = "2")]
pub digest: ::core::option::Option<super::super::types::Digest>,
/// DEPRECATED To be removed in the next release
#[prost(message, optional, tag = "3")]
pub options: ::core::option::Option<GetFullCheckpointOptions>,
/// Optional. Mask for specifying which parts of the `GetFullCheckpointResponse`
/// should be returned.
#[prost(message, optional, tag = "4")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// DEPRECATED To be removed in the next release
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetFullCheckpointOptions {
/// Include the `sui.types.CheckpointSummary` in the response.
///
/// Defaults to `false` if not included.
#[prost(bool, optional, tag = "3")]
pub summary: ::core::option::Option<bool>,
/// Include the `CheckpointSummary` formatted as BCS in the response.
///
/// Defaults to `false` if not included.
#[prost(bool, optional, tag = "4")]
pub summary_bcs: ::core::option::Option<bool>,
/// Include the `sui.types.ValidatorAggregatedSignature` in the response.
///
/// Defaults to `false` if not included.
#[prost(bool, optional, tag = "5")]
pub signature: ::core::option::Option<bool>,
/// Include the `sui.types.CheckpointContents` message in the response.
///
/// Defaults to `false` if not included.
#[prost(bool, optional, tag = "6")]
pub contents: ::core::option::Option<bool>,
/// Include the `CheckpointContents` formatted as BCS in the response.
///
/// Defaults to `false` if not included.
#[prost(bool, optional, tag = "7")]
pub contents_bcs: ::core::option::Option<bool>,
/// Include the `sui.types.Transaction` message in the response.
///
/// Defaults to `false` if not included.
#[prost(bool, optional, tag = "8")]
pub transaction: ::core::option::Option<bool>,
/// Include the transaction formatted as BCS in the response.
///
/// Defaults to `false` if not included.
#[prost(bool, optional, tag = "9")]
pub transaction_bcs: ::core::option::Option<bool>,
/// Include the `sui.types.TransactionEffects` message in the response.
///
/// Defaults to `false` if not included.
#[prost(bool, optional, tag = "10")]
pub effects: ::core::option::Option<bool>,
/// Include the `TransactionEffects` formatted as BCS in the response.
///
/// Defaults to `false` if not included.
#[prost(bool, optional, tag = "11")]
pub effects_bcs: ::core::option::Option<bool>,
/// Include the `sui.types.TransactionEvents` message in the response.
///
/// Defaults to `false` if not included.
#[prost(bool, optional, tag = "12")]
pub events: ::core::option::Option<bool>,
/// Include the `TransactionEvents` formatted as BCS in the response.
///
/// Defaults to `false` if not included.
#[prost(bool, optional, tag = "13")]
pub events_bcs: ::core::option::Option<bool>,
/// Include the input objects for transactions in the response.
///
/// Defaults to `false` if not included.
#[prost(bool, optional, tag = "14")]
pub input_objects: ::core::option::Option<bool>,
/// Include the output objects for transactions in the response.
///
/// Defaults to `false` if not included.
#[prost(bool, optional, tag = "15")]
pub output_objects: ::core::option::Option<bool>,
/// Include the `sui.types.Object` message in the response.
///
/// Defaults to `false` if not included.
#[prost(bool, optional, tag = "16")]
pub object: ::core::option::Option<bool>,
/// Include the object formatted as BCS in the response.
///
/// Defaults to `false` if not included.
#[prost(bool, optional, tag = "17")]
pub object_bcs: ::core::option::Option<bool>,
}
/// Response message for `NodeService.GetFullCheckpoint`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFullCheckpointResponse {
Expand Down
Loading

0 comments on commit b24b871

Please sign in to comment.