From d3af20327dae68958d52092264cd59b99bd978bc Mon Sep 17 00:00:00 2001 From: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com> Date: Mon, 27 May 2024 22:39:41 +0200 Subject: [PATCH] fix eth_call 'method handler crashed' error when tx has set maxFeePerBlobGas (#10506) Cherry pick PR #10452 into the release branch Co-authored-by: mars --- turbo/adapter/ethapi/api.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/turbo/adapter/ethapi/api.go b/turbo/adapter/ethapi/api.go index e733c7bad38..9e179234e3e 100644 --- a/turbo/adapter/ethapi/api.go +++ b/turbo/adapter/ethapi/api.go @@ -133,7 +133,11 @@ func (args *CallArgs) ToMessage(globalGasCap uint64, baseFee *uint256.Int) (type } } if args.MaxFeePerBlobGas != nil { - maxFeePerBlobGas.SetFromBig(args.MaxFeePerBlobGas.ToInt()) + blobFee, overflow := uint256.FromBig(args.MaxFeePerBlobGas.ToInt()) + if overflow { + return types.Message{}, fmt.Errorf("args.MaxFeePerBlobGas higher than 2^256-1") + } + maxFeePerBlobGas = blobFee } }