Skip to content

Commit 2356ac3

Browse files
marshalysyperbasis
authored andcommitted
fix eth_call 'method handler crashed' error when tx has set maxFeePerBlobGas (#10452)
`maxFeePerBlobGas` is nil, can not call SetFromBig directly
1 parent b0df97f commit 2356ac3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

turbo/adapter/ethapi/api.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ func (args *CallArgs) ToMessage(globalGasCap uint64, baseFee *uint256.Int) (type
133133
}
134134
}
135135
if args.MaxFeePerBlobGas != nil {
136-
maxFeePerBlobGas.SetFromBig(args.MaxFeePerBlobGas.ToInt())
136+
blobFee, overflow := uint256.FromBig(args.MaxFeePerBlobGas.ToInt())
137+
if overflow {
138+
return types.Message{}, fmt.Errorf("args.MaxFeePerBlobGas higher than 2^256-1")
139+
}
140+
maxFeePerBlobGas = blobFee
137141
}
138142
}
139143

0 commit comments

Comments
 (0)