Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions testing/simulated/execution/simulation_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (

"github.com/berachain/beacon-kit/execution/client"
gethprimitives "github.com/berachain/beacon-kit/geth-primitives"
"github.com/berachain/beacon-kit/primitives/crypto"
"github.com/berachain/beacon-kit/primitives/encoding/json"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
Expand Down Expand Up @@ -66,16 +67,17 @@ type TransactionArgs struct {

// BlockOverrides holds optional block-level overrides for simulation.
type BlockOverrides struct {
Number *hexutil.Big `json:"number,omitempty"`
Difficulty *hexutil.Big `json:"difficulty,omitempty"`
Time *hexutil.Uint64 `json:"time,omitempty"`
GasLimit *hexutil.Uint64 `json:"gasLimit,omitempty"`
FeeRecipient *common.Address `json:"feeRecipient,omitempty"`
PrevRandao *common.Hash `json:"prevRandao,omitempty"`
BaseFeePerGas *hexutil.Big `json:"baseFeePerGas,omitempty"`
BlobBaseFee *hexutil.Big `json:"blobBaseFee,omitempty"`
BeaconRoot *common.Hash `json:"beaconRoot,omitempty"`
Withdrawals gethprimitives.Withdrawals
Number *hexutil.Big `json:"number,omitempty"`
Difficulty *hexutil.Big `json:"difficulty,omitempty"`
Time *hexutil.Uint64 `json:"time,omitempty"`
GasLimit *hexutil.Uint64 `json:"gasLimit,omitempty"`
FeeRecipient *common.Address `json:"feeRecipient,omitempty"`
PrevRandao *common.Hash `json:"prevRandao,omitempty"`
BaseFeePerGas *hexutil.Big `json:"baseFeePerGas,omitempty"`
BlobBaseFee *hexutil.Big `json:"blobBaseFee,omitempty"`
BeaconRoot *common.Hash `json:"beaconRoot,omitempty"`
Withdrawals *gethprimitives.Withdrawals
ProposerPubkey *crypto.BLSPubkey
}

// SimBlock is a block containing calls and optional overrides for simulation.
Expand Down
3 changes: 2 additions & 1 deletion testing/simulated/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func DefaultSimulationInput(
overrideBaseFeePerGas := origBlock.GetBody().GetExecutionPayload().GetBaseFeePerGas().ToBig()
overrideBeaconRoot := gethcommon.HexToHash(origBlock.GetParentBlockRoot().Hex())
origWithdrawls := origBlock.GetBody().GetExecutionPayload().GetWithdrawals()
overrideWithdrawals := *(*gethtypes.Withdrawals)(unsafe.Pointer(&origWithdrawls))
overrideWithdrawals := (*gethtypes.Withdrawals)(unsafe.Pointer(&origWithdrawls))

calls, err := execution.TxsToTransactionArgs(chainSpec.DepositEth1ChainID(), txs)
require.NoError(t, err)
Expand All @@ -224,6 +224,7 @@ func DefaultSimulationInput(
BaseFeePerGas: (*hexutil.Big)(overrideBaseFeePerGas),
BeaconRoot: &overrideBeaconRoot,
Withdrawals: overrideWithdrawals,
// TODO: Get the override proposer pubkey from beacon state.
// TODO: Do we need to override blob base fee?
},
},
Expand Down
Loading