From ec28ad147a5580b1be087d930af9158f0e096023 Mon Sep 17 00:00:00 2001 From: Jihoon Song Date: Fri, 7 Feb 2025 22:58:17 +0900 Subject: [PATCH] Communicate with EL using inclusion list in hex --- beacon-chain/execution/engine_client_focil.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/beacon-chain/execution/engine_client_focil.go b/beacon-chain/execution/engine_client_focil.go index c4b19eca1ae..da6d44910ad 100644 --- a/beacon-chain/execution/engine_client_focil.go +++ b/beacon-chain/execution/engine_client_focil.go @@ -6,6 +6,7 @@ import ( "github.com/ethereum/go-ethereum/beacon/engine" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" @@ -33,13 +34,18 @@ func (s *Service) GetInclusionList(ctx context.Context, parentHash [32]byte) ([] ctx, cancel := context.WithDeadline(ctx, time.Now().Add(timeout)) defer cancel() - var result [][]byte + var result []hexutil.Bytes err := s.rpcClient.CallContext(ctx, &result, GetInclusionListV1, common.Hash(parentHash)) if err != nil { return nil, handleRPCError(err) } - return result, nil + bytesResult := make([][]byte, len(result)) + for i, b := range result { + bytesResult[i] = b + } + + return bytesResult, nil } // UpdatePayloadWithInclusionList updates a payload with a provided inclusion list of transactions. @@ -58,8 +64,13 @@ func (s *Service) UpdatePayloadWithInclusionList(ctx context.Context, payloadID ctx, cancel := context.WithDeadline(ctx, time.Now().Add(timeout)) defer cancel() + hexTxs := make([]hexutil.Bytes, len(txs)) + for i, tx := range txs { + hexTxs[i] = tx + } + result := &engine.PayloadID{} - err := s.rpcClient.CallContext(ctx, result, UpdatePayloadWithInclusionListV1, engine.PayloadID(payloadID), txs) + err := s.rpcClient.CallContext(ctx, result, UpdatePayloadWithInclusionListV1, engine.PayloadID(payloadID), hexTxs) if err != nil { return nil, handleRPCError(err) }