From 52e302b9ab90faead74843b3866705d65f2657ef Mon Sep 17 00:00:00 2001 From: Giulio Rebuffo Date: Tue, 30 Nov 2021 14:14:04 +0100 Subject: [PATCH] ops again --- cmd/rpcdaemon/commands/engine_api.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/rpcdaemon/commands/engine_api.go b/cmd/rpcdaemon/commands/engine_api.go index 15850a26e..ec1be8124 100644 --- a/cmd/rpcdaemon/commands/engine_api.go +++ b/cmd/rpcdaemon/commands/engine_api.go @@ -2,6 +2,7 @@ package commands import ( "context" + "fmt" "math/big" "github.com/holiman/uint256" @@ -75,7 +76,11 @@ func (e *EngineImpl) ForkchoiceUpdatedV1(_ context.Context, _ struct{}, buildPay func (e *EngineImpl) ExecutePayloadV1(ctx context.Context, payload ExecutionPayload) (map[string]interface{}, error) { var baseFee *uint256.Int if payload.BaseFeePerGas != nil { - baseFee, _ = uint256.FromBig((*big.Int)(payload.BaseFeePerGas)) + var overflow bool + baseFee, overflow = uint256.FromBig((*big.Int)(payload.BaseFeePerGas)) + if overflow { + return nil, fmt.Errorf("invalid request") + } } // Maximum length of extra is 32 bytes so we can use the hash datatype extra := common.BytesToHash(payload.Extra)