Skip to content

Commit

Permalink
Communicate with EL using inclusion list in hex
Browse files Browse the repository at this point in the history
  • Loading branch information
jihoonsong committed Feb 7, 2025
1 parent 80fd041 commit ec28ad1
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions beacon-chain/execution/engine_client_focil.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.
Expand All @@ -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)
}
Expand Down

0 comments on commit ec28ad1

Please sign in to comment.