The soroban-rpc has a RPC endpoint called GetLedgerEntry. Using this entry allow the consumer to retrieve the ledger entry associated with the most recent ledger.
When a client needs to have multiple fetch operations, she would issue multiple GetLedgerEntry requests. To resolve this issue, we are considering replacing the GetLedgerEntry endpoint, with an GetLedgerEntries endpoint, allowing the client to retrieve multiple entries as an atomic operation.
The operation atomicity ensures that all the entries are being retrieved off the same ledger - which is a requirement for simulating the execution of a smart contract. We believe that this could be the foundation for future decouplilng of the storage and execution which are currently part of the soroban-rpc.
from technical perspective, the soroban-rpc endpoint currently has the following interface
getLedgerEntry(key: xdr.LedgerKey): {
xdr: xdr.LedgerEntryData,
lastModifiedLedgerSeq: number,
latestLedger: number,
}
which we consider replacing with
getLedgerEntries(keys: xdr.LedgerKey[]): {
entries: (null | {
xdr: xdr.LedgerEntryData
})[],
lastModifiedLedgerSeq: number,
latestLedger: number,
}
I'd like to hear your thoughts.