Skip to content

Commit

Permalink
Fix panic on missing base gas fee. (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
lthibault authored Feb 28, 2024
1 parent 3ce0d49 commit b694404
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/vm/contracts_suave_eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ func (b *suaveRuntime) buildEthBlock(blockArgs types.BuildBlockArgs, dataID type

payload, err := executableDataToDenebExecutionPayload(envelope.ExecutionPayload)
if err != nil {
log.Warn("failed to generate execution payload from executable data",
"reason", err)
return nil, nil, fmt.Errorf("could not format execution payload as deneb payload: %w", err)
}

Expand Down Expand Up @@ -337,7 +339,9 @@ func executableDataToDenebExecutionPayload(data *dencun.ExecutableData) (*specDe
}

baseFeePerGas := new(uint256.Int)
if baseFeePerGas.SetFromBig(data.BaseFeePerGas) {
if data.BaseFeePerGas == nil {
return nil, errors.New("base fee per gas: not provided")
} else if baseFeePerGas.SetFromBig(data.BaseFeePerGas) {
return nil, errors.New("base fee per gas: overflow")
}

Expand Down

0 comments on commit b694404

Please sign in to comment.