Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion app/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (app *App) DeliverTxBatch(ctx sdk.Context, req sdk.DeliverTxBatchRequest) (
scheduler := tasks.NewScheduler(app.ConcurrencyWorkers(), app.TracingInfo, app.DeliverTx)
txRes, err := scheduler.ProcessAll(ctx, req.TxEntries)
if err != nil {
ctx.Logger().Error("error while processing scheduler", "err", err)
logger.Error("error while processing scheduler", "err", err)
panic(err)
}
for _, tx := range txRes {
Expand Down
8 changes: 4 additions & 4 deletions app/ante/cosmos_checktx.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,21 +491,21 @@ func UpdateSigners(ctx sdk.Context, tx sdk.Tx, accountKeeper authkeeper.AccountK
continue
}
if acc.GetPubKey() == nil {
ctx.Logger().Error(fmt.Sprintf("missing pubkey for %s", signer.String()))
logger.Error("missing pubkey for signer", "signer", signer)
events = append(events, sdk.NewEvent(evmtypes.EventTypeSigner,
sdk.NewAttribute(evmtypes.AttributeKeySeiAddress, signer.String())))
continue
}
pk, err := btcec.ParsePubKey(acc.GetPubKey().Bytes())
if err != nil {
ctx.Logger().Debug(fmt.Sprintf("failed to parse pubkey for %s, likely due to the fact that it isn't on secp256k1 curve", acc.GetPubKey()), "err", err)
logger.Debug("failed to parse pubkey, likely due to the fact that it isn't on secp256k1 curve", "pub-key", acc.GetPubKey(), "err", err)
events = append(events, sdk.NewEvent(evmtypes.EventTypeSigner,
sdk.NewAttribute(evmtypes.AttributeKeySeiAddress, signer.String())))
continue
}
evmAddr, err := helpers.PubkeyToEVMAddress(pk.SerializeUncompressed())
if err != nil {
ctx.Logger().Error(fmt.Sprintf("failed to get EVM address from pubkey due to %s", err))
logger.Error("failed to get EVM address from pubkey", "err", err)
events = append(events, sdk.NewEvent(evmtypes.EventTypeSigner,
sdk.NewAttribute(evmtypes.AttributeKeySeiAddress, signer.String())))
continue
Expand All @@ -516,7 +516,7 @@ func UpdateSigners(ctx sdk.Context, tx sdk.Tx, accountKeeper authkeeper.AccountK
evmKeeper.SetAddressMapping(ctx, signer, evmAddr)
associationHelper := helpers.NewAssociationHelper(evmKeeper, evmKeeper.BankKeeper(), accountKeeper)
if err := associationHelper.MigrateBalance(ctx, evmAddr, signer, false); err != nil {
ctx.Logger().Error(fmt.Sprintf("failed to migrate EVM address balance (%s) %s", evmAddr.Hex(), err))
logger.Error("failed to migrate EVM address balance", "address", evmAddr, "err", err)
return nil, err
}
if evmtypes.IsTxMsgAssociate(tx) {
Expand Down
7 changes: 5 additions & 2 deletions app/ante/evm_checktx.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ import (
"github.com/sei-protocol/sei-chain/x/evm/state"
evmtypes "github.com/sei-protocol/sei-chain/x/evm/types"
"github.com/sei-protocol/sei-chain/x/evm/types/ethtx"
"github.com/sei-protocol/seilog"
)

var logger = seilog.NewLogger("app", "ante")

func EvmCheckTxAnte(
ctx sdk.Context,
txConfig client.TxConfig,
Expand Down Expand Up @@ -174,13 +177,13 @@ func EvmStatelessChecks(ctx sdk.Context, tx sdk.Tx, chainID *big.Int) error {
case ethtypes.LegacyTxType:
// legacy either can have a zero or correct chain ID
if txChainID.Cmp(big.NewInt(0)) != 0 && txChainID.Cmp(chainID) != 0 {
ctx.Logger().Debug("chainID mismatch", "txChainID", txChainID, "chainID", chainID)
logger.Debug("chainID mismatch", "txChainID", txChainID, "chainID", chainID)
return sdkerrors.ErrInvalidChainID
}
default:
// after legacy, all transactions must have the correct chain ID
if txChainID.Cmp(chainID) != 0 {
ctx.Logger().Debug("chainID mismatch", "txChainID", txChainID, "chainID", chainID)
logger.Debug("chainID mismatch", "txChainID", txChainID, "chainID", chainID)
return sdkerrors.ErrInvalidChainID
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/antedecorators/authz_nested_message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestAuthzNestedEvmMessage(t *testing.T) {
anteDecorators := []sdk.AnteDecorator{
antedecorators.NewAuthzNestedMessageDecorator(),
}
ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil)
ctx := sdk.NewContext(nil, tmproto.Header{}, false)
chainedHandler := sdk.ChainAnteDecorators(anteDecorators...)

nestedEvmMessage := authz.NewMsgExec(addr1, []sdk.Msg{&evmtypes.MsgEVMTransaction{}})
Expand Down
5 changes: 4 additions & 1 deletion app/antedecorators/gasless.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ import (
evmtypes "github.com/sei-protocol/sei-chain/x/evm/types"
oraclekeeper "github.com/sei-protocol/sei-chain/x/oracle/keeper"
oracletypes "github.com/sei-protocol/sei-chain/x/oracle/types"
"github.com/sei-protocol/seilog"
)

var logger = seilog.NewLogger("app", "antedecorators")

type GaslessDecorator struct {
wrapped []sdk.AnteDecorator
oracleKeeper oraclekeeper.Keeper
Expand Down Expand Up @@ -70,7 +73,7 @@ func (gd GaslessDecorator) handleWrapped(ctx sdk.Context, tx sdk.Tx, simulate bo
func IsTxGasless(tx sdk.Tx, ctx sdk.Context, oracleKeeper oraclekeeper.Keeper, evmKeeper *evmkeeper.Keeper) (isGasless bool, err error) {
defer func() {
if r := recover(); r != nil {
ctx.Logger().Error("panic recovered in IsTxGasless", "panic", r)
logger.Error("panic recovered in IsTxGasless", "err", r)
err = fmt.Errorf("panic in IsTxGasless: %v", r)
isGasless = false
}
Expand Down
2 changes: 1 addition & 1 deletion app/antedecorators/gasless_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func TestNonGaslessMsg(t *testing.T) {
// this needs to be updated if its changed from constant true
// reset gasless
gasless = true
err := CallGaslessDecoratorWithMsg(sdk.NewContext(nil, tmproto.Header{}, false, nil).WithIsCheckTx(true), &oracletypes.MsgDelegateFeedConsent{}, oraclekeeper.Keeper{}, nil)
err := CallGaslessDecoratorWithMsg(sdk.NewContext(nil, tmproto.Header{}, false).WithIsCheckTx(true), &oracletypes.MsgDelegateFeedConsent{}, oraclekeeper.Keeper{}, nil)
require.NoError(t, err)
require.False(t, gasless)
}
6 changes: 3 additions & 3 deletions app/antedecorators/priority_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestPriorityAnteDecorator(t *testing.T) {
anteDecorators := []sdk.AnteDecorator{
antedecorators.NewPriorityDecorator(),
}
ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil)
ctx := sdk.NewContext(nil, tmproto.Header{}, false)
chainedHandler := sdk.ChainAnteDecorators(anteDecorators...)
// test with normal priority
newCtx, err := chainedHandler(
Expand All @@ -41,7 +41,7 @@ func TestPriorityAnteDecoratorTooHighPriority(t *testing.T) {
anteDecorators := []sdk.AnteDecorator{
antedecorators.NewPriorityDecorator(),
}
ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil)
ctx := sdk.NewContext(nil, tmproto.Header{}, false)
chainedHandler := sdk.ChainAnteDecorators(anteDecorators...)
// test with too high priority, should be auto capped
newCtx, err := chainedHandler(
Expand All @@ -62,7 +62,7 @@ func TestPriorityAnteDecoratorOracleMsg(t *testing.T) {
anteDecorators := []sdk.AnteDecorator{
antedecorators.NewPriorityDecorator(),
}
ctx := sdk.NewContext(nil, tmproto.Header{}, false, nil)
ctx := sdk.NewContext(nil, tmproto.Header{}, false)
chainedHandler := sdk.ChainAnteDecorators(anteDecorators...)
// test with zero priority, should be bumped up to oracle priority
newCtx, err := chainedHandler(
Expand Down
2 changes: 1 addition & 1 deletion app/antedecorators/traced_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ func TestTracedDecorator(t *testing.T) {
return antedecorators.NewTracedAnteDecorator(d, nil)
})
chainedHandler := sdk.ChainAnteDecorators(tracedDecorators...)
chainedHandler(sdk.NewContext(nil, tmproto.Header{}, false, nil), FakeTx{}, false)
chainedHandler(sdk.NewContext(nil, tmproto.Header{}, false), FakeTx{}, false)
require.Equal(t, "onetwothree", output)
}
Loading
Loading