Skip to content

Commit d4cff03

Browse files
committed
additional comments and todos
1 parent 55c10fb commit d4cff03

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

crates/sui-indexer-alt-graphql/src/api/types/transaction/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ impl TransactionContents {
238238
return Ok(None);
239239
};
240240

241-
// Unlike `effectsJson`, no server fetch: the rendered transaction proto is a pure
242-
// function of the transaction BCS (no server-side joins), so local conversion is
243-
// complete.
241+
// `merge_transaction_data` (`sui-types/src/rpc_proto_conversions.rs`) derives every
242+
// `Transaction` proto field from the decoded `TransactionData` alone, so local
243+
// conversion is equivalent to the json produced from the proto transaction.
244244
let mut proto_transaction = content.proto_transaction()?;
245245
// Clear the bcs field as transactionJson is intended to provide a full structured output
246246
proto_transaction.bcs = None;

crates/sui-indexer-alt-graphql/src/api/types/transaction_effects.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,16 @@ impl EffectsContents {
372372
Some(
373373
async {
374374
// Prefer the proto cached from an execution or streaming response (rendered by the
375-
// fullnode). Otherwise ask the ledger service to render the effects. The local
376-
// effects BCS is a fall back, and will likely be missing information like object
377-
// type annotations and runtime-loaded objects.
375+
// fullnode). Otherwise ask the ledger service to render the effects.
376+
//
377+
// TODO: fullnode-rendered protos also include clever error rendering, which
378+
// sui-kv-rpc does not implement (though it has the package resolver required).
379+
//
380+
// TODO: The local BCS conversion is a transitional fallback, reachable only on the
381+
// pg / direct-bigtable `KvLoader` variants (no ledger service to ask). It lacks
382+
// object type annotations and runtime-loaded objects, which are not derivable from
383+
// the effects BCS. These paths will be unreachable once the variants are
384+
// deprecated.
378385
let mut proto_effects = if let Some(proto) = content.cached_proto_effects() {
379386
proto.clone()
380387
} else {

0 commit comments

Comments
 (0)