diff --git a/go.mod b/go.mod index b8f3ed8f2a..4d86299343 100644 --- a/go.mod +++ b/go.mod @@ -176,6 +176,7 @@ require ( github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/skeema/knownhosts v1.2.2 // indirect + github.com/stretchr/objx v0.5.2 // indirect github.com/supranational/blst v0.3.11 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect github.com/tdewolff/minify/v2 v2.20.14 // indirect diff --git a/go.sum b/go.sum index 82896ead8b..074401d594 100644 --- a/go.sum +++ b/go.sum @@ -942,8 +942,8 @@ gorm.io/gorm v1.20.7/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gorm.io/gorm v1.21.3/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gorm.io/gorm v1.24.0/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= -gorm.io/gorm v1.25.10 h1:dQpO+33KalOA+aFYGlK+EfxcI5MbO7EP2yYygwh9h+s= -gorm.io/gorm v1.25.10/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= +gorm.io/gorm v1.25.9 h1:wct0gxZIELDk8+ZqF/MVnHLkA1rvYlBWUMv2EdsK1g8= +gorm.io/gorm v1.25.9/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= diff --git a/packages/blobstorage/pkg/repo/repositories.go b/packages/blobstorage/pkg/repo/repositories.go index af10d8dfa0..e5b14c8b86 100644 --- a/packages/blobstorage/pkg/repo/repositories.go +++ b/packages/blobstorage/pkg/repo/repositories.go @@ -2,6 +2,7 @@ package repo import ( "context" + "errors" "log/slog" blobstorage "github.com/taikoxyz/taiko-mono/packages/blobstorage" @@ -58,6 +59,10 @@ func (r *Repositories) SaveBlobAndBlockMeta( saveBlobHashOpts.BlobData, ) if err != nil { + if errors.Is(err, gorm.ErrDuplicatedKey) { + slog.Warn("Duplicate entry for blob, continuing", "blobHash", saveBlobHashOpts.BlobHash) + return nil + } slog.Error("Error storing blob in DB", "error", err) return err }