Skip to content

Commit

Permalink
op-program: Make blob preimage be known when testing the known case (e…
Browse files Browse the repository at this point in the history
…thereum-optimism#9375)

Fixes teh prefetcher unit test to use the correct blob key when storing and not expect the blob data to be fetched (it should already be present).
  • Loading branch information
ajsutton authored Feb 7, 2024
1 parent 20348ba commit 5b34a86
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions op-program/host/prefetcher/prefetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,6 @@ func TestFetchL1Blob(t *testing.T) {
storeBlob(t, kv, (eth.Bytes48)(commitment), (*eth.Blob)(&blob))

oracle := l1.NewPreimageOracle(asOracleFn(t, prefetcher), asHinter(t, prefetcher))
blobFetcher.ExpectOnGetBlobSidecars(
context.Background(),
l1Ref,
[]eth.IndexedBlobHash{blobHash},
(eth.Bytes48)(commitment),
[]*eth.Blob{(*eth.Blob)(&blob)},
nil,
)
defer blobFetcher.AssertExpectations(t)

blobs := oracle.GetBlob(l1Ref, blobHash)
Expand Down Expand Up @@ -474,7 +466,7 @@ func storeBlob(t *testing.T, kv kvstore.KV, commitment eth.Bytes48, blob *eth.Bl
blobKeyBuf := make([]byte, 80)
copy(blobKeyBuf[:48], commitment[:])
for i := 0; i < params.BlobTxFieldElementsPerBlob; i++ {
binary.BigEndian.PutUint64(blobKeyBuf[:72], uint64(i))
binary.BigEndian.PutUint64(blobKeyBuf[72:], uint64(i))
feKey := crypto.Keccak256Hash(blobKeyBuf)

err = kv.Put(preimage.BlobKey(feKey).PreimageKey(), blob[i<<5:(i+1)<<5])
Expand Down

0 comments on commit 5b34a86

Please sign in to comment.