-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement validateGasWanted()
#48
Conversation
@@ -41,6 +41,11 @@ func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate | |||
|
|||
newCtx = SetGasMeter(simulate, ctx, gasTx.GetGas()) | |||
|
|||
err = validateGasWanted(newCtx) | |||
if err != nil { | |||
return newCtx, sdkerrors.Wrap(sdkerrors.ErrOutOfGas, err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is ErrOutOfGas
proper for this error? I'd like to hear your opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it is proper error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@@ -41,6 +41,11 @@ func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate | |||
|
|||
newCtx = SetGasMeter(simulate, ctx, gasTx.GetGas()) | |||
|
|||
err = validateGasWanted(newCtx) | |||
if err != nil { | |||
return newCtx, sdkerrors.Wrap(sdkerrors.ErrOutOfGas, err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it is proper error
* build: bump up tendermint to v0.33.9-0.1.0-rc2 * feat: implement `validateGasWanted()` (#48) * feat: impl `validateGasWanted()` * fix: lint error * chore: bump up tendermint * fix: tests to use `grpc` instead of `socket` * fix: revert the transport of the server to socket Co-authored-by: KIm, JinSan <jinsan@linecorp.com>
* feat: impl `validateGasWanted()` * fix: lint error * chore: bump up tendermint * fix: tests to use `grpc` instead of `socket` # Conflicts: # go.mod # go.sum # server/start.go # x/genutil/client/cli/init_test.go
* feat: impl `validateGasWanted()` * fix: lint error * chore: bump up tendermint * fix: tests to use `grpc` instead of `socket` # Conflicts: # go.mod # go.sum # server/start.go # x/genutil/client/cli/init_test.go
Related with: https://github.com/line/link/issues/1153, tendermint/tendermint#5675, tendermint/tendermint#3546, Finschia/ostracon#158, (Finschia/ostracon#157)
Description
Validate
GasWanted
duringante handler
. It's need to remove tendermint mempool.postCheck().It should reconstruct the same logic with https://github.com/line/tendermint/blob/a01efd28c7257d3b056d1fcf263d39ccea3c1273/mempool/mempool.go#L126
Motivation and context
How has this been tested?
make test
Checklist: