Skip to content
Draft
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2352,11 +2352,6 @@ func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig

}

// RegisterTxService implements the Application.RegisterTxService method.
func (app *App) RegisterTxService(clientCtx client.Context) {
authtx.RegisterTxService(app.GRPCQueryRouter(), clientCtx, app.Simulate, app.interfaceRegistry)
}

func (app *App) RPCContextProvider(i int64) sdk.Context {
if i == evmrpc.LatestCtxHeight {
ctx := app.GetCheckCtx()
Expand All @@ -2381,9 +2376,10 @@ func (app *App) RPCContextProvider(i int64) sdk.Context {
return ctx.WithIsEVM(true).WithTraceMode(true).WithIsCheckTx(false)
}

// RegisterTendermintService implements the Application.RegisterTendermintService method.
func (app *App) RegisterTendermintService(clientCtx client.Context) {
tmservice.RegisterTendermintService(app.GRPCQueryRouter(), clientCtx, app.interfaceRegistry)
// RegisterTendermintService implements the Application.RegisterLocalServices method.
func (app *App) RegisterLocalServices(node client.LocalClient, txConfig client.TxConfig) {
authtx.RegisterTxService(app.GRPCQueryRouter(), node, txConfig, app.Simulate, app.interfaceRegistry)
tmservice.RegisterTendermintService(app.GRPCQueryRouter(), node, app.interfaceRegistry)
txConfigProvider := func(height int64) client.TxConfig {
if app.ChainID != "pacific-1" {
return app.encodingConfig.TxConfig
Expand All @@ -2396,7 +2392,7 @@ func (app *App) RegisterTendermintService(clientCtx client.Context) {
}

if app.evmRPCConfig.HTTPEnabled {
evmHTTPServer, err := evmrpc.NewEVMHTTPServer(app.evmRPCConfig, clientCtx.Client, &app.EvmKeeper, app.BeginBlockKeepers, app.BaseApp, app.TracerAnteHandler, app.RPCContextProvider, txConfigProvider, DefaultNodeHome, app.GetStateStore(), nil)
evmHTTPServer, err := evmrpc.NewEVMHTTPServer(app.evmRPCConfig, node, &app.EvmKeeper, app.BeginBlockKeepers, app.BaseApp, app.TracerAnteHandler, app.RPCContextProvider, txConfigProvider, DefaultNodeHome, app.GetStateStore(), nil)
if err != nil {
panic(err)
}
Expand All @@ -2409,7 +2405,7 @@ func (app *App) RegisterTendermintService(clientCtx client.Context) {
}

if app.evmRPCConfig.WSEnabled {
evmWSServer, err := evmrpc.NewEVMWebSocketServer(app.evmRPCConfig, clientCtx.Client, &app.EvmKeeper, app.BeginBlockKeepers, app.BaseApp, app.TracerAnteHandler, app.RPCContextProvider, txConfigProvider, DefaultNodeHome, app.GetStateStore())
evmWSServer, err := evmrpc.NewEVMWebSocketServer(app.evmRPCConfig, node, &app.EvmKeeper, app.BeginBlockKeepers, app.BaseApp, app.TracerAnteHandler, app.RPCContextProvider, txConfigProvider, DefaultNodeHome, app.GetStateStore())
if err != nil {
panic(err)
}
Expand Down
7 changes: 0 additions & 7 deletions docker/localnode/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
### Main Base Config Options ###
#######################################################################

# TCP or UNIX socket address of the ABCI application,
# or the name of an ABCI application compiled in with the Tendermint binary
proxy-app = "tcp://127.0.0.1:26658"

# A custom human readable name for this node
moniker = "sei-node-0"

Expand Down Expand Up @@ -59,9 +55,6 @@ genesis-file = "config/genesis.json"
# Path to the JSON file containing the private key to use for node authentication in the p2p protocol
node-key-file = "config/node_key.json"

# Mechanism to connect to the ABCI application: socket | grpc
abci = "socket"

#######################################################
### Priv Validator Configuration ###
#######################################################
Expand Down
7 changes: 0 additions & 7 deletions docker/rpcnode/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
### Main Base Config Options ###
#######################################################################

# TCP or UNIX socket address of the ABCI application,
# or the name of an ABCI application compiled in with the Tendermint binary
proxy-app = "tcp://127.0.0.1:26658"

# A custom human readable name for this node
moniker = "sei-rpc-node"

Expand Down Expand Up @@ -59,9 +55,6 @@ genesis-file = "config/genesis.json"
# Path to the JSON file containing the private key to use for node authentication in the p2p protocol
node-key-file = "config/node_key.json"

# Mechanism to connect to the ABCI application: socket | grpc
abci = "socket"

#######################################################
### Priv Validator Configuration ###
#######################################################
Expand Down
7 changes: 0 additions & 7 deletions docs/migration/seiv2_config_migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ pending-ttl-num-blocks = 0
### Main Base Config Options ###
#######################################################################

# TCP or UNIX socket address of the ABCI application,
# or the name of an ABCI application compiled in with the Tendermint binary
proxy-app = "tcp://127.0.0.1:26658"

# A custom human readable name for this node
moniker = "demo"

Expand Down Expand Up @@ -99,9 +95,6 @@ genesis-file = "config/genesis.json"
# Path to the JSON file containing the private key to use for node authentication in the p2p protocol
node-key-file = "config/node_key.json"

# Mechanism to connect to the ABCI application: socket | grpc
abci = "socket"

#######################################################
### Priv Validator Configuration ###
#######################################################
Expand Down
5 changes: 2 additions & 3 deletions evmrpc/association.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ import (
"github.com/sei-protocol/sei-chain/sei-cosmos/client"
sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types"
sdkerrors "github.com/sei-protocol/sei-chain/sei-cosmos/types/errors"
rpcclient "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client"
"github.com/sei-protocol/sei-chain/x/evm/keeper"
"github.com/sei-protocol/sei-chain/x/evm/types"
"github.com/sei-protocol/sei-chain/x/evm/types/ethtx"
)

type AssociationAPI struct {
tmClient rpcclient.Client
tmClient client.LocalClient
keeper *keeper.Keeper
ctxProvider func(int64) sdk.Context
txConfigProvider func(int64) client.TxConfig
Expand All @@ -31,7 +30,7 @@ type AssociationAPI struct {
}

func NewAssociationAPI(
tmClient rpcclient.Client,
tmClient client.LocalClient,
k *keeper.Keeper,
ctxProvider func(int64) sdk.Context,
txConfigProvider func(int64) client.TxConfig,
Expand Down
9 changes: 4 additions & 5 deletions evmrpc/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/sei-protocol/sei-chain/sei-cosmos/client"
sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types"
banktypes "github.com/sei-protocol/sei-chain/sei-cosmos/x/bank/types"
rpcclient "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client"
"github.com/sei-protocol/sei-chain/sei-tendermint/rpc/coretypes"
wasmtypes "github.com/sei-protocol/sei-chain/sei-wasmd/x/wasm/types"
"github.com/sei-protocol/sei-chain/x/evm/keeper"
Expand Down Expand Up @@ -69,7 +68,7 @@ func encodeGenesisBlock() map[string]any {
}

type BlockAPI struct {
tmClient rpcclient.Client
tmClient client.LocalClient
keeper *keeper.Keeper
ctxProvider func(int64) sdk.Context
txConfigProvider func(int64) client.TxConfig
Expand All @@ -87,7 +86,7 @@ type SeiBlockAPI struct {
isPanicTx func(ctx context.Context, hash common.Hash) (bool, error)
}

func NewBlockAPI(tmClient rpcclient.Client, k *keeper.Keeper, ctxProvider func(int64) sdk.Context, txConfigProvider func(int64) client.TxConfig, connectionType ConnectionType, watermarks *WatermarkManager, globalBlockCache BlockCache, cacheCreationMutex *sync.Mutex) *BlockAPI {
func NewBlockAPI(tmClient client.LocalClient, k *keeper.Keeper, ctxProvider func(int64) sdk.Context, txConfigProvider func(int64) client.TxConfig, connectionType ConnectionType, watermarks *WatermarkManager, globalBlockCache BlockCache, cacheCreationMutex *sync.Mutex) *BlockAPI {
return &BlockAPI{
tmClient: tmClient,
keeper: k,
Expand All @@ -104,7 +103,7 @@ func NewBlockAPI(tmClient rpcclient.Client, k *keeper.Keeper, ctxProvider func(i
}

func NewSeiBlockAPI(
tmClient rpcclient.Client,
tmClient client.LocalClient,
k *keeper.Keeper,
ctxProvider func(int64) sdk.Context,
txConfigProvider func(int64) client.TxConfig,
Expand Down Expand Up @@ -134,7 +133,7 @@ func NewSeiBlockAPI(
}

func NewSei2BlockAPI(
tmClient rpcclient.Client,
tmClient client.LocalClient,
k *keeper.Keeper,
ctxProvider func(int64) sdk.Context,
txConfigProvider func(int64) client.TxConfig,
Expand Down
2 changes: 2 additions & 0 deletions evmrpc/block_txcount_parity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ type parityTxCountTMClient struct {
block *coretypes.ResultBlock
}

func (*parityTxCountTMClient) IsLocal() {}

func (c *parityTxCountTMClient) Block(_ context.Context, h *int64) (*coretypes.ResultBlock, error) {
if h != nil && *h == parityTestHeight {
return c.block, nil
Expand Down
7 changes: 3 additions & 4 deletions evmrpc/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/sei-protocol/sei-chain/sei-cosmos/client"
sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types"
"github.com/sei-protocol/sei-chain/sei-db/ledger_db/receipt"
rpcclient "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client"
"github.com/sei-protocol/sei-chain/sei-tendermint/rpc/coretypes"
tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/types"
"github.com/sei-protocol/sei-chain/utils/metrics"
Expand Down Expand Up @@ -236,7 +235,7 @@ func (h *logMergeHeap) Pop() interface{} {
}

type FilterAPI struct {
tmClient rpcclient.Client
tmClient client.LocalClient
filtersMu sync.RWMutex
filters map[ethrpc.ID]filter
toDelete chan ethrpc.ID
Expand All @@ -261,7 +260,7 @@ type EventItemDataWrapper struct {
}

func NewFilterAPI(
tmClient rpcclient.Client,
tmClient client.LocalClient,
k *keeper.Keeper,
ctxProvider func(int64) sdk.Context,
txConfigProvider func(int64) client.TxConfig,
Expand Down Expand Up @@ -696,7 +695,7 @@ func (a *FilterAPI) Cleanup() {
}

type LogFetcher struct {
tmClient rpcclient.Client
tmClient client.LocalClient
k *keeper.Keeper
txConfigProvider func(int64) client.TxConfig
ctxProvider func(int64) sdk.Context
Expand Down
2 changes: 2 additions & 0 deletions evmrpc/height_availability_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ type heightTestClient struct {
latest int64
}

func (*heightTestClient) IsLocal() {}

func newHeightTestClient(highHeight, earliest, latest int64) *heightTestClient {
return &heightTestClient{
Client: mock.Client{},
Expand Down
5 changes: 2 additions & 3 deletions evmrpc/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/ethereum/go-ethereum/rpc"
"github.com/sei-protocol/sei-chain/sei-cosmos/client"
sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types"
rpcclient "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client"
"github.com/sei-protocol/sei-chain/sei-tendermint/rpc/coretypes"
"github.com/sei-protocol/sei-chain/x/evm/keeper"
evmtypes "github.com/sei-protocol/sei-chain/x/evm/types"
Expand All @@ -25,7 +24,7 @@ const defaultPriorityFeePerGas = 1000000000 // 1gwei
const defaultThresholdPercentage = 80 // 80%

type InfoAPI struct {
tmClient rpcclient.Client
tmClient client.LocalClient
keeper *keeper.Keeper
ctxProvider func(int64) sdk.Context
txConfigProvider func(int64) client.TxConfig
Expand All @@ -36,7 +35,7 @@ type InfoAPI struct {
watermarks *WatermarkManager
}

func NewInfoAPI(tmClient rpcclient.Client, k *keeper.Keeper, ctxProvider func(int64) sdk.Context, txConfigProvider func(int64) client.TxConfig, homeDir string, maxBlocks int64, connectionType ConnectionType, txDecoder sdk.TxDecoder, watermarks *WatermarkManager) *InfoAPI {
func NewInfoAPI(tmClient client.LocalClient, k *keeper.Keeper, ctxProvider func(int64) sdk.Context, txConfigProvider func(int64) client.TxConfig, homeDir string, maxBlocks int64, connectionType ConnectionType, txDecoder sdk.TxDecoder, watermarks *WatermarkManager) *InfoAPI {
return &InfoAPI{tmClient: tmClient, keeper: k, ctxProvider: ctxProvider, txConfigProvider: txConfigProvider, homeDir: homeDir, connectionType: connectionType, maxBlocks: maxBlocks, txDecoder: txDecoder, watermarks: watermarks}
}

Expand Down
6 changes: 3 additions & 3 deletions evmrpc/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ package evmrpc
import (
"fmt"

"github.com/sei-protocol/sei-chain/sei-cosmos/client"
sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types"
"github.com/sei-protocol/sei-chain/sei-tendermint/libs/time"
rpcclient "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client"
"github.com/sei-protocol/sei-chain/x/evm/keeper"
)

type NetAPI struct {
tmClient rpcclient.Client
tmClient client.LocalClient
keeper *keeper.Keeper
ctxProvider func(int64) sdk.Context
connectionType ConnectionType
}

func NewNetAPI(tmClient rpcclient.Client, k *keeper.Keeper, ctxProvider func(int64) sdk.Context, connectionType ConnectionType) *NetAPI {
func NewNetAPI(tmClient client.LocalClient, k *keeper.Keeper, ctxProvider func(int64) sdk.Context, connectionType ConnectionType) *NetAPI {
return &NetAPI{tmClient: tmClient, keeper: k, ctxProvider: ctxProvider, connectionType: connectionType}
}

Expand Down
5 changes: 2 additions & 3 deletions evmrpc/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ import (
"github.com/sei-protocol/sei-chain/sei-cosmos/client"
sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types"
sdkerrors "github.com/sei-protocol/sei-chain/sei-cosmos/types/errors"
rpcclient "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client"
"github.com/sei-protocol/sei-chain/x/evm/keeper"
"github.com/sei-protocol/sei-chain/x/evm/types"
"github.com/sei-protocol/sei-chain/x/evm/types/ethtx"
)

type SendAPI struct {
tmClient rpcclient.Client
tmClient client.LocalClient
txConfigProvider func(int64) client.TxConfig
sendConfig *SendConfig
keeper *keeper.Keeper
Expand All @@ -41,7 +40,7 @@ type SendConfig struct {
}

func NewSendAPI(
tmClient rpcclient.Client,
tmClient client.LocalClient,
txConfigProvider func(int64) client.TxConfig,
sendConfig *SendConfig,
k *keeper.Keeper,
Expand Down
5 changes: 2 additions & 3 deletions evmrpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/sei-protocol/sei-chain/sei-cosmos/client"
sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types"
"github.com/sei-protocol/sei-chain/sei-db/db_engine/types"
rpcclient "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client"
evmCfg "github.com/sei-protocol/sei-chain/x/evm/config"
"github.com/sei-protocol/sei-chain/x/evm/keeper"
)
Expand All @@ -35,7 +34,7 @@ type EVMServer interface {

func NewEVMHTTPServer(
config evmrpcconfig.Config,
tmClient rpcclient.Client,
tmClient client.LocalClient,
k *keeper.Keeper,
beginBlockKeepers legacyabci.BeginBlockKeepers,
app *baseapp.BaseApp,
Expand Down Expand Up @@ -229,7 +228,7 @@ func NewEVMHTTPServer(

func NewEVMWebSocketServer(
config evmrpcconfig.Config,
tmClient rpcclient.Client,
tmClient client.LocalClient,
k *keeper.Keeper,
beginBlockKeepers legacyabci.BeginBlockKeepers,
app *baseapp.BaseApp,
Expand Down
2 changes: 2 additions & 0 deletions evmrpc/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ type MockClient struct {
latestOverride int64
}

func (*MockClient) IsLocal() {}

func NewMockClientWithLatest(latest int64) *MockClient {
return &MockClient{latestOverride: latest}
}
Expand Down
7 changes: 3 additions & 4 deletions evmrpc/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
"github.com/sei-protocol/sei-chain/sei-cosmos/client"
sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types"
abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types"
rpcclient "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client"
"github.com/sei-protocol/sei-chain/sei-tendermint/rpc/coretypes"
tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/types"
"github.com/sei-protocol/sei-chain/utils"
Expand All @@ -59,7 +58,7 @@ func NewSimulationAPI(
keeper *keeper.Keeper,
beginBlockKeepers legacyabci.BeginBlockKeepers,
txConfigProvider func(int64) client.TxConfig,
tmClient rpcclient.Client,
tmClient client.LocalClient,
config *SimulateConfig,
app *baseapp.BaseApp,
antehandler sdk.AnteHandler,
Expand Down Expand Up @@ -222,7 +221,7 @@ type Backend struct {
ctxProvider func(int64) sdk.Context
txConfigProvider func(int64) client.TxConfig
keeper *keeper.Keeper
tmClient rpcclient.Client
tmClient client.LocalClient
config *SimulateConfig
app *baseapp.BaseApp
beginBlockKeepers legacyabci.BeginBlockKeepers
Expand All @@ -237,7 +236,7 @@ func NewBackend(
keeper *keeper.Keeper,
beginBlockKeepers legacyabci.BeginBlockKeepers,
txConfigProvider func(int64) client.TxConfig,
tmClient rpcclient.Client,
tmClient client.LocalClient,
config *SimulateConfig,
app *baseapp.BaseApp,
antehandler sdk.AnteHandler,
Expand Down
Loading
Loading