From 986ef503477d8da2efdd79e1d033aaa6f0f8e0af Mon Sep 17 00:00:00 2001 From: Vladyslav Budichenko Date: Tue, 12 Nov 2024 16:43:05 -0500 Subject: [PATCH] wip: removed one debug log --- app/ante/eip712.go | 6 ------ app/ante/setup.go | 3 --- ethereum/eip712/eip712.go | 8 -------- go.mod | 2 +- go.sum | 4 ++-- x/evm/types/msg.go | 10 +--------- x/feemarket/types/msg.go | 2 -- 7 files changed, 4 insertions(+), 31 deletions(-) diff --git a/app/ante/eip712.go b/app/ante/eip712.go index 57b760c981..721d51e303 100644 --- a/app/ante/eip712.go +++ b/app/ante/eip712.go @@ -105,8 +105,6 @@ func (svd LegacyEip712SigVerificationDecorator) AnteHandle(ctx sdk.Context, simulate bool, next sdk.AnteHandler, ) (newCtx sdk.Context, err error) { - fmt.Println("AnteHandle for eip712") - // no need to verify signatures on recheck tx if ctx.IsReCheckTx() { return next(ctx, tx, simulate) @@ -129,15 +127,11 @@ func (svd LegacyEip712SigVerificationDecorator) AnteHandle(ctx sdk.Context, return ctx, err } - fmt.Println("eip712 sigs: ", sigs) - signerAddrs, err := sigTx.GetSigners() if err != nil { return ctx, err } - fmt.Println("eip712 addresses: ", sigs) - // EIP712 allows just one signature if len(sigs) != 1 { return ctx, errorsmod.Wrapf( diff --git a/app/ante/setup.go b/app/ante/setup.go index c1dfd6c23c..5e7772358c 100644 --- a/app/ante/setup.go +++ b/app/ante/setup.go @@ -172,7 +172,6 @@ func (vbd EthValidateBasicDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu evmDenom := evmParams.GetEvmDenom() for _, msg := range protoTx.GetMsgs() { - fmt.Println("eth msg", msg) msgEthTx, ok := msg.(*evmtypes.MsgEthereumTx) if !ok { return ctx, errorsmod.Wrapf(errortypes.ErrUnknownRequest, "invalid message type %T, expected %T", msg, (*evmtypes.MsgEthereumTx)(nil)) @@ -212,7 +211,5 @@ func (vbd EthValidateBasicDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu return ctx, errorsmod.Wrapf(errortypes.ErrInvalidRequest, "invalid AuthInfo Fee GasLimit (%d != %d)", authInfo.Fee.GasLimit, txGasLimit) } - fmt.Println("going to call next for eth ante") - return next(ctx, tx, simulate) } diff --git a/ethereum/eip712/eip712.go b/ethereum/eip712/eip712.go index cedf37a03b..5b75770744 100644 --- a/ethereum/eip712/eip712.go +++ b/ethereum/eip712/eip712.go @@ -55,7 +55,6 @@ func ConstructUntypedEIP712Data( msgs []sdk.Msg, memo string, ) []byte { - fmt.Println("ConstructUntypedEIP712Data") // tx.TipTx interface was removed, added types.TxWithTimeoutHeight, they have been deprecated and should not be used since v0.46.0 // Deprecated: Please use x/tx/signing/aminojson instead. signBytes := legacytx.StdSignBytes(chainID, accnum, sequence, timeout, fee, msgs, memo) @@ -111,12 +110,10 @@ func EncodeData(typedData apitypes.TypedData, primaryType string, data map[strin // Add field contents. Structs and arrays have special handlers. for _, field := range typedData.Types[primaryType] { - fmt.Println("field", field) encType := field.Type encValue := data[field.Name] if encType[len(encType)-1:] == "]" { arrayValue, ok := encValue.([]interface{}) - fmt.Println("arrayValue 1", arrayValue, ok) if !ok { return nil, dataMismatchError(encType, encValue) } @@ -126,19 +123,16 @@ func EncodeData(typedData apitypes.TypedData, primaryType string, data map[strin for _, item := range arrayValue { if typedData.Types[parsedType] != nil { mapValue, ok := item.(map[string]interface{}) - fmt.Println("mapValue 1", mapValue, ok) if !ok { return nil, dataMismatchError(parsedType, item) } encodedData, err := typedData.EncodeData(parsedType, mapValue, depth+1) - fmt.Println("encodedData 1", encodedData, err) if err != nil { return nil, err } arrayBuffer.Write(crypto.Keccak256(encodedData)) } else { bytesValue, err := typedData.EncodePrimitiveValue(parsedType, item, depth) - fmt.Println("bytesValue 1", bytesValue, err) if err != nil { return nil, err } @@ -149,12 +143,10 @@ func EncodeData(typedData apitypes.TypedData, primaryType string, data map[strin buffer.Write(crypto.Keccak256(arrayBuffer.Bytes())) } else if typedData.Types[field.Type] != nil { mapValue, ok := encValue.(map[string]interface{}) - fmt.Println("mapValue 2", mapValue, ok) if !ok { return nil, dataMismatchError(encType, encValue) } encodedData, err := typedData.EncodeData(field.Type, mapValue, depth+1) - fmt.Println("encodedData 2", encodedData, err) if err != nil { return nil, err } diff --git a/go.mod b/go.mod index dd10b9a7e9..5e4b2db9d4 100644 --- a/go.mod +++ b/go.mod @@ -252,7 +252,7 @@ replace ( //github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.47.10-iavl-v1-kava.1 //github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.50.10-test-patch 5f9239e3147358ef034bfc4d19aacb34e5ea2064 - github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.0.0-20241107170058-27e0ccccc208 + github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.0.0-20241112214135-3a130e4e7d2b //github.com/cosmos/cosmos-sdk => ../cosmos-sdk // Use cosmos-sdk fork with staking transfer events, and custom tally handler support //github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.47.10-iavl-v1-kava.1 diff --git a/go.sum b/go.sum index dc17129677..509a331967 100644 --- a/go.sum +++ b/go.sum @@ -812,8 +812,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kava-labs/cometbft v0.0.0-20241007151334-8345af773eb9 h1:EdyFg0j6Q8oVy3EynAEQm/M2CyMhBZrTlFjcORLjw5g= github.com/kava-labs/cometbft v0.0.0-20241007151334-8345af773eb9/go.mod h1:GPHp3/pehPqgX1930HmK1BpBLZPxB75v/dZg8Viwy+o= -github.com/kava-labs/cosmos-sdk v0.0.0-20241107170058-27e0ccccc208 h1:0Z/vypO858xcywSSzxuDsuFW+CuuxeE+8XR1jyMM7qQ= -github.com/kava-labs/cosmos-sdk v0.0.0-20241107170058-27e0ccccc208/go.mod h1:Yf8jj8R5+9NWCbdot0IMId92WeAIF22Thc/pRR2hSoI= +github.com/kava-labs/cosmos-sdk v0.0.0-20241112214135-3a130e4e7d2b h1:dVGjiu/kopkyFK8DUOlm5SVq/u3QIBdoTLIkW14lRsQ= +github.com/kava-labs/cosmos-sdk v0.0.0-20241112214135-3a130e4e7d2b/go.mod h1:Yf8jj8R5+9NWCbdot0IMId92WeAIF22Thc/pRR2hSoI= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= diff --git a/x/evm/types/msg.go b/x/evm/types/msg.go index 1b64baac5f..0164235356 100644 --- a/x/evm/types/msg.go +++ b/x/evm/types/msg.go @@ -16,15 +16,13 @@ package types import ( + sdkmath "cosmossdk.io/math" txsigning "cosmossdk.io/x/tx/signing" "errors" "fmt" signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "google.golang.org/protobuf/reflect/protoreflect" "math/big" - "runtime/debug" - - sdkmath "cosmossdk.io/math" errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/client" @@ -92,9 +90,6 @@ func newMsgEthereumTx( chainID *big.Int, nonce uint64, to *common.Address, amount *big.Int, gasLimit uint64, gasPrice, gasFeeCap, gasTipCap *big.Int, input []byte, accesses *ethtypes.AccessList, ) *MsgEthereumTx { - fmt.Println("Going to create eth transaction") - debug.PrintStack() - var ( cid, amt, gp *sdkmath.Int toAddr string @@ -195,7 +190,6 @@ func (msg MsgEthereumTx) Type() string { return TypeMsgEthereumTx } // ValidateBasic implements the sdk.Msg interface. It performs basic validation // checks of a Transaction. If returns an error if validation fails. func (msg MsgEthereumTx) ValidateBasic() error { - fmt.Println("MsgEthereumTx.ValidateBasic") if msg.From != "" { if err := types.ValidateAddress(msg.From); err != nil { return errorsmod.Wrap(err, "invalid from address") @@ -262,7 +256,6 @@ func (msg *MsgEthereumTx) GetMsgsV2() ([]protov2.Message, error) { //} func (msg *MsgEthereumTx) GetSigners() ([][]byte, error) { - fmt.Println("MsgEthereumTx GetSigners was triggered") data, err := UnpackTxData(msg.Data) if err != nil { return nil, err @@ -513,7 +506,6 @@ func (m MsgUpdateParams) GetSigners() []sdk.AccAddress { // ValidateBasic does a sanity check of the provided data func (m *MsgUpdateParams) ValidateBasic() error { - fmt.Println("MsgUpdateParams.ValidateBasic") if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { return errorsmod.Wrap(err, "invalid authority address") } diff --git a/x/feemarket/types/msg.go b/x/feemarket/types/msg.go index 80221561c2..71d49fdbc9 100644 --- a/x/feemarket/types/msg.go +++ b/x/feemarket/types/msg.go @@ -2,7 +2,6 @@ package types import ( errorsmod "cosmossdk.io/errors" - "fmt" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -16,7 +15,6 @@ func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress { // ValidateBasic does a sanity check of the provided data func (m *MsgUpdateParams) ValidateBasic() error { - fmt.Println("MsgUpdateParams.ValidateBasic") if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { return errorsmod.Wrap(err, "invalid authority address") }