diff --git a/node/store_v2.go b/node/store_v2.go index 7b435adebf..82c46af83b 100644 --- a/node/store_v2.go +++ b/node/store_v2.go @@ -78,22 +78,10 @@ func (s *storeV2) StoreBatch(batch *corev2.Batch, rawBundles []*RawBundles) ([]k // Store blob shards for _, bundles := range rawBundles { - // Store blob certificate - blobCertificateKeyBuilder, err := s.db.GetKeyBuilder(BlobCertificateTableName) - if err != nil { - return nil, fmt.Errorf("failed to get key builder for blob certificate: %v", err) - } blobKey, err := bundles.BlobCertificate.BlobHeader.BlobKey() if err != nil { return nil, fmt.Errorf("failed to get blob key: %v", err) } - blobCertificateKey := blobCertificateKeyBuilder.Key(blobKey[:]) - blobCertificateBytes, err := bundles.BlobCertificate.Serialize() - if err != nil { - return nil, fmt.Errorf("failed to serialize blob certificate: %v", err) - } - keys = append(keys, blobCertificateKey) - dbBatch.PutWithTTL(blobCertificateKey, blobCertificateBytes, s.ttl) // Store bundles for quorum, bundle := range bundles.Bundles { diff --git a/node/store_v2_test.go b/node/store_v2_test.go index 50fc74d4de..26ee3a3bc0 100644 --- a/node/store_v2_test.go +++ b/node/store_v2_test.go @@ -44,7 +44,7 @@ func TestStoreBatchV2(t *testing.T) { }() keys, err := s.StoreBatch(batch, rawBundles) require.NoError(t, err) - require.Len(t, keys, 10) + require.Len(t, keys, 7) tables := db.GetTables() require.ElementsMatch(t, []string{node.BatchHeaderTableName, node.BlobCertificateTableName, node.BundleTableName}, tables) @@ -61,21 +61,6 @@ func TestStoreBatchV2(t *testing.T) { require.NoError(t, err) assert.Equal(t, batch.BatchHeader, deserializedBatchHeader) - // Check blob certificates - blobCertKeyBuilder, err := db.GetKeyBuilder(node.BlobCertificateTableName) - require.NoError(t, err) - for _, cert := range batch.BlobCertificates { - blobKey, err := cert.BlobHeader.BlobKey() - require.NoError(t, err) - blobCertKey := blobCertKeyBuilder.Key(blobKey[:]) - blobCertBytes, err := db.Get(blobCertKey) - require.NoError(t, err) - assert.NotNil(t, blobCertBytes) - deserializedBlobCert, err := corev2.DeserializeBlobCertificate(blobCertBytes) - require.NoError(t, err) - assert.Equal(t, cert, deserializedBlobCert) - } - // Check bundles bundleKeyBuilder, err := db.GetKeyBuilder(node.BundleTableName) require.NoError(t, err) @@ -103,14 +88,6 @@ func TestStoreBatchV2(t *testing.T) { bhhBytes, err = db.Get(batchHeaderKeyBuilder.Key(bhh[:])) require.Error(t, err) require.Empty(t, bhhBytes) - for _, cert := range batch.BlobCertificates { - blobKey, err := cert.BlobHeader.BlobKey() - require.NoError(t, err) - blobCertKey := blobCertKeyBuilder.Key(blobKey[:]) - blobCertBytes, err := db.Get(blobCertKey) - require.Error(t, err) - require.Empty(t, blobCertBytes) - } for _, bundles := range rawBundles { blobKey, err := bundles.BlobCertificate.BlobHeader.BlobKey()