From 35abf5ba3414d08c92377b287b481e5de11a9cd8 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Tue, 5 Sep 2023 12:13:18 +0200 Subject: [PATCH] Add note about eviction --- cmd/soroban-rpc/internal/ingest/service.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/soroban-rpc/internal/ingest/service.go b/cmd/soroban-rpc/internal/ingest/service.go index 919214afc..99eaa9f9a 100644 --- a/cmd/soroban-rpc/internal/ingest/service.go +++ b/cmd/soroban-rpc/internal/ingest/service.go @@ -292,6 +292,10 @@ func (s *Service) evictLedgerEntries(tx db.WriteTx, ledgerCloseMeta xdr.LedgerCl keysToEvict := make([]xdr.LedgerKey, len(ledgerCloseMeta.V2.EvictedTemporaryLedgerKeys)+len(ledgerCloseMeta.V2.EvictedPersistentLedgerEntries)) l := copy(keysToEvict, ledgerCloseMeta.V2.EvictedTemporaryLedgerKeys) for i, entry := range ledgerCloseMeta.V2.EvictedPersistentLedgerEntries { + // TODO: we probably shouldn't be deleting evicted persistent ledger entries cold turkey. + // Otherwise preflighting will fail for restoreFootprint. + // For restoreFootPrint we need to confirm that the entry existed and its size (for the resource estimation). + // so maybe we should store that. key, err := entry.LedgerKey() if err != nil { return err