Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
p0mvn committed Dec 20, 2023
1 parent fee01c9 commit 4e61c80
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,8 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re
return sdk.GasInfo{}, nil, nil, 0, err
}

ctx.Logger().With("sim", "info").Info("runTx start", "tx_hash", tx.GetMsgs())

msgs := tx.GetMsgs()
if err := validateBasicTxMsgs(msgs); err != nil {
return sdk.GasInfo{}, nil, nil, 0, err
Expand Down
9 changes: 9 additions & 0 deletions x/auth/ante/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,19 @@ func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate
if !ok {
// Set a gas meter with limit 0 as to prevent an infinite gas meter attack
// during runTx.

if simulate {
ctx.Logger().With("sim", "info").Info("SetUpContextDecorator not gasTx, inf gas meter")
}

newCtx = SetGasMeter(simulate, ctx, 0)
return newCtx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "Tx must be GasTx")
}

if simulate {
ctx.Logger().With("sim", "info").Info("SetUpContextDecorator gasTx - reg gas meter")
}

newCtx = SetGasMeter(simulate, ctx, gasTx.GetGas())

if cp := ctx.ConsensusParams(); cp != nil && cp.Block != nil {
Expand Down

0 comments on commit 4e61c80

Please sign in to comment.