Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion beacon/light/canonical.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ func newCanonicalStore[T any](db ethdb.Iteratee, keyPrefix []byte) (*canonicalSt

// databaseKey returns the database key belonging to the given period.
func (cs *canonicalStore[T]) databaseKey(period uint64) []byte {
return binary.BigEndian.AppendUint64(append([]byte{}, cs.keyPrefix...), period)
key := make([]byte, len(cs.keyPrefix)+8)
copy(key, cs.keyPrefix)
binary.BigEndian.PutUint64(key[len(cs.keyPrefix):], period)
return key
}

// add adds the given item to the database. It also ensures that the range remains
Expand Down
Loading