From 2356ac3b2c1109f3285d264c02b130b60cea021d Mon Sep 17 00:00:00 2001 From: mars Date: Thu, 23 May 2024 20:44:33 +0800 Subject: [PATCH] fix eth_call 'method handler crashed' error when tx has set maxFeePerBlobGas (#10452) `maxFeePerBlobGas` is nil, can not call SetFromBig directly --- 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 } }