-
Notifications
You must be signed in to change notification settings - Fork 566
Internal Transaction Panic #1242
Comments
Really weird, when I try to call contract with old block height as context, I got the same issue It got crashed somewhere because, let's see this code of method var args types.TransactionArgs
err := json.Unmarshal(req.Args, &args)
if err != nil {
return nil, status.Error(codes.InvalidArgument, err.Error())
}
cfg, err := k.EVMConfig(ctx)
if err != nil {
// I added check and it didn't reach here because there was no error
return nil, status.Error(codes.Internal, err.Error())
}
nonce := k.GetNonce(ctx, args.GetFrom())
args.Nonce = (*hexutil.Uint64)(&nonce)
msg, err := args.ToMessage(req.GasCap, cfg.BaseFee)
if err != nil {
return nil, status.Error(codes.InvalidArgument, err.Error())
}
txConfig := statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash()))
// I added check and it still pass this line
res, err := k.ApplyMessageWithConfig(ctx, msg, nil, false, cfg, txConfig)
if err != nil {
// I added check and it didn't reach here
return nil, status.Error(codes.Internal, err.Error())
}
return res, nil As you can see, I added debug code in 3 places so it must be crashed somewhere The method I used to check is I call method get name of contract 0x3f75ceabcdfed1aca03257dc6bdc0408e2b4b026 at height = 59501 (one block after it was created) This was reproduced on Evmos mainnet network |
So I already addressed where the issue comes from. Let take a look at the following stack trace and DO NOT care about the line number because I edited the ethermint lib to add something
The thing lead to the nil pointer error is this one minGasMultiplier := k.GetMinGasMultiplier(ctx)
minimumGasUsed := gasLimit.Mul(minGasMultiplier) Click here to go to source code That So when I changed minGasMultiplier := k.GetMinGasMultiplier(ctx) into minGasMultiplier := k.GetMinGasMultiplier(ctx)
if minGasMultiplier.IsNil() {
minGasMultiplier = sdk.NewDecWithPrec(5, 1) // 0.5
} The code runs gracefully |
@facs95 close? |
Steps to reproduce:
Expected behavior: Run a successful trace
Actual behavior:
Additional info: This was reproduce against Evmos mainnet network
The text was updated successfully, but these errors were encountered: