Skip to content

Commit

Permalink
fix: skip SigGasConsume on genesis block
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Aug 16, 2023
1 parent ca02e03 commit befcfb3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ include contrib/devtools/Makefile
###############################################################################

BUILD_TARGETS := build install

.PHONY: build build-linux-amd64 build-linux-arm64
build: BUILD_ARGS=-o $(BUILDDIR)/

build-linux-amd64:
Expand Down
4 changes: 4 additions & 0 deletions x/auth/ante/sigverify.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ func NewSigGasConsumeDecorator(ak AccountKeeper, sigGasConsumer SignatureVerific
}

func (sgcd SigGasConsumeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) {
if ctx.BlockHeight() == 0 {
// skip the signature verification on the genesis block
return next(ctx, tx, simulate)
}
sigTx, ok := tx.(authsigning.SigVerifiableTx)
if !ok {
return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type")
Expand Down

0 comments on commit befcfb3

Please sign in to comment.