From 02408244cda52ad3ba8de3b35ef93f11324588c1 Mon Sep 17 00:00:00 2001 From: Justin Date: Thu, 27 Nov 2025 00:12:06 +0100 Subject: [PATCH] Update canonical.go --- beacon/light/canonical.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/beacon/light/canonical.go b/beacon/light/canonical.go index b5371493b4c9..56622425b23b 100644 --- a/beacon/light/canonical.go +++ b/beacon/light/canonical.go @@ -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