Skip to content

Commit

Permalink
Merge pull request #363 from ethpandaops/fix/execution-payload
Browse files Browse the repository at this point in the history
fix(proto): beacon block execution payload BaseFeePerGas
  • Loading branch information
Savid authored Aug 15, 2024
2 parents 78ced40 + 68b49ce commit be26a7f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/proto/eth/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package eth

import (
"fmt"
"math/big"

"github.com/attestantio/go-eth2-client/spec"
"github.com/attestantio/go-eth2-client/spec/bellatrix"
Expand Down Expand Up @@ -141,7 +142,7 @@ func NewEventBlockFromBellatrix(block *spec.VersionedSignedBeaconBlock) *v2.Even
GasUsed: &wrapperspb.UInt64Value{Value: block.Bellatrix.Message.Body.ExecutionPayload.GasUsed},
Timestamp: &wrapperspb.UInt64Value{Value: block.Bellatrix.Message.Body.ExecutionPayload.Timestamp},
ExtraData: fmt.Sprintf("0x%x", block.Bellatrix.Message.Body.ExecutionPayload.ExtraData),
BaseFeePerGas: fmt.Sprintf("0x%x", block.Bellatrix.Message.Body.ExecutionPayload.BaseFeePerGas[:]),
BaseFeePerGas: new(big.Int).SetBytes(block.Capella.Message.Body.ExecutionPayload.BaseFeePerGas[:]).String(),
BlockHash: block.Bellatrix.Message.Body.ExecutionPayload.BlockHash.String(),
Transactions: getTransactions(block.Bellatrix.Message.Body.ExecutionPayload.Transactions),
},
Expand Down Expand Up @@ -190,7 +191,7 @@ func NewEventBlockFromCapella(block *spec.VersionedSignedBeaconBlock) *v2.EventB
GasUsed: &wrapperspb.UInt64Value{Value: block.Capella.Message.Body.ExecutionPayload.GasUsed},
Timestamp: &wrapperspb.UInt64Value{Value: block.Capella.Message.Body.ExecutionPayload.Timestamp},
ExtraData: fmt.Sprintf("0x%x", block.Capella.Message.Body.ExecutionPayload.ExtraData),
BaseFeePerGas: fmt.Sprintf("0x%x", block.Capella.Message.Body.ExecutionPayload.BaseFeePerGas[:]),
BaseFeePerGas: new(big.Int).SetBytes(block.Capella.Message.Body.ExecutionPayload.BaseFeePerGas[:]).String(),
BlockHash: block.Capella.Message.Body.ExecutionPayload.BlockHash.String(),
Transactions: getTransactions(block.Capella.Message.Body.ExecutionPayload.Transactions),
Withdrawals: v1.NewWithdrawalsFromCapella(block.Capella.Message.Body.ExecutionPayload.Withdrawals),
Expand Down

0 comments on commit be26a7f

Please sign in to comment.