From befcfb33ef1eceb37b175cf95d4724814666bf9b Mon Sep 17 00:00:00 2001 From: j75689 Date: Wed, 16 Aug 2023 09:50:55 +0800 Subject: [PATCH] fix: skip SigGasConsume on genesis block --- Makefile | 2 +- x/auth/ante/sigverify.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d9e2e24c81..87c24652b2 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/x/auth/ante/sigverify.go b/x/auth/ante/sigverify.go index 8b94335124..ceb9f82604 100644 --- a/x/auth/ante/sigverify.go +++ b/x/auth/ante/sigverify.go @@ -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")