@@ -116,3 +116,81 @@ message ProofResponse {
116116 bytes proof = 1 ; // Encoded Proof (opaque to gRPC)
117117}
118118
119+ // LedgerMode reports the operating mode of the ledger server.
120+ enum LedgerMode {
121+ LEDGER_MODE_UNSPECIFIED = 0 ;
122+ LEDGER_MODE_FULL = 1 ;
123+ LEDGER_MODE_PAYLOADLESS = 2 ;
124+ }
125+
126+ // ServerInfoResponse reports server metadata such as the operating mode.
127+ message ServerInfoResponse {
128+ LedgerMode mode = 1 ;
129+ }
130+
131+ // LedgerInfoService reports mode and other metadata about the ledger server.
132+ // It is registered unconditionally on every ledger gRPC server regardless of
133+ // whether the process is running in full or payloadless mode. Clients call
134+ // ServerInfo at startup to verify they are talking to a server in the
135+ // expected mode.
136+ service LedgerInfoService {
137+ // ServerInfo returns metadata about this ledger server, including its
138+ // operating mode.
139+ rpc ServerInfo (google.protobuf.Empty ) returns (ServerInfoResponse );
140+ }
141+
142+ // LeafHash is a 32-byte HashLeaf(path, value).
143+ // An empty `hash` (length 0) indicates the path is unallocated.
144+ message LeafHash {
145+ bytes hash = 1 ;
146+ }
147+
148+ // LeafHashResponse contains a single leaf hash.
149+ message LeafHashResponse {
150+ LeafHash leaf_hash = 1 ;
151+ }
152+
153+ // LeafHashesResponse contains a slice of leaf hashes, one per input key,
154+ // in the same order as the request.
155+ message LeafHashesResponse {
156+ repeated LeafHash leaf_hashes = 1 ;
157+ }
158+
159+ // HasPathsResponse reports, for each input key, whether the key has an
160+ // allocated register at the requested state.
161+ message HasPathsResponse {
162+ repeated bool exists = 1 ;
163+ }
164+
165+ // PayloadlessLedgerService provides remote access to a payloadless ledger.
166+ // Unlike LedgerService, reads return leaf hashes (HashLeaf(path, value))
167+ // rather than payload values. A server registers either LedgerService or
168+ // PayloadlessLedgerService at startup, never both.
169+ service PayloadlessLedgerService {
170+ // InitialState returns the initial state of the ledger.
171+ rpc InitialState (google.protobuf.Empty ) returns (StateResponse );
172+
173+ // HasState checks if the given state exists in the ledger.
174+ rpc HasState (StateRequest ) returns (HasStateResponse );
175+
176+ // HasPaths reports, for each input key, whether the key has an allocated
177+ // register at the requested state.
178+ rpc HasPaths (GetRequest ) returns (HasPathsResponse );
179+
180+ // GetSingleLeafHash returns the leaf hash for a single key at a specific
181+ // state. An empty hash indicates the path is unallocated.
182+ rpc GetSingleLeafHash (GetSingleValueRequest ) returns (LeafHashResponse );
183+
184+ // GetLeafHashes returns leaf hashes for multiple keys at a specific state.
185+ rpc GetLeafHashes (GetRequest ) returns (LeafHashesResponse );
186+
187+ // Set updates keys with new values at a specific state and returns the
188+ // new state. The server discards the keys after hashing; only the values
189+ // contribute to the trie.
190+ rpc Set (SetRequest ) returns (SetResponse );
191+
192+ // Prove returns a payloadless batch proof for the given keys at a
193+ // specific state. Proofs carry leaf hashes rather than payload values.
194+ rpc Prove (ProveRequest ) returns (ProofResponse );
195+ }
196+
0 commit comments