Skip to content

Commit

Permalink
wip: removed one debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
boodyvo committed Nov 12, 2024
1 parent d8ee91e commit 986ef50
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 31 deletions.
6 changes: 0 additions & 6 deletions app/ante/eip712.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand Down
3 changes: 0 additions & 3 deletions app/ante/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
}
8 changes: 0 additions & 8 deletions ethereum/eip712/eip712.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
10 changes: 1 addition & 9 deletions x/evm/types/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")
}
Expand Down
2 changes: 0 additions & 2 deletions x/feemarket/types/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package types

import (
errorsmod "cosmossdk.io/errors"
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
)

Expand All @@ -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")
}
Expand Down

0 comments on commit 986ef50

Please sign in to comment.