Skip to content

Commit

Permalink
Merge pull request #2167 from OffchainLabs/fix-blob-preimages
Browse files Browse the repository at this point in the history
Fix recording blob preimages
  • Loading branch information
PlasmaPower committed Mar 2, 2024
2 parents 60ff801 + f761877 commit 26fad6f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion staker/stateless_block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ func (v *StatelessBlockValidator) ValidationEntryRecord(ctx context.Context, e *
e.Preimages[arbutil.EthVersionedHashPreimageType] = make(map[common.Hash][]byte)
}
for i, blob := range blobs {
e.Preimages[arbutil.EthVersionedHashPreimageType][versionedHashes[i]] = blob[:]
// Prevent aliasing `blob` when slicing it, as for range loops overwrite the same variable
// Won't be necessary after Go 1.22 with https://go.dev/blog/loopvar-preview
b := blob
e.Preimages[arbutil.EthVersionedHashPreimageType][versionedHashes[i]] = b[:]
}
}
if arbstate.IsDASMessageHeaderByte(batch.Data[40]) {
Expand Down

0 comments on commit 26fad6f

Please sign in to comment.