From 0195d1a00ec32d7a3ad12a76585b6f9e178c0794 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 17 Oct 2024 01:00:24 +0200 Subject: [PATCH] eth/catalyst: remove unsafe --- eth/catalyst/api.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index 85a24ff47d..c91b4fe546 100644 --- a/eth/catalyst/api.go +++ b/eth/catalyst/api.go @@ -23,7 +23,6 @@ import ( "strconv" "sync" "time" - "unsafe" "github.com/ethereum/go-ethereum/beacon/engine" "github.com/ethereum/go-ethereum/common" @@ -1262,5 +1261,9 @@ func convertRequests(hex []hexutil.Bytes) [][]byte { if hex == nil { return nil } - return unsafe.Slice((*[]byte)(unsafe.SliceData(hex)), len(hex)) + req := make([][]byte, len(hex)) + for i := range hex { + req[i] = hex[i] + } + return req }