sui_rpc_store/proto/generated/sui.rpc_store.v1alpha.rs
1// This file is @generated by prost-build.
2/// A row in the `objects` column family, keyed by
3/// `(ObjectID, version)`.
4///
5/// Either a live version of an on-chain object (the BCS-encoded
6/// `Object`) or a tombstone written at the lamport version of the
7/// transaction that removed it from the live set. Tombstones let
8/// version-bounded reads distinguish "object did not exist at this
9/// version" (no row) from "object was deleted or wrapped at this
10/// version" (tombstone row).
11#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
12pub struct StoredObject {
13 #[prost(oneof = "stored_object::Kind", tags = "1, 2")]
14 pub kind: ::core::option::Option<stored_object::Kind>,
15}
16/// Nested message and enum types in `StoredObject`.
17pub mod stored_object {
18 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
19 pub enum Kind {
20 /// BCS-encoded `sui_types::object::Object`.
21 #[prost(bytes, tag = "1")]
22 Bcs(::prost::bytes::Bytes),
23 /// The object was deleted or wrapped at this version.
24 #[prost(message, tag = "2")]
25 Tombstone(super::StoredObjectTombstone),
26 }
27}
28/// Marker carried by a tombstone row in the `objects` CF.
29#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
30pub struct StoredObjectTombstone {
31 /// How the object was removed from the live set.
32 #[prost(enumeration = "StoredObjectTombstoneKind", tag = "1")]
33 pub kind: i32,
34}
35/// A signed transaction, keyed by its assigned `tx_seq`.
36///
37/// Stored as two BCS payloads rather than the wrapped envelope so
38/// callers can read or rewrite either side without touching the
39/// other. The two together are equivalent to a
40/// `sui_types::transaction::Transaction` envelope.
41#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
42pub struct StoredTransaction {
43 /// BCS-encoded `sui_types::transaction::TransactionData`.
44 #[prost(bytes = "bytes", tag = "1")]
45 pub transaction_bcs: ::prost::bytes::Bytes,
46 /// BCS-encoded `Vec<sui_types::signature::GenericSignature>` —
47 /// the user signatures over `transaction_bcs`.
48 #[prost(bytes = "bytes", tag = "2")]
49 pub signatures_bcs: ::prost::bytes::Bytes,
50}
51/// The effects of a transaction.
52///
53/// Value type for the `effects` column family, keyed by `tx_seq`.
54#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
55pub struct StoredEffects {
56 /// BCS-encoded `sui_types::effects::TransactionEffects`.
57 #[prost(bytes = "bytes", tag = "1")]
58 pub bcs: ::prost::bytes::Bytes,
59 /// BCS-encoded `Vec<sui_types::storage::ObjectKey>` listing
60 /// objects loaded during execution but not modified by the tx.
61 /// Folded into this message so callers fetching effects also get
62 /// the loaded-runtime set in a single point lookup.
63 #[prost(bytes = "bytes", tag = "2")]
64 pub unchanged_loaded_bcs: ::prost::bytes::Bytes,
65}
66/// The events emitted by a transaction.
67///
68/// Value type for the `events` column family, keyed by `tx_seq`.
69#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
70pub struct StoredEvents {
71 /// BCS-encoded `sui_types::effects::TransactionEvents`.
72 #[prost(bytes = "bytes", tag = "1")]
73 pub bcs: ::prost::bytes::Bytes,
74}
75/// A signed checkpoint header.
76///
77/// Value type for the `checkpoint_summary` column family, keyed by
78/// checkpoint sequence number (`u64`). Contents (the list of tx
79/// digests) live in a separate `checkpoint_contents` CF; pulling
80/// the lightweight summary doesn't pay the contents I/O.
81#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
82pub struct StoredCheckpointSummary {
83 /// BCS-encoded `sui_types::messages_checkpoint::CheckpointSummary`.
84 #[prost(bytes = "bytes", tag = "1")]
85 pub summary_bcs: ::prost::bytes::Bytes,
86 /// BCS-encoded
87 /// `sui_types::crypto::AuthorityStrongQuorumSignInfo`.
88 #[prost(bytes = "bytes", tag = "2")]
89 pub signature_bcs: ::prost::bytes::Bytes,
90}
91/// The contents of a checkpoint — the ordered list of executed
92/// transaction digests.
93///
94/// Value type for the `checkpoint_contents` column family, keyed by
95/// checkpoint sequence number.
96#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
97pub struct StoredCheckpointContents {
98 /// BCS-encoded
99 /// `sui_types::messages_checkpoint::CheckpointContents`.
100 #[prost(bytes = "bytes", tag = "1")]
101 pub bcs: ::prost::bytes::Bytes,
102}
103/// Per-transaction metadata, keyed by the assigned `tx_seq`.
104///
105/// This is the canonical "what is at this tx_seq" record. It
106/// resolves the `tx_seq → digest` direction of the bijection; the
107/// inverse lives in `tx_seq_by_digest`.
108#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
109pub struct TxMetadata {
110 /// 32-byte `TransactionDigest`.
111 #[prost(bytes = "bytes", tag = "1")]
112 pub digest: ::prost::bytes::Bytes,
113 /// Checkpoint that contains this transaction.
114 #[prost(uint64, tag = "2")]
115 pub checkpoint_seq: u64,
116 /// 0-based position of this transaction within its checkpoint's
117 /// contents. Pairs with `checkpoint_seq` for stable global
118 /// ordering and pagination cursors.
119 #[prost(uint32, tag = "3")]
120 pub ckpt_position: u32,
121 /// Number of events emitted by this transaction.
122 #[prost(uint32, tag = "4")]
123 pub event_count: u32,
124 /// Wall-clock timestamp of the containing checkpoint, in
125 /// milliseconds since the Unix epoch.
126 #[prost(uint64, tag = "5")]
127 pub timestamp_ms: u64,
128}
129/// A roaring bitmap blob, stored under one bucket of an inverted
130/// index. Value type for `transaction_bitmap` and `event_bitmap`.
131///
132/// The wire is the raw `RoaringBitmap` serialization; the wrapper
133/// exists so future per-bucket aux fields (e.g. cardinality hints)
134/// can be added without a CF-level rewrite.
135#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
136pub struct BitmapBlob {
137 #[prost(bytes = "bytes", tag = "1")]
138 pub data: ::prost::bytes::Bytes,
139}
140/// `(owner, coin_type)` → coin + accumulator balance deltas.
141///
142/// Each field is a 16-byte little-endian `i128`. The merge operator
143/// adds fields component-wise; the compaction filter drops rows
144/// where both components are zero. Readers compute the displayed
145/// total as `coin + address`.
146///
147/// Two sources contribute independently:
148///
149/// * `coin`: aggregated from `Coin<T>` objects owned by `owner`.
150/// * `address`: aggregated from the address-scoped accumulator
151/// bucket for `(owner, type)`.
152///
153/// Each indexer writes only its own field (the other left at the
154/// default zero), so the merge operator never has to reconcile
155/// concurrent writes to the same component.
156#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
157pub struct BalanceDelta {
158 #[prost(bytes = "bytes", tag = "1")]
159 pub coin: ::prost::bytes::Bytes,
160 #[prost(bytes = "bytes", tag = "2")]
161 pub address: ::prost::bytes::Bytes,
162}
163/// The storage id of one version of a Move package, stored in
164/// `package_versions` keyed by `(original_package_id, version)`.
165#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
166pub struct PackageVersionInfo {
167 /// 32-byte `ObjectID` under which this version of the package
168 /// is stored.
169 #[prost(bytes = "bytes", tag = "1")]
170 pub storage_id: ::prost::bytes::Bytes,
171 /// The checkpoint at which this package version was published.
172 ///
173 /// Absent on rows written by the live-set restore at the anchor
174 /// checkpoint: those versions were published before the available
175 /// window, so a checkpoint-bounded read treats them as having
176 /// always existed (a restore floor). Tip indexing and the
177 /// post-restore backfill of `\[L, T\]` set the real publish
178 /// checkpoint.
179 #[prost(uint64, optional, tag = "2")]
180 pub checkpoint: ::core::option::Option<u64>,
181}
182/// The object version live as of a checkpoint, stored in
183/// `object_version_by_checkpoint` keyed by `(ObjectID, checkpoint)`.
184///
185/// `version` is the object's final version at the end of the keyed
186/// checkpoint (a live version, or the tombstone version for an object
187/// removed in that checkpoint).
188///
189/// `from_restore` is set only on rows written by the live-set restore
190/// at the restore anchor checkpoint; tip indexing and backfill leave it
191/// unset, so the common case pays no extra bytes. It lets a
192/// checkpoint-pinned read tell a static object's restore floor (the
193/// object existed before the available window) apart from an object
194/// created in the anchor checkpoint.
195#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
196pub struct ObjectVersionInfo {
197 #[prost(uint64, tag = "1")]
198 pub version: u64,
199 #[prost(bool, optional, tag = "2")]
200 pub from_restore: ::core::option::Option<bool>,
201}
202/// Per-epoch metadata stored in `epochs` keyed by `EpochId`.
203///
204/// Written as a sequence of partial records that the merge
205/// operator combines field-wise:
206///
207/// * "Epoch start" sets `protocol_version`,
208/// `reference_gas_price`, `start_timestamp_ms`,
209/// `start_checkpoint`, and `system_state_bcs`.
210/// * "Epoch end" sets `end_timestamp_ms` and `end_checkpoint`.
211///
212/// The two sides are produced by independent index pipelines and
213/// never overlap in steady state, so the merge operator simply
214/// takes whichever side has each field set; if the same field is
215/// ever rewritten (e.g. during re-index), the latest operand
216/// wins.
217///
218/// All fields use proto3's `optional` modifier so a zero value
219/// (or empty `bytes`) is distinguishable from "not yet observed".
220#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
221pub struct StoredEpoch {
222 #[prost(uint64, optional, tag = "1")]
223 pub protocol_version: ::core::option::Option<u64>,
224 #[prost(uint64, optional, tag = "2")]
225 pub reference_gas_price: ::core::option::Option<u64>,
226 #[prost(uint64, optional, tag = "3")]
227 pub start_timestamp_ms: ::core::option::Option<u64>,
228 #[prost(uint64, optional, tag = "4")]
229 pub end_timestamp_ms: ::core::option::Option<u64>,
230 #[prost(uint64, optional, tag = "5")]
231 pub start_checkpoint: ::core::option::Option<u64>,
232 #[prost(uint64, optional, tag = "6")]
233 pub end_checkpoint: ::core::option::Option<u64>,
234 /// BCS-encoded `sui_types::sui_system_state::SuiSystemState`
235 /// captured at epoch start.
236 #[prost(bytes = "bytes", optional, tag = "7")]
237 pub system_state_bcs: ::core::option::Option<::prost::bytes::Bytes>,
238 /// The network's cumulative transaction count after the epoch's
239 /// final checkpoint (`CheckpointSummary::network_total_transactions`)
240 /// — an exclusive upper bound on the epoch's transaction sequence
241 /// numbers. Equivalent to postgres `kv_epoch_ends.tx_hi`.
242 #[prost(uint64, optional, tag = "8")]
243 pub tx_hi: ::core::option::Option<u64>,
244 /// Whether the epoch ended in safe mode. When `true` no
245 /// `SystemEpochInfoEvent` was emitted, so the counters below are
246 /// unset.
247 #[prost(bool, optional, tag = "9")]
248 pub safe_mode: ::core::option::Option<bool>,
249 #[prost(uint64, optional, tag = "10")]
250 pub total_stake: ::core::option::Option<u64>,
251 #[prost(uint64, optional, tag = "11")]
252 pub storage_fund_balance: ::core::option::Option<u64>,
253 #[prost(uint64, optional, tag = "12")]
254 pub storage_fund_reinvestment: ::core::option::Option<u64>,
255 #[prost(uint64, optional, tag = "13")]
256 pub storage_charge: ::core::option::Option<u64>,
257 #[prost(uint64, optional, tag = "14")]
258 pub storage_rebate: ::core::option::Option<u64>,
259 #[prost(uint64, optional, tag = "15")]
260 pub stake_subsidy_amount: ::core::option::Option<u64>,
261 #[prost(uint64, optional, tag = "16")]
262 pub total_gas_fees: ::core::option::Option<u64>,
263 #[prost(uint64, optional, tag = "17")]
264 pub total_stake_rewards_distributed: ::core::option::Option<u64>,
265 #[prost(uint64, optional, tag = "18")]
266 pub leftover_storage_fund_inflow: ::core::option::Option<u64>,
267 /// BCS-encoded
268 /// `Vec<sui_types::messages_checkpoint::CheckpointCommitment>` from
269 /// the checkpoint's end-of-epoch data.
270 #[prost(bytes = "bytes", optional, tag = "19")]
271 pub epoch_commitments: ::core::option::Option<::prost::bytes::Bytes>,
272}
273/// The lowest still-available data per axis. Drives compaction
274/// filters on the bitmap CFs and feeds `available_range` queries.
275/// Stored under a singleton key in the `pruning_watermark` CF.
276#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
277pub struct PruningWatermarks {
278 /// Lowest `tx_seq` whose `tx_metadata_by_seq`, `transactions`,
279 /// `effects`, `events`, and bitmap rows are still present.
280 #[prost(uint64, tag = "1")]
281 pub tx_seq_lo: u64,
282 /// Lowest checkpoint sequence number whose `checkpoint_summary`
283 /// / `checkpoint_contents` rows are still present.
284 #[prost(uint64, tag = "2")]
285 pub checkpoint_lo: u64,
286}
287/// Why a tombstone was written.
288///
289/// `DELETED` covers both an explicit object deletion and the
290/// `unwrapped_then_deleted` shape (object unwrapped and discarded
291/// within a single transaction). `WRAPPED` marks the object as
292/// nested inside another and removed from the live set — a future
293/// unwrap can revive the id at a higher version.
294#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
295#[repr(i32)]
296pub enum StoredObjectTombstoneKind {
297 Unspecified = 0,
298 Deleted = 1,
299 Wrapped = 2,
300}
301impl StoredObjectTombstoneKind {
302 /// String value of the enum field names used in the ProtoBuf definition.
303 ///
304 /// The values are not transformed in any way and thus are considered stable
305 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
306 pub fn as_str_name(&self) -> &'static str {
307 match self {
308 Self::Unspecified => "STORED_OBJECT_TOMBSTONE_KIND_UNSPECIFIED",
309 Self::Deleted => "STORED_OBJECT_TOMBSTONE_KIND_DELETED",
310 Self::Wrapped => "STORED_OBJECT_TOMBSTONE_KIND_WRAPPED",
311 }
312 }
313 /// Creates an enum from field names used in the ProtoBuf definition.
314 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
315 match value {
316 "STORED_OBJECT_TOMBSTONE_KIND_UNSPECIFIED" => Some(Self::Unspecified),
317 "STORED_OBJECT_TOMBSTONE_KIND_DELETED" => Some(Self::Deleted),
318 "STORED_OBJECT_TOMBSTONE_KIND_WRAPPED" => Some(Self::Wrapped),
319 _ => None,
320 }
321 }
322}