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
12 changes: 10 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2388,7 +2388,11 @@ 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)
client, err := clientCtx.GetNode()
if err != nil {
panic(err)
}
evmHTTPServer, err := evmrpc.NewEVMHTTPServer(app.evmRPCConfig, client, &app.EvmKeeper, app.BeginBlockKeepers, app.BaseApp, app.TracerAnteHandler, app.RPCContextProvider, txConfigProvider, DefaultNodeHome, app.GetStateStore(), nil)
if err != nil {
panic(err)
}
Expand All @@ -2401,7 +2405,11 @@ 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())
client, err := clientCtx.GetNode()
if err != nil {
panic(err)
}
evmWSServer, err := evmrpc.NewEVMWebSocketServer(app.evmRPCConfig, client, &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
3 changes: 2 additions & 1 deletion loadtest/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/sei-protocol/sei-chain/sei-cosmos/types/tx/signing"
xauthsigning "github.com/sei-protocol/sei-chain/sei-cosmos/x/auth/signing"
authtypes "github.com/sei-protocol/sei-chain/sei-cosmos/x/auth/types"
rpcclient "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client"
)

type AccountInfo struct {
Expand Down Expand Up @@ -226,7 +227,7 @@ func (sc *SignerClient) GetAccountNumberSequenceNumber(privKey cryptotypes.PrivK
}
context := client.Context{}
context = context.WithNodeURI(sc.NodeURI)
context = context.WithClient(cl)
context = client.WithClient[rpcclient.Client](context, cl)
context = context.WithInterfaceRegistry(TestConfig.InterfaceRegistry)
userHomeDir, _ := os.UserHomeDir()
kr, _ := keyring.New(sdk.KeyringServiceName(), "test", filepath.Join(userHomeDir, ".sei"), os.Stdin)
Expand Down
10 changes: 5 additions & 5 deletions sei-cosmos/client/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (e ErrMempoolIsFull) Error() string {
// based on the context parameters. The result of the broadcast is parsed into
// an intermediate structure which is logged if the context has a logger
// defined.
func (ctx Context) BroadcastTx(txBytes []byte) (res *sdk.TxResponse, err error) {
func (ctx contextG[C]) BroadcastTx(txBytes []byte) (res *sdk.TxResponse, err error) {
switch ctx.BroadcastMode {
case flags.BroadcastSync:
res, err = ctx.BroadcastTxSync(txBytes)
Expand Down Expand Up @@ -116,7 +116,7 @@ func CheckTendermintError(err error, tx tmtypes.Tx) *sdk.TxResponse {
// NOTE: This should ideally not be used as the request may timeout but the tx
// may still be included in a block. Use BroadcastTxAsync or BroadcastTxSync
// instead.
func (ctx Context) BroadcastTxCommit(txBytes []byte) (*sdk.TxResponse, error) {
func (ctx contextG[C]) BroadcastTxCommit(txBytes []byte) (*sdk.TxResponse, error) {
node, err := ctx.GetNode()
if err != nil {
return nil, err
Expand All @@ -135,7 +135,7 @@ func (ctx Context) BroadcastTxCommit(txBytes []byte) (*sdk.TxResponse, error) {

// BroadcastTxSync broadcasts transaction bytes to a Tendermint node
// synchronously (i.e. returns after CheckTx execution).
func (ctx Context) BroadcastTxSync(txBytes []byte) (*sdk.TxResponse, error) {
func (ctx contextG[C]) BroadcastTxSync(txBytes []byte) (*sdk.TxResponse, error) {
node, err := ctx.GetNode()
if err != nil {
return nil, err
Expand All @@ -151,7 +151,7 @@ func (ctx Context) BroadcastTxSync(txBytes []byte) (*sdk.TxResponse, error) {

// BroadcastTxAsync broadcasts transaction bytes to a Tendermint node
// asynchronously (i.e. returns immediately).
func (ctx Context) BroadcastTxAsync(txBytes []byte) (*sdk.TxResponse, error) {
func (ctx contextG[C]) BroadcastTxAsync(txBytes []byte) (*sdk.TxResponse, error) {
node, err := ctx.GetNode()
if err != nil {
return nil, err
Expand All @@ -167,7 +167,7 @@ func (ctx Context) BroadcastTxAsync(txBytes []byte) (*sdk.TxResponse, error) {

// TxServiceBroadcast is a helper function to broadcast a Tx with the correct gRPC types
// from the tx service. Calls `clientCtx.BroadcastTx` under the hood.
func TxServiceBroadcast(grpcCtx context.Context, clientCtx Context, req *tx.BroadcastTxRequest) (*tx.BroadcastTxResponse, error) {
func (clientCtx contextG[C]) TxServiceBroadcast(grpcCtx context.Context, req *tx.BroadcastTxRequest) (*tx.BroadcastTxResponse, error) {
if req == nil || req.TxBytes == nil {
return nil, status.Error(codes.InvalidArgument, "invalid empty tx")
}
Expand Down
6 changes: 4 additions & 2 deletions sei-cosmos/client/broadcast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (

"github.com/sei-protocol/sei-chain/sei-cosmos/client/flags"
sdkerrors "github.com/sei-protocol/sei-chain/sei-cosmos/types/errors"
"github.com/sei-protocol/sei-chain/sei-tendermint/libs/utils"
rpcclient "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client"
)

type MockClient struct {
Expand All @@ -34,8 +36,8 @@ func (c MockClient) BroadcastTxSync(ctx context.Context, tx tmtypes.Tx) (*ctypes

func CreateContextWithErrorAndMode(err error, mode string) Context {
return Context{
Client: MockClient{err: err},
BroadcastMode: mode,
Client: utils.Some[rpcclient.Client](MockClient{err: err}),
contextBase: contextBase{BroadcastMode: mode},
}
}

Expand Down
5 changes: 3 additions & 2 deletions sei-cosmos/client/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/pkg/errors"
"github.com/sei-protocol/sei-chain/sei-tendermint/libs/cli"
rpcclient "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client"
"github.com/spf13/cobra"
"github.com/spf13/pflag"

Expand Down Expand Up @@ -133,7 +134,7 @@ func ReadPersistentCommandFlags(clientCtx Context, flagSet *pflag.FlagSet) (Cont
}
}

if clientCtx.Client == nil || flagSet.Changed(flags.FlagNode) {
if !clientCtx.Client.IsPresent() || flagSet.Changed(flags.FlagNode) {
rpcURI, _ := flagSet.GetString(flags.FlagNode)
if rpcURI != "" {
clientCtx = clientCtx.WithNodeURI(rpcURI)
Expand All @@ -143,7 +144,7 @@ func ReadPersistentCommandFlags(clientCtx Context, flagSet *pflag.FlagSet) (Cont
return clientCtx, err
}

clientCtx = clientCtx.WithClient(client)
clientCtx = WithClient[rpcclient.Client](clientCtx, client)
}
}

Expand Down
6 changes: 3 additions & 3 deletions sei-cosmos/client/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"path/filepath"

"github.com/sei-protocol/sei-chain/sei-cosmos/client"
rpcclient "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client"
)

// Default constants
Expand Down Expand Up @@ -84,13 +85,12 @@ func ReadFromClientConfig(ctx client.Context) (client.Context, error) {
ctx = ctx.WithKeyring(keyring)

// https://github.com/cosmos/cosmos-sdk/issues/8986
client, err := client.NewClientFromNode(conf.Node)
c, err := client.NewClientFromNode(conf.Node)
if err != nil {
return ctx, fmt.Errorf("couldn't get client from nodeURI: %v", err)
}

ctx = ctx.WithNodeURI(conf.Node).
WithClient(client).
ctx = client.WithClient[rpcclient.Client](ctx.WithNodeURI(conf.Node), c).
WithBroadcastMode(conf.BroadcastMode)

return ctx, nil
Expand Down
Loading
Loading