From 14c6386de9ed7e86057aba604a118b16eaa93e85 Mon Sep 17 00:00:00 2001 From: Mathis Antony Date: Tue, 30 Jul 2024 14:03:38 +0200 Subject: [PATCH 1/2] Check all "not found" errors Currently only the leveldb not found errors are handled. If a pebble not found error is returned by the backend it is propagated, causing the batchposter to fail to send transactions. With this change all DB not found errors are handled the same way. (cherry picked from commit 85068866fb3f409cebfc0a5c446bdab05e655d03) --- arbnode/dataposter/dbstorage/storage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arbnode/dataposter/dbstorage/storage.go b/arbnode/dataposter/dbstorage/storage.go index 4c49d695c5..caa8385452 100644 --- a/arbnode/dataposter/dbstorage/storage.go +++ b/arbnode/dataposter/dbstorage/storage.go @@ -61,7 +61,7 @@ func (s *Storage) Get(_ context.Context, index uint64) (*storage.QueuedTransacti key := idxToKey(index) value, err := s.db.Get(key) if err != nil { - if errors.Is(err, leveldb.ErrNotFound) { + if isErrNotFound(err) { return nil, nil } return nil, err From c227bab1812a003e9b0303912d5b8889cb31bc48 Mon Sep 17 00:00:00 2001 From: Mathis Antony Date: Tue, 30 Jul 2024 20:45:34 +0200 Subject: [PATCH 2/2] Use dbutil.IsErrNotFound --- arbnode/dataposter/dbstorage/storage.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arbnode/dataposter/dbstorage/storage.go b/arbnode/dataposter/dbstorage/storage.go index caa8385452..97055193a6 100644 --- a/arbnode/dataposter/dbstorage/storage.go +++ b/arbnode/dataposter/dbstorage/storage.go @@ -7,14 +7,12 @@ import ( "bytes" "context" "encoding/hex" - "errors" "fmt" "strconv" "github.com/ethereum/go-ethereum/ethdb" "github.com/offchainlabs/nitro/arbnode/dataposter/storage" "github.com/offchainlabs/nitro/util/dbutil" - "github.com/syndtr/goleveldb/leveldb" ) // Storage implements db based storage for batch poster. @@ -61,7 +59,7 @@ func (s *Storage) Get(_ context.Context, index uint64) (*storage.QueuedTransacti key := idxToKey(index) value, err := s.db.Get(key) if err != nil { - if isErrNotFound(err) { + if dbutil.IsErrNotFound(err) { return nil, nil } return nil, err