Open sreuland opened 3 weeks ago
It would be extra cool if Datastore could be queried to provide its highest and lowest ledger sequences currently available on it, then this type of behavior for clients to initiate unbounded from latest data point would be trivial: https://github.com/stellar/go/issues/5498
What problem does your feature solve?
for uses cases of
cdp.ApplyLedgerMetadata
where caller just wants it to start a range at whatever is latest ledger of network, requires the caller to obtain the latest ledger manually from history archives first and pass that as range.fromWhat would you like to see?
When caller of
cdp.ApplyLedgerMetadata
passesUnboundedRange.from=0
,cdp.ApplyLedgerMetadata
should detect and acquire the latest ledger internally and substitute that in theUnboundedRange.from
value passed to BufferedStorageBackend.An implementation choice needs be determined on how/which 'latest' ledger is obtained: 1) the checkpoint ledger from target network based on history archives 2) the greatest ledger sequence that exists on the Datastore
If second option is chosen to use Datastore, then this ticket does become effectively blocked on https://github.com/stellar/go/issues/5498 which provides the changes on Datastore to facilitate.
What alternatives are there?
callers of
cdp.ApplyLedgerMetadata
that want to start streaming from current network ledger, must manually callHistoryArchive.GetLatestLedgerSequence()
first to obtain the latest sequence.