From ffac0a11d9ff6aa533a1c7a650d07e16625b03de Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Thu, 30 Apr 2026 12:40:27 +0200 Subject: [PATCH 1/7] reduced runTx results --- sei-cosmos/baseapp/abci.go | 18 +++++---- sei-cosmos/baseapp/baseapp.go | 53 ++++++++++++--------------- sei-cosmos/baseapp/deliver_tx_test.go | 6 +-- sei-cosmos/baseapp/test_helpers.go | 8 ++-- 4 files changed, 41 insertions(+), 44 deletions(-) diff --git a/sei-cosmos/baseapp/abci.go b/sei-cosmos/baseapp/abci.go index fe822d86e8..33b9ae2883 100644 --- a/sei-cosmos/baseapp/abci.go +++ b/sei-cosmos/baseapp/abci.go @@ -178,14 +178,16 @@ func (app *BaseApp) DeliverTx(ctx sdk.Context, req abci.RequestDeliverTxV2, tx s telemetry.SetGauge(float32(gInfo.GasWanted), "tx", "gas", "wanted") }() - gInfo, result, anteEvents, _, _, _, _, resCtx, err := app.runTx(ctx.WithTxBytes(req.Tx).WithTxSum(checksum), runTxModeDeliver, tx, checksum) //nolint:dogsled // Because life is worth living instead of fixing this, considering sei solo is around the corner. + runTxRes, err := app.runTx(ctx.WithTxBytes(req.Tx).WithTxSum(checksum), runTxModeDeliver, tx, checksum) + gInfo = runTxRes.gasInfo + result := runTxRes.result if err != nil { resultStr = "failed" // if we have a result, use those events instead of just the anteEvents if result != nil { return sdkerrors.ResponseDeliverTxWithEvents(err, gInfo.GasWanted, gInfo.GasUsed, sdk.MarkEventsToIndex(result.Events, app.IndexEvents), app.trace) } - return sdkerrors.ResponseDeliverTxWithEvents(err, gInfo.GasWanted, gInfo.GasUsed, sdk.MarkEventsToIndex(anteEvents, app.IndexEvents), app.trace) + return sdkerrors.ResponseDeliverTxWithEvents(err, gInfo.GasWanted, gInfo.GasUsed, sdk.MarkEventsToIndex(runTxRes.anteEvents, app.IndexEvents), app.trace) } res = abci.ResponseDeliverTx{ @@ -195,11 +197,11 @@ func (app *BaseApp) DeliverTx(ctx sdk.Context, req abci.RequestDeliverTxV2, tx s Data: result.Data, Events: sdk.MarkEventsToIndex(result.Events, app.IndexEvents), } - if resCtx.IsEVM() { + if runTxRes.ctx.IsEVM() { res.EvmTxInfo = &abci.EvmTxInfo{ - SenderAddress: resCtx.EVMSenderAddress(), - Nonce: resCtx.EVMNonce(), - TxHash: resCtx.EVMTxHash(), + SenderAddress: runTxRes.ctx.EVMSenderAddress(), + Nonce: runTxRes.ctx.EVMNonce(), + TxHash: runTxRes.ctx.EVMTxHash(), VmError: result.EvmError, } // TODO: populate error data for EVM err @@ -762,8 +764,8 @@ func (app *BaseApp) Simulate(txBytes []byte) (sdk.GasInfo, *sdk.Result, error) { if err != nil { return sdk.GasInfo{}, nil, err } - gasInfo, result, _, _, _, _, _, _, err := app.runTx(ctx, runTxModeSimulate, tx, sha256.Sum256(txBytes)) //nolint:dogsled // Because life is worth living instead of fixing this, considering sei solo is around the corner. - return gasInfo, result, err + runTxRes, err := app.runTx(ctx, runTxModeSimulate, tx, sha256.Sum256(txBytes)) + return runTxRes.gasInfo, runTxRes.result, err } func handleQueryApp(app *BaseApp, path []string, req abci.RequestQuery) abci.ResponseQuery { diff --git a/sei-cosmos/baseapp/baseapp.go b/sei-cosmos/baseapp/baseapp.go index c4f44d32ff..605c74e4ff 100644 --- a/sei-cosmos/baseapp/baseapp.go +++ b/sei-cosmos/baseapp/baseapp.go @@ -809,6 +809,13 @@ func (app *BaseApp) CacheTxContext(ctx sdk.Context, checksum [32]byte) (sdk.Cont return ctx.WithMultiStore(msCache), msCache } +type runTxResult struct { + gasInfo sdk.GasInfo + result *sdk.Result + anteEvents []abci.Event + ctx sdk.Context +} + // runTx processes a transaction within a given execution mode, encoded transaction // bytes, and the decoded transaction itself. All state transitions occur through // a cached Context depending on the mode provided. State only gets persisted @@ -816,17 +823,7 @@ func (app *BaseApp) CacheTxContext(ctx sdk.Context, checksum [32]byte) (sdk.Cont // Note, gas execution info is always returned. A reference to a Result is // returned if the tx does not run out of gas and if all the messages are valid // and execute successfully. An error is returned otherwise. -func (app *BaseApp) runTx(ctx sdk.Context, mode runTxMode, tx sdk.Tx, checksum [32]byte) ( - gInfo sdk.GasInfo, - result *sdk.Result, - anteEvents []abci.Event, - priority int64, - pendingTxChecker abci.PendingTxChecker, - expireHandler abci.ExpireTxHandler, - checkTxCallback func(int64), - txCtx sdk.Context, - err error, -) { +func (app *BaseApp) runTx(ctx sdk.Context, mode runTxMode, tx sdk.Tx, checksum [32]byte) (runTxRes runTxResult, err error) { defer telemetry.MeasureThroughputSinceWithLabels( telemetry.TxCount, []metrics.Label{ @@ -840,6 +837,7 @@ func (app *BaseApp) runTx(ctx sdk.Context, mode runTxMode, tx sdk.Tx, checksum [ defer span.End() ctx = ctx.WithTraceSpanContext(spanCtx) span.SetAttributes(attribute.String("txHash", fmt.Sprintf("%X", checksum))) + runTxRes.ctx = ctx // NOTE: GasWanted should be returned by the AnteHandler. GasUsed is // determined by the GasMeter. We need access to the context to get the gas @@ -854,22 +852,22 @@ func (app *BaseApp) runTx(ctx sdk.Context, mode runTxMode, tx sdk.Tx, checksum [ if r := recover(); r != nil { recoveryMW := newOutOfGasRecoveryMiddleware(gasWanted, ctx, app.runTxRecoveryMiddleware) recoveryMW = newOCCAbortRecoveryMiddleware(recoveryMW) // TODO: do we have to wrap with occ enabled check? - err, result = processRecovery(r, recoveryMW), nil + err, runTxRes.result = processRecovery(r, recoveryMW), nil } if ctx.GasMeter() == blockGasMeter { return } - gInfo = sdk.GasInfo{GasWanted: gasWanted, GasUsed: ctx.GasMeter().GasConsumed(), GasEstimate: gasEstimate} + runTxRes.gasInfo = sdk.GasInfo{GasWanted: gasWanted, GasUsed: ctx.GasMeter().GasConsumed(), GasEstimate: gasEstimate} }() if tx == nil { - return sdk.GasInfo{}, nil, nil, 0, nil, nil, nil, ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "tx decode error") + return runTxRes, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "tx decode error") } msgs := tx.GetMsgs() if err := validateBasicTxMsgs(msgs); err != nil { - return sdk.GasInfo{}, nil, nil, 0, nil, nil, nil, ctx, err + return runTxRes, err } if app.anteHandler != nil { @@ -905,6 +903,7 @@ func (app *BaseApp) runTx(ctx sdk.Context, mode runTxMode, tx sdk.Tx, checksum [ // The GasMeter is a pointer and its passed to the RunMsg and tracks the consumed // gas there too. ctx = newCtx.WithMultiStore(ms) + runTxRes.ctx = ctx } defer func() { if newCtx.DeliverTxCallback() != nil { @@ -915,19 +914,15 @@ func (app *BaseApp) runTx(ctx sdk.Context, mode runTxMode, tx sdk.Tx, checksum [ events := ctx.EventManager().Events() if err != nil { - return gInfo, nil, nil, 0, nil, nil, nil, ctx, err + return runTxRes, err } // GasMeter expected to be set in AnteHandler gasWanted = ctx.GasMeter().Limit() gasEstimate = ctx.GasEstimate() - priority = ctx.Priority() - pendingTxChecker = ctx.PendingTxChecker() - expireHandler = ctx.ExpireTxHandler() msCache.Write() - anteEvents = events.ToABCIEvents() + runTxRes.anteEvents = events.ToABCIEvents() anteSpan.End() - checkTxCallback = ctx.CheckTxCallback() } // Create a new Context based off of the existing Context with a MultiStore branch @@ -938,30 +933,30 @@ func (app *BaseApp) runTx(ctx sdk.Context, mode runTxMode, tx sdk.Tx, checksum [ // Attempt to execute all messages and only update state if all messages pass // and we're in DeliverTx. Note, RunMsgs will never return a reference to a // Result if any single message fails or does not have a registered Handler. - result, err = app.RunMsgs(runMsgCtx, msgs) + runTxRes.result, err = app.RunMsgs(runMsgCtx, msgs) if err == nil { msCache.Write() } // we do this since we will only be looking at result in DeliverTx - if result != nil && len(anteEvents) > 0 { + if runTxRes.result != nil && len(runTxRes.anteEvents) > 0 { // append the events in the order of occurrence - result.Events = append(anteEvents, result.Events...) + runTxRes.result.Events = append(runTxRes.anteEvents, runTxRes.result.Events...) } // only apply hooks if no error - if err == nil && (!ctx.IsEVM() || result.EvmError == "") { + if err == nil && (!ctx.IsEVM() || runTxRes.result.EvmError == "") { var evmTxInfo *abci.EvmTxInfo if ctx.IsEVM() { evmTxInfo = &abci.EvmTxInfo{ SenderAddress: ctx.EVMSenderAddress(), Nonce: ctx.EVMNonce(), TxHash: ctx.EVMTxHash(), - VmError: result.EvmError, + VmError: runTxRes.result.EvmError, } } var events = []abci.Event{} - if result != nil { - events = sdk.MarkEventsToIndex(result.Events, app.IndexEvents) + if runTxRes.result != nil { + events = sdk.MarkEventsToIndex(runTxRes.result.Events, app.IndexEvents) } for _, hook := range app.deliverTxHooks { hook(ctx, tx, checksum, sdk.DeliverTxHookInput{ @@ -970,7 +965,7 @@ func (app *BaseApp) runTx(ctx sdk.Context, mode runTxMode, tx sdk.Tx, checksum [ }) } } - return gInfo, result, anteEvents, priority, pendingTxChecker, expireHandler, checkTxCallback, ctx, err + return runTxRes, err } // RunMsgs iterates through a list of messages and executes them with the provided diff --git a/sei-cosmos/baseapp/deliver_tx_test.go b/sei-cosmos/baseapp/deliver_tx_test.go index 21e23e1219..8ac7e4a034 100644 --- a/sei-cosmos/baseapp/deliver_tx_test.go +++ b/sei-cosmos/baseapp/deliver_tx_test.go @@ -619,10 +619,10 @@ func TestRunTxDecodeError(t *testing.T) { ctx.GasMeter().ConsumeGas(5000, "simulated prior gas") // A decode failure should not report block-level gas as its own - gInfo, _, _, _, _, _, _, _, err := app.runTx(ctx, runTxModeDeliver, nil, [32]byte{}) + runTxRes, err := app.runTx(ctx, runTxModeDeliver, nil, [32]byte{}) require.Error(t, err) - require.Equal(t, uint64(0), gInfo.GasUsed) - require.Equal(t, uint64(0), gInfo.GasWanted) + require.Equal(t, uint64(0), runTxRes.gasInfo.GasUsed) + require.Equal(t, uint64(0), runTxRes.gasInfo.GasWanted) } // Test that transactions exceeding gas limits fail diff --git a/sei-cosmos/baseapp/test_helpers.go b/sei-cosmos/baseapp/test_helpers.go index d183cdf9dd..97a0d70772 100644 --- a/sei-cosmos/baseapp/test_helpers.go +++ b/sei-cosmos/baseapp/test_helpers.go @@ -17,8 +17,8 @@ func (app *BaseApp) Check(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo, *sdk return sdk.GasInfo{}, nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "%s", err) } ctx := app.checkState.ctx.WithTxBytes(bz).WithConsensusParams(app.GetConsensusParams(app.checkState.ctx)) - gasInfo, result, _, _, _, _, _, _, err := app.runTx(ctx, runTxModeCheck, tx, sha256.Sum256(bz)) //nolint:dogsled // Because life is worth living instead of fixing this, considering sei solo is around the corner. - return gasInfo, result, err + runTxRes, err := app.runTx(ctx, runTxModeCheck, tx, sha256.Sum256(bz)) + return runTxRes.gasInfo, runTxRes.result, err } func (app *BaseApp) Deliver(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo, *sdk.Result, error) { @@ -32,8 +32,8 @@ func (app *BaseApp) Deliver(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo, *s if err != nil { return sdk.GasInfo{}, &sdk.Result{}, err } - gasInfo, result, _, _, _, _, _, _, err := app.runTx(ctx, runTxModeDeliver, decoded, sha256.Sum256(bz)) //nolint:dogsled // Because life is worth living instead of fixing this, considering sei solo is around the corner. - return gasInfo, result, err + runTxRes, err := app.runTx(ctx, runTxModeDeliver, decoded, sha256.Sum256(bz)) + return runTxRes.gasInfo, runTxRes.result, err } // Context with current {check, deliver}State of the app used by tests. From 4e7a82d76b6267a9b191cbceeff29c086241ce30 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Thu, 30 Apr 2026 13:21:13 +0200 Subject: [PATCH 2/7] removed sender --- sei-tendermint/abci/types/types.pb.go | 223 +++++++----------- sei-tendermint/internal/mempool/mempool.go | 14 -- .../internal/mempool/mempool_test.go | 35 +-- .../internal/mempool/priority_queue_test.go | 61 +++-- sei-tendermint/internal/mempool/tx.go | 25 +- sei-tendermint/internal/mempool/tx_test.go | 27 --- .../proto/tendermint/abci/types.proto | 4 +- .../spec/abci++/abci++_methods_002_draft.md | 1 - sei-tendermint/spec/abci/abci.md | 1 - 9 files changed, 120 insertions(+), 271 deletions(-) diff --git a/sei-tendermint/abci/types/types.pb.go b/sei-tendermint/abci/types/types.pb.go index 2599433f9b..39db3f6e7f 100644 --- a/sei-tendermint/abci/types/types.pb.go +++ b/sei-tendermint/abci/types/types.pb.go @@ -298,7 +298,6 @@ type ResponseCheckTx struct { Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` Codespace string `protobuf:"bytes,8,opt,name=codespace,proto3" json:"codespace,omitempty"` - Sender string `protobuf:"bytes,9,opt,name=sender,proto3" json:"sender,omitempty"` Priority int64 `protobuf:"varint,10,opt,name=priority,proto3" json:"priority,omitempty"` GasEstimated int64 `protobuf:"varint,12,opt,name=gas_estimated,json=gasEstimated,proto3" json:"gas_estimated,omitempty"` } @@ -371,13 +370,6 @@ func (m *ResponseCheckTx) GetCodespace() string { return "" } -func (m *ResponseCheckTx) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - func (m *ResponseCheckTx) GetPriority() int64 { if m != nil { return m.Priority @@ -1266,92 +1258,92 @@ func init() { func init() { proto.RegisterFile("tendermint/abci/types.proto", fileDescriptor_252557cfdd89a31a) } var fileDescriptor_252557cfdd89a31a = []byte{ - // 1357 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0x4b, 0x6f, 0x1b, 0xd5, - 0x17, 0xcf, 0xd8, 0x8e, 0xed, 0x39, 0x76, 0x12, 0xf7, 0xf6, 0xe5, 0xa6, 0xa9, 0xe3, 0xff, 0xfc, - 0x2b, 0x11, 0x55, 0xad, 0x23, 0x15, 0x21, 0x01, 0xad, 0x84, 0xe2, 0xd4, 0x34, 0x8f, 0x92, 0x86, - 0xc1, 0x69, 0x01, 0x09, 0x46, 0xd7, 0x33, 0xb7, 0xf6, 0x55, 0x3c, 0x0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 0xed, 0x59, 0x84, 0x5d, 0x52, 0x05, - 0x79, 0xd1, 0x89, 0xc0, 0xfa, 0x16, 0x50, 0x1a, 0x78, 0x93, 0x74, 0x69, 0x20, 0x41, 0x44, 0x3b, - 0x90, 0x27, 0x43, 0x12, 0x70, 0x56, 0x35, 0xea, 0xd9, 0x8d, 0xd2, 0xed, 0x4b, 0x8d, 0x53, 0xc5, - 0xd8, 0x68, 0x89, 0xe3, 0x66, 0xf5, 0xf9, 0xcb, 0xf5, 0x85, 0x37, 0x2f, 0xd7, 0x2b, 0x4a, 0xfb, - 0x66, 0xe8, 0x53, 0x4e, 0xfc, 0x88, 0x8f, 0x6c, 0x6d, 0x6f, 0xfd, 0x61, 0xc0, 0x4a, 0xfa, 0x81, - 0xed, 0x1e, 0x71, 0x8f, 0xdb, 0xc9, 0x5c, 0x6c, 0xd3, 0xca, 0xca, 0x48, 0x30, 0x54, 0x65, 0xcd, - 0xe2, 0x7d, 0x0d, 0x40, 0x64, 0xf3, 0x29, 0x0e, 0x38, 0xf1, 0x34, 0xc0, 0x66, 0x17, 0xb3, 0xc7, - 0x52, 0x70, 0x32, 0xd4, 0xe2, 0xa9, 0x50, 0x05, 0x40, 0x4c, 0x46, 0x21, 0x01, 0x32, 0x6d, 0xcd, - 0xa1, 0x55, 0x28, 0x46, 0x31, 0x0d, 0x63, 0xca, 0x47, 0x12, 0x9f, 0xac, 0x3d, 0xe6, 0xd1, 0xff, - 0x61, 0x49, 0x7c, 0x90, 0x30, 0x4e, 0x7d, 0x2c, 0xbe, 0x59, 0x96, 0x0a, 0xe5, 0x2e, 0x66, 0xad, - 0x54, 0xb6, 0x97, 0x2b, 0xe6, 0x2a, 0x8b, 0x7b, 0xb9, 0x62, 0xbe, 0x52, 0xd8, 0xcb, 0x15, 0x0b, - 0x95, 0xe2, 0x5e, 0xae, 0x58, 0xaa, 0x94, 0xad, 0x9f, 0x33, 0x70, 0x2e, 0x8d, 0xfd, 0x1e, 0xe9, - 0xd3, 0x21,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, 0xaf, 0x56, 0x27, 0x2f, 0xb5, 0xdf, 0xff, - 0x2b, 0x00, 0x00, 0xff, 0xff, 0x61, 0xbf, 0x37, 0x0b, 0x8a, 0x0d, 0x00, 0x00, + // 1356 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0xcb, 0x6f, 0x1b, 0x55, + 0x17, 0xcf, 0xd8, 0x8e, 0x3d, 0x73, 0xe2, 0x24, 0xd3, 0xdb, 0x97, 0x9b, 0xa6, 0x89, 0xbf, 0xf9, + 0x2a, 0x11, 0x55, 0xad, 0x23, 0x15, 0x21, 0x01, 0xad, 0x84, 0xe2, 0xd4, 0x34, 0x8f, 0x92, 0x86, + 0xc1, 0x69, 0x01, 0x09, 0x46, 0xd7, 0xe3, 0x5b, 0xfb, 0x2a, 0x9e, 0x87, 0xe6, 0x5e, 0xbb, 0xe3, + 0xee, 0x59, 0xb1, 0x41, 0xfc, 0x39, 0xec, 0xd8, 0x75, 0xd9, 0x25, 0xab, 0x0a, 0xb5, 0x12, 0x8b, + 0x6e, 0x58, 0xb2, 0x04, 0xdd, 0xc7, 0xd8, 0x4e, 0x6c, 0x28, 0x52, 0xba, 0x61, 0x77, 0xce, 0xb9, + 0xe7, 0x9c, 0xb9, 0xe7, 0x77, 0x5e, 0x77, 0xe0, 0x2a, 0x27, 0x61, 0x9b, 0x24, 0x01, 0x0d, 0xf9, + 0x26, 0x6e, 0xf9, 0x74, 0x93, 0x0f, 0x63, 0xc2, 0x6a, 0x71, 0x12, 0xf1, 0x08, 0x2d, 0x8f, 0x0f, + 0x6b, 0xe2, 0x70, 0xe5, 0x42, 0x27, 0xea, 0x44, 0xf2, 0x6c, 0x53, 0x50, 0x4a, 0x6d, 0x65, 0x75, + 0xc2, 0x87, 0x9f, 0x0c, 0x63, 0x1e, 0x6d, 0x1e, 0x93, 0xa1, 0x76, 0xb2, 0x72, 0x6d, 0xfa, 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68, 0xd1, 0xf0, 0x49, 0x24, 0xef, 0x6c, 0xb9, 0x92, 0x46, + 0x17, 0x60, 0x9e, 0x86, 0x6d, 0x92, 0xca, 0xab, 0xe5, 0x5d, 0xc5, 0x08, 0xdb, 0x63, 0x32, 0x94, + 0x17, 0x28, 0xbb, 0x82, 0x14, 0x7a, 0x03, 0xdc, 0xeb, 0x93, 0x4a, 0x49, 0xca, 0x14, 0x83, 0x3e, + 0x04, 0x4b, 0x26, 0xc8, 0x8b, 0x62, 0x56, 0x31, 0xab, 0xc6, 0xc6, 0xc2, 0xed, 0xab, 0xb5, 0x89, + 0x4a, 0x50, 0x49, 0xac, 0x1d, 0x0a, 0x9d, 0x87, 0x31, 0x73, 0xcd, 0x58, 0x53, 0xe8, 0x12, 0x14, + 0x35, 0x82, 0x96, 0xfc, 0xb0, 0xe6, 0xd0, 0x2a, 0x58, 0xe2, 0xf6, 0x2c, 0xc6, 0x3e, 0xa9, 0x80, + 0xbc, 0xe8, 0x58, 0xe0, 0x7c, 0x0b, 0x28, 0x0b, 0xbc, 0x4e, 0x3a, 0x34, 0x94, 0x20, 0xa2, 0x1d, + 0x28, 0x92, 0x01, 0x09, 0x39, 0xab, 0x18, 0xd5, 0xfc, 0xc6, 0xc2, 0xed, 0x4b, 0xb5, 0x53, 0xc5, + 0x58, 0x6b, 0x88, 0xe3, 0x7a, 0xe5, 0xf9, 0xcb, 0xf5, 0xb9, 0x37, 0x2f, 0xd7, 0x6d, 0xa5, 0x7d, + 0x33, 0x0a, 0x28, 0x27, 0x41, 0xcc, 0x87, 0xae, 0xb6, 0x77, 0x7e, 0x37, 0x60, 0x39, 0xfb, 0xc0, + 0x76, 0x97, 0xf8, 0xc7, 0xcd, 0x74, 0x26, 0xb6, 0x59, 0x65, 0xe5, 0x24, 0x18, 0xaa, 0xb2, 0xa6, + 0xf1, 0xbe, 0x06, 0x20, 0xb2, 0xf9, 0x14, 0x87, 0x9c, 0xb4, 0x35, 0xc0, 0x56, 0x07, 0xb3, 0xc7, + 0x52, 0x70, 0x32, 0x54, 0xf3, 0x54, 0xa8, 0x68, 0x05, 0xcc, 0x38, 0xa1, 0x51, 0x42, 0xf9, 0x50, + 0xe2, 0x90, 0x77, 0x47, 0x3c, 0xfa, 0x3f, 0x2c, 0x0a, 0xc7, 0x84, 0x71, 0x1a, 0x60, 0xe1, 0xbb, + 0x2c, 0x15, 0xca, 0x1d, 0xcc, 0x1a, 0x99, 0x6c, 0xaf, 0x60, 0x16, 0xec, 0xf9, 0xbd, 0x82, 0x59, + 0xb4, 0x4b, 0x7b, 0x05, 0xb3, 0x64, 0x9b, 0x7b, 0x05, 0xd3, 0xb2, 0x61, 0xaf, 0x60, 0x2e, 0xd8, + 0x65, 0xb7, 0xc8, 0x24, 0x44, 0xce, 0xcf, 0x39, 0x38, 0x97, 0x45, 0x7c, 0x8f, 0xf4, 0xe8, 0x80, + 0x24, 0x67, 0x8a, 0x79, 0x56, 0x8d, 0xad, 0xcd, 0xc0, 0x61, 0x42, 0x22, 0x42, 0x15, 0x5c, 0x9f, + 0x91, 0xb6, 0x2c, 0xb9, 0xbc, 0x3b, 0xe2, 0x27, 0x72, 0x5b, 0x3a, 0x5b, 0x6e, 0xdf, 0x02, 0xf7, + 0xc7, 0xb0, 0x40, 0x06, 0x81, 0xc7, 0x53, 0x4f, 0x5e, 0xdf, 0x92, 0xb5, 0xbc, 0x32, 0xe3, 0x63, + 0x41, 0x33, 0x15, 0xc3, 0xc5, 0xb5, 0x48, 0x46, 0x3a, 0xdf, 0xe7, 0xc0, 0xce, 0x30, 0x6c, 0x84, + 0x6d, 0x55, 0x94, 0x5f, 0xc0, 0xb9, 0x01, 0xee, 0xd1, 0x36, 0xe6, 0x51, 0xe2, 0xf5, 0xe3, 0x36, + 0xe6, 0x24, 0xab, 0xcf, 0xea, 0x94, 0xdb, 0x47, 0x99, 0xe6, 0x91, 0x54, 0xac, 0x17, 0x44, 0x34, + 0xae, 0x3d, 0x38, 0x29, 0x66, 0xe8, 0x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xd8, 0x6c, 0xd8, 0x06, 0xba, 0x0c, 0xe7, 0x1f, 0xec, + 0xde, 0xdf, 0x69, 0x7a, 0xdb, 0x0f, 0x76, 0x1b, 0x07, 0x4d, 0x6f, 0xab, 0xd9, 0xdc, 0xda, 0xde, + 0xb7, 0x73, 0xf5, 0xa3, 0xe7, 0xaf, 0xd6, 0x8c, 0x17, 0xaf, 0xd6, 0x8c, 0x5f, 0x5f, 0xad, 0x19, + 0x3f, 0xbc, 0x5e, 0x9b, 0x7b, 0xf1, 0x7a, 0x6d, 0xee, 0x97, 0xd7, 0x6b, 0x73, 0x5f, 0xdf, 0xe9, + 0x50, 0xde, 0xed, 0xb7, 0x6a, 0x7e, 0x14, 0x6c, 0x32, 0x42, 0x6f, 0xc9, 0x1f, 0x16, 0x3f, 0xea, + 0x49, 0xc6, 0xef, 0x62, 0x1a, 0x4a, 0x6a, 0xe6, 0x0f, 0x56, 0xab, 0x28, 0xb5, 0xdf, 0xff, 0x2b, + 0x00, 0x00, 0xff, 0xff, 0xd5, 0xe2, 0x1c, 0x51, 0x80, 0x0d, 0x00, 0x00, } func (m *ResponseInfo) Marshal() (dAtA []byte, err error) { @@ -1567,13 +1559,6 @@ func (m *ResponseCheckTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x50 } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0x4a - } if len(m.Codespace) > 0 { i -= len(m.Codespace) copy(dAtA[i:], m.Codespace) @@ -2432,10 +2417,6 @@ func (m *ResponseCheckTx) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } if m.Priority != 0 { n += 1 + sovTypes(uint64(m.Priority)) } @@ -3529,38 +3510,6 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { } m.Codespace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 10: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) diff --git a/sei-tendermint/internal/mempool/mempool.go b/sei-tendermint/internal/mempool/mempool.go index 63ab63e210..2cc1f719e2 100644 --- a/sei-tendermint/internal/mempool/mempool.go +++ b/sei-tendermint/internal/mempool/mempool.go @@ -850,21 +850,8 @@ func (txmp *TxMempool) addNewTransaction(wtx *WrappedTx, res *abci.ResponseCheck return err } - sender := res.Sender priority := res.Priority - if len(sender) > 0 { - if wtx := txmp.txStore.GetTxBySender(sender); wtx != nil { - logger.Error( - "rejected incoming good transaction; tx already exists for sender", - "tx", wtx.Hash(), - "sender", sender, - ) - txmp.metrics.RejectedTxs.Add(1) - return nil - } - } - if err := txmp.canAddTx(wtx); err != nil { evictTxs := txmp.priorityIndex.GetEvictableTxs( priority, @@ -906,7 +893,6 @@ func (txmp *TxMempool) addNewTransaction(wtx *WrappedTx, res *abci.ResponseCheck wtx.gasWanted = res.GasWanted wtx.estimatedGas = res.GasEstimated wtx.priority = priority - wtx.sender = sender wtx.peers = map[uint16]struct{}{ txInfo.SenderID: {}, } diff --git a/sei-tendermint/internal/mempool/mempool_test.go b/sei-tendermint/internal/mempool/mempool_test.go index c1e8453dff..ce9f6fb5e1 100644 --- a/sei-tendermint/internal/mempool/mempool_test.go +++ b/sei-tendermint/internal/mempool/mempool_test.go @@ -41,10 +41,7 @@ var DefaultGasWanted = int64(1) func (app *application) CheckTx(_ context.Context, req *abci.RequestCheckTxV2) (*abci.ResponseCheckTxV2, error) { - var ( - priority int64 - sender string - ) + var priority int64 gasWanted := DefaultGasWanted if app.gasWanted != nil { @@ -143,7 +140,6 @@ func (app *application) CheckTx(_ context.Context, req *abci.RequestCheckTxV2) ( } priority = v - sender = string(parts[0]) } else { return &abci.ResponseCheckTxV2{ResponseCheckTx: &abci.ResponseCheckTx{ Priority: priority, @@ -154,7 +150,6 @@ func (app *application) CheckTx(_ context.Context, req *abci.RequestCheckTxV2) ( } return &abci.ResponseCheckTxV2{ResponseCheckTx: &abci.ResponseCheckTx{ Priority: priority, - Sender: sender, Code: code.CodeTypeOK, GasWanted: gasWanted, GasEstimated: gasEstimated, @@ -835,34 +830,6 @@ func TestTxMempool_CheckTxSamePeer(t *testing.T) { require.Error(t, err) } -func TestTxMempool_CheckTxSameSender(t *testing.T) { - ctx := t.Context() - - client := &application{Application: kvstore.NewApplication()} - - txmp := setup(t, client, 100, NopTxConstraintsFetcher) - peerID := uint16(1) - rng := rand.New(rand.NewSource(time.Now().UnixNano())) - - prefix1 := make([]byte, 20) - _, err := rng.Read(prefix1) - require.NoError(t, err) - - prefix2 := make([]byte, 20) - _, err = rng.Read(prefix2) - require.NoError(t, err) - - tx1 := []byte(fmt.Sprintf("sender-0=%X=%d", prefix1, 50)) - tx2 := []byte(fmt.Sprintf("sender-0=%X=%d", prefix2, 50)) - - _, err = txmp.CheckTx(ctx, tx1, TxInfo{SenderID: peerID}) - require.NoError(t, err) - require.Equal(t, 1, txmp.Size()) - _, err = txmp.CheckTx(ctx, tx2, TxInfo{SenderID: peerID}) - require.NoError(t, err) - require.Equal(t, 1, txmp.Size()) -} - func TestTxMempool_ConcurrentTxs(t *testing.T) { ctx := t.Context() diff --git a/sei-tendermint/internal/mempool/priority_queue_test.go b/sei-tendermint/internal/mempool/priority_queue_test.go index aea1f41080..3533c1aced 100644 --- a/sei-tendermint/internal/mempool/priority_queue_test.go +++ b/sei-tendermint/internal/mempool/priority_queue_test.go @@ -50,7 +50,7 @@ func TestTxPriorityQueue_ReapHalf(t *testing.T) { func TestAvoidPanicIfTransactionIsNil(t *testing.T) { pq := NewTxPriorityQueue() - pq.Push(&WrappedTx{sender: "1", isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 10}) + pq.Push(&WrappedTx{isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 10}) pq.txs = append(pq.txs, nil) var count int @@ -67,70 +67,70 @@ func TestTxPriorityQueue_PriorityAndNonceOrdering(t *testing.T) { { name: "PriorityWithEVMAndNonEVMDuplicateNonce", inputTxs: []*WrappedTx{ - {sender: "1", isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 10}, - {sender: "3", isEVM: true, evmAddress: "0xabc", evmNonce: 3, priority: 9}, - {sender: "2", isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 7}, + {hashedTx: newHashedTx(types.Tx("1")), isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 10}, + {hashedTx: newHashedTx(types.Tx("3")), isEVM: true, evmAddress: "0xabc", evmNonce: 3, priority: 9}, + {hashedTx: newHashedTx(types.Tx("2")), isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 7}, }, expectedOutput: []int64{1, 3}, }, { name: "PriorityWithEVMAndNonEVMDuplicateNonce", inputTxs: []*WrappedTx{ - {sender: "1", isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 10}, - {sender: "2", isEVM: false, priority: 9}, - {sender: "4", isEVM: true, evmAddress: "0xabc", evmNonce: 0, priority: 9}, // Same EVM address as first, lower nonce - {sender: "5", isEVM: true, evmAddress: "0xdef", evmNonce: 1, priority: 7}, - {sender: "3", isEVM: true, evmAddress: "0xdef", evmNonce: 0, priority: 8}, - {sender: "6", isEVM: false, priority: 6}, - {sender: "7", isEVM: true, evmAddress: "0xghi", evmNonce: 2, priority: 5}, + {hashedTx: newHashedTx(types.Tx("1")), isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 10}, + {hashedTx: newHashedTx(types.Tx("2")), isEVM: false, priority: 9}, + {hashedTx: newHashedTx(types.Tx("4")), isEVM: true, evmAddress: "0xabc", evmNonce: 0, priority: 9}, // Same EVM address as first, lower nonce + {hashedTx: newHashedTx(types.Tx("5")), isEVM: true, evmAddress: "0xdef", evmNonce: 1, priority: 7}, + {hashedTx: newHashedTx(types.Tx("3")), isEVM: true, evmAddress: "0xdef", evmNonce: 0, priority: 8}, + {hashedTx: newHashedTx(types.Tx("6")), isEVM: false, priority: 6}, + {hashedTx: newHashedTx(types.Tx("7")), isEVM: true, evmAddress: "0xghi", evmNonce: 2, priority: 5}, }, expectedOutput: []int64{2, 4, 1, 3, 5, 6, 7}, }, { name: "PriorityWithEVMAndNonEVM", inputTxs: []*WrappedTx{ - {sender: "1", isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 10}, - {sender: "2", isEVM: false, priority: 9}, - {sender: "4", isEVM: true, evmAddress: "0xabc", evmNonce: 0, priority: 9}, // Same EVM address as first, lower nonce - {sender: "5", isEVM: true, evmAddress: "0xdef", evmNonce: 1, priority: 7}, - {sender: "3", isEVM: true, evmAddress: "0xdef", evmNonce: 0, priority: 8}, - {sender: "6", isEVM: false, priority: 6}, - {sender: "7", isEVM: true, evmAddress: "0xghi", evmNonce: 2, priority: 5}, + {hashedTx: newHashedTx(types.Tx("1")), isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 10}, + {hashedTx: newHashedTx(types.Tx("2")), isEVM: false, priority: 9}, + {hashedTx: newHashedTx(types.Tx("4")), isEVM: true, evmAddress: "0xabc", evmNonce: 0, priority: 9}, // Same EVM address as first, lower nonce + {hashedTx: newHashedTx(types.Tx("5")), isEVM: true, evmAddress: "0xdef", evmNonce: 1, priority: 7}, + {hashedTx: newHashedTx(types.Tx("3")), isEVM: true, evmAddress: "0xdef", evmNonce: 0, priority: 8}, + {hashedTx: newHashedTx(types.Tx("6")), isEVM: false, priority: 6}, + {hashedTx: newHashedTx(types.Tx("7")), isEVM: true, evmAddress: "0xghi", evmNonce: 2, priority: 5}, }, expectedOutput: []int64{2, 4, 1, 3, 5, 6, 7}, }, { name: "IdenticalPrioritiesAndNoncesDifferentAddresses", inputTxs: []*WrappedTx{ - {sender: "1", isEVM: true, evmAddress: "0xabc", evmNonce: 2, priority: 5}, - {sender: "2", isEVM: true, evmAddress: "0xdef", evmNonce: 2, priority: 5}, - {sender: "3", isEVM: true, evmAddress: "0xghi", evmNonce: 2, priority: 5}, + {hashedTx: newHashedTx(types.Tx("1")), isEVM: true, evmAddress: "0xabc", evmNonce: 2, priority: 5}, + {hashedTx: newHashedTx(types.Tx("2")), isEVM: true, evmAddress: "0xdef", evmNonce: 2, priority: 5}, + {hashedTx: newHashedTx(types.Tx("3")), isEVM: true, evmAddress: "0xghi", evmNonce: 2, priority: 5}, }, expectedOutput: []int64{1, 2, 3}, }, { name: "InterleavedEVAndNonEVMTransactions", inputTxs: []*WrappedTx{ - {sender: "7", isEVM: false, priority: 15}, - {sender: "8", isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 20}, - {sender: "9", isEVM: false, priority: 10}, - {sender: "10", isEVM: true, evmAddress: "0xdef", evmNonce: 2, priority: 20}, + {hashedTx: newHashedTx(types.Tx("7")), isEVM: false, priority: 15}, + {hashedTx: newHashedTx(types.Tx("8")), isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 20}, + {hashedTx: newHashedTx(types.Tx("9")), isEVM: false, priority: 10}, + {hashedTx: newHashedTx(types.Tx("10")), isEVM: true, evmAddress: "0xdef", evmNonce: 2, priority: 20}, }, expectedOutput: []int64{8, 10, 7, 9}, }, { name: "SameAddressPriorityDifferentNonces", inputTxs: []*WrappedTx{ - {sender: "11", isEVM: true, evmAddress: "0xabc", evmNonce: 3, priority: 10}, - {sender: "12", isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 10}, - {sender: "13", isEVM: true, evmAddress: "0xabc", evmNonce: 2, priority: 10}, + {hashedTx: newHashedTx(types.Tx("11")), isEVM: true, evmAddress: "0xabc", evmNonce: 3, priority: 10}, + {hashedTx: newHashedTx(types.Tx("12")), isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 10}, + {hashedTx: newHashedTx(types.Tx("13")), isEVM: true, evmAddress: "0xabc", evmNonce: 2, priority: 10}, }, expectedOutput: []int64{12, 13, 11}, }, { name: "OneItem", inputTxs: []*WrappedTx{ - {sender: "14", isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 10}, + {hashedTx: newHashedTx(types.Tx("14")), isEVM: true, evmAddress: "0xabc", evmNonce: 1, priority: 10}, }, expectedOutput: []int64{14}, }, @@ -144,7 +144,6 @@ func TestTxPriorityQueue_PriorityAndNonceOrdering(t *testing.T) { // Add input transactions to the queue and set timestamp to order inserted for i, tx := range tc.inputTxs { tx.timestamp = now.Add(time.Duration(i) * time.Second) - tx.hashedTx = newHashedTx(types.Tx(fmt.Sprintf("%d", time.Now().UnixNano()))) pq.PushTx(tx) } @@ -153,7 +152,7 @@ func TestTxPriorityQueue_PriorityAndNonceOrdering(t *testing.T) { require.Len(t, results, len(tc.expectedOutput)) for i, expectedTxID := range tc.expectedOutput { tx := results[i] - require.Equal(t, fmt.Sprintf("%d", expectedTxID), tx.sender) + require.Equal(t, fmt.Sprintf("%d", expectedTxID), string(tx.Tx())) } }) } diff --git a/sei-tendermint/internal/mempool/tx.go b/sei-tendermint/internal/mempool/tx.go index e2c2f8798e..6c18a2a172 100644 --- a/sei-tendermint/internal/mempool/tx.go +++ b/sei-tendermint/internal/mempool/tx.go @@ -56,10 +56,6 @@ type WrappedTx struct { // in the ResponseCheckTx response. priority int64 - // sender defines the transaction's sender as specified by the application in - // the ResponseCheckTx response. - sender string - // timestamp is the time at which the node first received the transaction from // a peer. It is used as a second dimension is prioritizing transactions when // two transactions have the same priority. @@ -97,7 +93,6 @@ func (wtx *WrappedTx) IsBefore(tx *WrappedTx) bool { type txStoreInner struct { byHash map[types.TxHash]*WrappedTx // primary index - bySender map[string]*WrappedTx // sender is defined by the ABCI application sizeBytes utils.AtomicSend[int64] } @@ -114,7 +109,6 @@ type TxStore struct { func NewTxStore() *TxStore { inner := &txStoreInner{ - bySender: make(map[string]*WrappedTx), byHash: make(map[types.TxHash]*WrappedTx), sizeBytes: utils.NewAtomicSend[int64](0), } @@ -157,15 +151,6 @@ func (txs *TxStore) GetAllTxs() []*WrappedTx { panic("unreachable") } -// GetTxBySender returns a *WrappedTx by the transaction's sender property -// defined by the ABCI application. -func (txs *TxStore) GetTxBySender(sender string) *WrappedTx { - for inner := range txs.inner.RLock() { - return inner.bySender[sender] - } - panic("unreachable") -} - // GetTxByHash returns a *WrappedTx by the transaction's hash. func (txs *TxStore) GetTxByHash(key types.TxHash) *WrappedTx { for inner := range txs.inner.RLock() { @@ -192,15 +177,10 @@ func (txs *TxStore) IsTxRemoved(wtx *WrappedTx) bool { return false } -// SetTx stores a *WrappedTx by it's hash. If the transaction also contains a -// non-empty sender, we additionally store the transaction by the sender as -// defined by the ABCI application. +// SetTx stores a *WrappedTx by its hash. func (txs *TxStore) SetTx(wtx *WrappedTx) { for inner := range txs.inner.Lock() { existing := inner.byHash[wtx.Hash()] - if len(wtx.sender) > 0 { - inner.bySender[wtx.sender] = wtx - } inner.byHash[wtx.Hash()] = wtx if existing == nil { inner.sizeBytes.Store(inner.sizeBytes.Load() + int64(wtx.Size())) @@ -212,9 +192,6 @@ func (txs *TxStore) SetTx(wtx *WrappedTx) { // indexes of the transaction. func (txs *TxStore) RemoveTx(wtx *WrappedTx) { for inner := range txs.inner.Lock() { - if len(wtx.sender) > 0 { - delete(inner.bySender, wtx.sender) - } if _, ok := inner.byHash[wtx.Hash()]; ok { delete(inner.byHash, wtx.Hash()) inner.sizeBytes.Store(inner.sizeBytes.Load() - int64(wtx.Size())) diff --git a/sei-tendermint/internal/mempool/tx_test.go b/sei-tendermint/internal/mempool/tx_test.go index b3fb181edd..5f0689ca5a 100644 --- a/sei-tendermint/internal/mempool/tx_test.go +++ b/sei-tendermint/internal/mempool/tx_test.go @@ -12,30 +12,10 @@ import ( "github.com/sei-protocol/sei-chain/sei-tendermint/types" ) -func TestTxStore_GetTxBySender(t *testing.T) { - txs := NewTxStore() - wtx := &WrappedTx{ - hashedTx: newHashedTx(types.Tx("test_tx")), - sender: "foo", - priority: 1, - timestamp: time.Now(), - } - - res := txs.GetTxBySender(wtx.sender) - require.Nil(t, res) - - txs.SetTx(wtx) - - res = txs.GetTxBySender(wtx.sender) - require.NotNil(t, res) - require.Equal(t, wtx, res) -} - func TestTxStore_GetTxByHash(t *testing.T) { txs := NewTxStore() wtx := &WrappedTx{ hashedTx: newHashedTx(types.Tx("test_tx")), - sender: "foo", priority: 1, timestamp: time.Now(), } @@ -65,13 +45,6 @@ func TestTxStore_SetTx(t *testing.T) { res := txs.GetTxByHash(key) require.NotNil(t, res) require.Equal(t, wtx, res) - - wtx.sender = "foo" - txs.SetTx(wtx) - - res = txs.GetTxByHash(key) - require.NotNil(t, res) - require.Equal(t, wtx, res) } func TestTxStore_IsTxRemoved(t *testing.T) { diff --git a/sei-tendermint/proto/tendermint/abci/types.proto b/sei-tendermint/proto/tendermint/abci/types.proto index b700f24aa2..40dd15dce1 100644 --- a/sei-tendermint/proto/tendermint/abci/types.proto +++ b/sei-tendermint/proto/tendermint/abci/types.proto @@ -50,11 +50,11 @@ message ResponseCheckTx { string log = 3; // nondeterministic int64 gas_wanted = 5; string codespace = 8; - string sender = 9; int64 priority = 10; int64 gas_estimated = 12; - reserved 4, 6, 7, 11; // see https://github.com/tendermint/tendermint/issues/8543 + reserved 4, 6, 7, 9, 11; // see https://github.com/tendermint/tendermint/issues/8543 + reserved "sender"; } message ResponseDeliverTx { diff --git a/sei-tendermint/spec/abci++/abci++_methods_002_draft.md b/sei-tendermint/spec/abci++/abci++_methods_002_draft.md index 4eb1bb295e..f40bca2333 100644 --- a/sei-tendermint/spec/abci++/abci++_methods_002_draft.md +++ b/sei-tendermint/spec/abci++/abci++_methods_002_draft.md @@ -138,7 +138,6 @@ title: Methods | data | bytes | Result bytes, if any. | 2 | | gas_wanted | int64 | Amount of gas requested for transaction. | 5 | | codespace | string | Namespace for the `code`. | 8 | - | sender | string | The transaction's sender (e.g. the signer) | 9 | | priority | int64 | The transaction's priority (for mempool ordering) | 10 | * **Usage**: diff --git a/sei-tendermint/spec/abci/abci.md b/sei-tendermint/spec/abci/abci.md index 5d9d59b711..49460148c2 100644 --- a/sei-tendermint/spec/abci/abci.md +++ b/sei-tendermint/spec/abci/abci.md @@ -405,7 +405,6 @@ the blockchain's `AppHash` which is verified via [light client verification](../ | gas_used | int64 | Amount of gas consumed by transaction. | 6 | | events | repeated [Event](#events) | Type & Key-Value events for indexing transactions (eg. by account). | 7 | | codespace | string | Namespace for the `code`. | 8 | - | sender | string | The transaction's sender (e.g. the signer) | 9 | | priority | int64 | The transaction's priority (for mempool ordering) | 10 | * **Usage**: From ed35c517a8c8a1f0681f8eead7263a0549c01bc9 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Thu, 30 Apr 2026 14:07:03 +0200 Subject: [PATCH 3/7] out-of-process configs deprecated --- docker/localnode/config/config.toml | 7 ------- docker/rpcnode/config/config.toml | 7 ------- docs/migration/seiv2_config_migration.md | 7 ------- sei-cosmos/server/README.md | 4 ++-- sei-cosmos/server/start.go | 17 +++++++++++------ .../cmd/tendermint/commands/run_node.go | 15 +++++++++------ sei-tendermint/config/config.go | 7 ++++--- sei-tendermint/config/toml.go | 7 ------- sei-tendermint/config/toml_test.go | 1 - sei-tendermint/test/e2e/README.md | 18 ------------------ 10 files changed, 26 insertions(+), 64 deletions(-) diff --git a/docker/localnode/config/config.toml b/docker/localnode/config/config.toml index 43fd4af3b0..2caf572247 100644 --- a/docker/localnode/config/config.toml +++ b/docker/localnode/config/config.toml @@ -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" @@ -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 ### ####################################################### diff --git a/docker/rpcnode/config/config.toml b/docker/rpcnode/config/config.toml index 6f2acc7f24..a280b91989 100644 --- a/docker/rpcnode/config/config.toml +++ b/docker/rpcnode/config/config.toml @@ -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" @@ -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 ### ####################################################### diff --git a/docs/migration/seiv2_config_migration.md b/docs/migration/seiv2_config_migration.md index da8e3a936d..5dde0f69db 100644 --- a/docs/migration/seiv2_config_migration.md +++ b/docs/migration/seiv2_config_migration.md @@ -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" @@ -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 ### ####################################################### diff --git a/sei-cosmos/server/README.md b/sei-cosmos/server/README.md index 31926f69c1..dcb8632271 100644 --- a/sei-cosmos/server/README.md +++ b/sei-cosmos/server/README.md @@ -63,8 +63,8 @@ literal that exists in the `server.Context`. All the possible options an applica may use and provide to the construction process are defined by the `StartCmd` and by the application's config file, `app.toml`. -The application can either be started in-process or as an external process. The -former creates a Tendermint service and the latter creates a Tendermint Node. +The application is started in-process with Tendermint. External ABCI process +support via socket or gRPC has been removed. Under the hood, `StartCmd` will call `GetServerContextFromCmd`, which provides the command access to a `server.Context`. This context provides access to the diff --git a/sei-cosmos/server/start.go b/sei-cosmos/server/start.go index 417fa51085..bbee42f884 100644 --- a/sei-cosmos/server/start.go +++ b/sei-cosmos/server/start.go @@ -86,14 +86,12 @@ const ( FlagChainID = "chain-id" ) -// StartCmd runs the service passed in, either stand-alone or in-process with -// Tendermint. +// StartCmd runs the service passed in with Tendermint in-process. func StartCmd(appCreator types.AppCreator, defaultNodeHome string, tracerProviderOptions []trace.TracerProviderOption) *cobra.Command { cmd := &cobra.Command{ Use: "start", Short: "Run the full node", - Long: `Run the full node application with Tendermint in or out of process. By -default, the application will run with Tendermint in process. + Long: `Run the full node application with Tendermint in process. Pruning options can be provided via the '--pruning' flag or alternatively with '--pruning-keep-recent', 'pruning-keep-every', and 'pruning-interval' together. For '--pruning' the options are as follows: @@ -211,8 +209,6 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. func addStartNodeFlags(cmd *cobra.Command, defaultNodeHome string) { cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") - cmd.Flags().String(flagAddress, "tcp://0.0.0.0:26658", "Listen address") - cmd.Flags().String(flagTransport, "socket", "Transport protocol: socket, grpc") cmd.Flags().String(flagTraceStore, "", "Enable KVStore tracing to an output file") cmd.Flags().String(FlagMinGasPrices, "", "Minimum gas prices to accept for transactions; Any fee in a tx must meet this minimum (e.g. 0.01photino;0.0001stake)") cmd.Flags().IntSlice(FlagUnsafeSkipUpgrades, []int{}, "Skip a set of upgrade heights to continue the old binary") @@ -250,6 +246,15 @@ func addStartNodeFlags(cmd *cobra.Command, defaultNodeHome string) { // add support for all Tendermint-specific command line options tcmd.AddNodeFlags(cmd, NewDefaultContext().Config) + mustMarkDeprecated(cmd, flagAddress, "out-of-process ABCI has been removed; this flag is ignored") + mustMarkDeprecated(cmd, flagTransport, "out-of-process ABCI has been removed; this flag is ignored") +} + +func mustMarkDeprecated(cmd *cobra.Command, name, message string) { + cmd.Flags().String(name, "", "") + if err := cmd.Flags().MarkDeprecated(name, message); err != nil { + panic(err) + } } func startInProcess( diff --git a/sei-tendermint/cmd/tendermint/commands/run_node.go b/sei-tendermint/cmd/tendermint/commands/run_node.go index 99562f79cd..d8eeeb14ec 100644 --- a/sei-tendermint/cmd/tendermint/commands/run_node.go +++ b/sei-tendermint/cmd/tendermint/commands/run_node.go @@ -37,12 +37,8 @@ func AddNodeFlags(cmd *cobra.Command, conf *cfg.Config) { "consensus votes before joining consensus") // abci flags - cmd.Flags().String( - "proxy-app", - conf.ProxyApp, - "proxy app address, or one of: 'kvstore',"+ - " 'persistent_kvstore', 'e2e' or 'noop' for local testing.") - cmd.Flags().String("abci", conf.ABCI, "specify abci transport (socket | grpc)") + mustMarkDeprecated(cmd, "proxy-app", "out-of-process ABCI has been removed; this flag is ignored") + mustMarkDeprecated(cmd, "abci", "out-of-process ABCI has been removed; this flag is ignored") // rpc flags cmd.Flags().String("rpc.laddr", conf.RPC.ListenAddress, "RPC listen address. Port required") @@ -78,6 +74,13 @@ func AddNodeFlags(cmd *cobra.Command, conf *cfg.Config) { addDBFlags(cmd, conf) } +func mustMarkDeprecated(cmd *cobra.Command, name, message string) { + cmd.Flags().String(name, "", "") + if err := cmd.Flags().MarkDeprecated(name, message); err != nil { + panic(err) + } +} + func addDBFlags(cmd *cobra.Command, conf *cfg.Config) { cmd.Flags().String( "db-backend", diff --git a/sei-tendermint/config/config.go b/sei-tendermint/config/config.go index c946e7abed..99b3b72667 100644 --- a/sei-tendermint/config/config.go +++ b/sei-tendermint/config/config.go @@ -173,8 +173,8 @@ type BaseConfig struct { // This should be set in viper so it can unmarshal into this struct RootDir string `mapstructure:"home"` - // TCP or UNIX socket address of the ABCI application, - // or the name of an ABCI application compiled in with the Tendermint binary + // Deprecated: out-of-process ABCI has been removed and this option no longer + // has any effect. ProxyApp string `mapstructure:"proxy-app"` // A custom human readable name for this node @@ -228,7 +228,8 @@ type BaseConfig struct { // A JSON file containing the private key to use for p2p authenticated encryption NodeKey string `mapstructure:"node-key-file"` - // Mechanism to connect to the ABCI application: socket | grpc + // Deprecated: out-of-process ABCI has been removed and this option no longer + // has any effect. ABCI string `mapstructure:"abci"` // Deprecated: peer filtering via ABCI has been removed and this option no longer has any effect. diff --git a/sei-tendermint/config/toml.go b/sei-tendermint/config/toml.go index 63998e32bb..9ed79f8882 100644 --- a/sei-tendermint/config/toml.go +++ b/sei-tendermint/config/toml.go @@ -88,10 +88,6 @@ const manualConfigTemplate = `# This is a TOML config file. ### 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 = "{{ .BaseConfig.ProxyApp }}" - # A custom human readable name for this node moniker = "{{ .BaseConfig.Moniker }}" @@ -145,9 +141,6 @@ genesis-file = "{{ js .BaseConfig.Genesis }}" # Path to the JSON file containing the private key to use for node authentication in the p2p protocol node-key-file = "{{ js .BaseConfig.NodeKey }}" -# Mechanism to connect to the ABCI application: socket | grpc -abci = "{{ .BaseConfig.ABCI }}" - ####################################################################### ### Advanced Configuration Options ### ####################################################################### diff --git a/sei-tendermint/config/toml_test.go b/sei-tendermint/config/toml_test.go index cf27c4484a..33f34b754c 100644 --- a/sei-tendermint/config/toml_test.go +++ b/sei-tendermint/config/toml_test.go @@ -63,7 +63,6 @@ func checkConfig(t *testing.T, configFile string) { var elems = []string{ "moniker", "seeds", - "proxy-app", "create-empty-blocks", "peer", "timeout", diff --git a/sei-tendermint/test/e2e/README.md b/sei-tendermint/test/e2e/README.md index 70510b6faa..1797ad5c33 100644 --- a/sei-tendermint/test/e2e/README.md +++ b/sei-tendermint/test/e2e/README.md @@ -162,22 +162,4 @@ tendermint init validator TMHOME=$HOME/.tendermint ./build/node ./node/built-in.toml ``` -To make things simpler the e2e application can also be run in the tendermint binary -by running - -```bash -tendermint start --proxy-app e2e -``` - -However this won't offer the same level of configurability of the application. - -**Socket** - -```bash -make node -tendermint init validator -tendermint start -./build/node ./node.socket.toml -``` - Check `node/config.go` to see how the settings of the test application can be tweaked. From 3086a7199a6e594af2f71737a4a51aa55027f7ec Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Fri, 1 May 2026 10:48:29 +0200 Subject: [PATCH 4/7] generic client context --- app/app.go | 12 ++- sei-cosmos/client/broadcast.go | 10 +-- sei-cosmos/client/broadcast_test.go | 6 +- sei-cosmos/client/cmd.go | 5 +- sei-cosmos/client/config/config.go | 6 +- sei-cosmos/client/context.go | 89 +++++++++++++---------- sei-cosmos/client/grpc_query.go | 6 +- sei-cosmos/client/query.go | 29 ++++---- sei-cosmos/server/start.go | 3 +- sei-cosmos/testutil/network/util.go | 4 +- sei-cosmos/x/auth/tx/service.go | 2 +- sei-cosmos/x/genutil/client/rest/query.go | 7 +- 12 files changed, 102 insertions(+), 77 deletions(-) diff --git a/app/app.go b/app/app.go index 247d008a4f..d03b0e7437 100644 --- a/app/app.go +++ b/app/app.go @@ -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) } @@ -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) } diff --git a/sei-cosmos/client/broadcast.go b/sei-cosmos/client/broadcast.go index 4db88cf038..199e9b94e6 100644 --- a/sei-cosmos/client/broadcast.go +++ b/sei-cosmos/client/broadcast.go @@ -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) @@ -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 @@ -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 @@ -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 @@ -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") } diff --git a/sei-cosmos/client/broadcast_test.go b/sei-cosmos/client/broadcast_test.go index ec04fcc0e1..bdcb55cc58 100644 --- a/sei-cosmos/client/broadcast_test.go +++ b/sei-cosmos/client/broadcast_test.go @@ -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 { @@ -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}, } } diff --git a/sei-cosmos/client/cmd.go b/sei-cosmos/client/cmd.go index 526cd26f2d..7478263ce7 100644 --- a/sei-cosmos/client/cmd.go +++ b/sei-cosmos/client/cmd.go @@ -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" @@ -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) @@ -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) } } diff --git a/sei-cosmos/client/config/config.go b/sei-cosmos/client/config/config.go index bae915baa7..cf25080b10 100644 --- a/sei-cosmos/client/config/config.go +++ b/sei-cosmos/client/config/config.go @@ -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 @@ -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 diff --git a/sei-cosmos/client/context.go b/sei-cosmos/client/context.go index b6a70f605e..cd2a497d8f 100644 --- a/sei-cosmos/client/context.go +++ b/sei-cosmos/client/context.go @@ -12,6 +12,7 @@ import ( "gopkg.in/yaml.v2" "github.com/gogo/protobuf/proto" + "github.com/sei-protocol/sei-chain/sei-tendermint/libs/utils" rpcclient "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client" "github.com/sei-protocol/sei-chain/sei-cosmos/codec" @@ -20,11 +21,10 @@ import ( sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types" ) -// Context implements a typical context created in SDK modules for transaction -// handling and queries. -type Context struct { +type Context = contextG[rpcclient.Client] + +type contextBase struct { FromAddress sdk.AccAddress - Client rpcclient.Client ChainID string // Deprecated: Codec codec will be changed to Codec: codec.Codec JSONCodec codec.JSONCodec @@ -58,20 +58,27 @@ type Context struct { LegacyAmino *codec.LegacyAmino } +// Context implements a typical context created in SDK modules for transaction +// handling and queries. +type contextG[C rpcclient.Client] struct { + contextBase + Client utils.Option[C] +} + // WithKeyring returns a copy of the context with an updated keyring. -func (ctx Context) WithKeyring(k keyring.Keyring) Context { +func (ctx contextG[C]) WithKeyring(k keyring.Keyring) contextG[C] { ctx.Keyring = k return ctx } // WithKeyringOptions returns a copy of the context with an updated keyring. -func (ctx Context) WithKeyringOptions(opts ...keyring.Option) Context { +func (ctx contextG[C]) WithKeyringOptions(opts ...keyring.Option) contextG[C] { ctx.KeyringOptions = opts return ctx } // WithInput returns a copy of the context with an updated input. -func (ctx Context) WithInput(r io.Reader) Context { +func (ctx contextG[C]) WithInput(r io.Reader) contextG[C] { // convert to a bufio.Reader to have a shared buffer between the keyring and the // the Commands, ensuring a read from one advance the read pointer for the other. // see https://github.com/cosmos/cosmos-sdk/issues/9566. @@ -80,7 +87,7 @@ func (ctx Context) WithInput(r io.Reader) Context { } // Deprecated: WithJSONCodec returns a copy of the Context with an updated JSONCodec. -func (ctx Context) WithJSONCodec(m codec.JSONCodec) Context { +func (ctx contextG[C]) WithJSONCodec(m codec.JSONCodec) contextG[C] { ctx.JSONCodec = m // since we are using ctx.Codec everywhere in the SDK, for backward compatibility // we need to try to set it here as well. @@ -91,7 +98,7 @@ func (ctx Context) WithJSONCodec(m codec.JSONCodec) Context { } // WithCodec returns a copy of the Context with an updated Codec. -func (ctx Context) WithCodec(m codec.Codec) Context { +func (ctx contextG[C]) WithCodec(m codec.Codec) contextG[C] { ctx.JSONCodec = m ctx.Codec = m return ctx @@ -99,62 +106,64 @@ func (ctx Context) WithCodec(m codec.Codec) Context { // WithLegacyAmino returns a copy of the context with an updated LegacyAmino codec. // TODO: Deprecated (remove). -func (ctx Context) WithLegacyAmino(cdc *codec.LegacyAmino) Context { +func (ctx contextG[C]) WithLegacyAmino(cdc *codec.LegacyAmino) contextG[C] { ctx.LegacyAmino = cdc return ctx } // WithOutput returns a copy of the context with an updated output writer (e.g. stdout). -func (ctx Context) WithOutput(w io.Writer) Context { +func (ctx contextG[C]) WithOutput(w io.Writer) contextG[C] { ctx.Output = w return ctx } // WithFrom returns a copy of the context with an updated from address or name. -func (ctx Context) WithFrom(from string) Context { +func (ctx contextG[C]) WithFrom(from string) contextG[C] { ctx.From = from return ctx } // WithOutputFormat returns a copy of the context with an updated OutputFormat field. -func (ctx Context) WithOutputFormat(format string) Context { +func (ctx contextG[C]) WithOutputFormat(format string) contextG[C] { ctx.OutputFormat = format return ctx } // WithNodeURI returns a copy of the context with an updated node URI. -func (ctx Context) WithNodeURI(nodeURI string) Context { +func (ctx contextG[C]) WithNodeURI(nodeURI string) contextG[C] { ctx.NodeURI = nodeURI return ctx } // WithHeight returns a copy of the context with an updated height. -func (ctx Context) WithHeight(height int64) Context { +func (ctx contextG[C]) WithHeight(height int64) contextG[C] { ctx.Height = height return ctx } // WithClient returns a copy of the context with an updated RPC client // instance. -func (ctx Context) WithClient(client rpcclient.Client) Context { - ctx.Client = client - return ctx +func WithClient[C2, C1 rpcclient.Client](ctx contextG[C1], client C2) contextG[C2] { + return contextG[C2]{ + contextBase: ctx.contextBase, + Client: utils.Some(client), + } } // WithUseLedger returns a copy of the context with an updated UseLedger flag. -func (ctx Context) WithUseLedger(useLedger bool) Context { +func (ctx contextG[C]) WithUseLedger(useLedger bool) contextG[C] { ctx.UseLedger = useLedger return ctx } // WithChainID returns a copy of the context with an updated chain ID. -func (ctx Context) WithChainID(chainID string) Context { +func (ctx contextG[C]) WithChainID(chainID string) contextG[C] { ctx.ChainID = chainID return ctx } // WithHomeDir returns a copy of the Context with HomeDir set. -func (ctx Context) WithHomeDir(dir string) Context { +func (ctx contextG[C]) WithHomeDir(dir string) contextG[C] { if dir != "" { ctx.HomeDir = dir } @@ -162,91 +171,91 @@ func (ctx Context) WithHomeDir(dir string) Context { } // WithKeyringDir returns a copy of the Context with KeyringDir set. -func (ctx Context) WithKeyringDir(dir string) Context { +func (ctx contextG[C]) WithKeyringDir(dir string) contextG[C] { ctx.KeyringDir = dir return ctx } // WithGenerateOnly returns a copy of the context with updated GenerateOnly value -func (ctx Context) WithGenerateOnly(generateOnly bool) Context { +func (ctx contextG[C]) WithGenerateOnly(generateOnly bool) contextG[C] { ctx.GenerateOnly = generateOnly return ctx } // WithSimulation returns a copy of the context with updated Simulate value -func (ctx Context) WithSimulation(simulate bool) Context { +func (ctx contextG[C]) WithSimulation(simulate bool) contextG[C] { ctx.Simulate = simulate return ctx } // WithOffline returns a copy of the context with updated Offline value. -func (ctx Context) WithOffline(offline bool) Context { +func (ctx contextG[C]) WithOffline(offline bool) contextG[C] { ctx.Offline = offline return ctx } // WithFromName returns a copy of the context with an updated from account name. -func (ctx Context) WithFromName(name string) Context { +func (ctx contextG[C]) WithFromName(name string) contextG[C] { ctx.FromName = name return ctx } // WithFromAddress returns a copy of the context with an updated from account // address. -func (ctx Context) WithFromAddress(addr sdk.AccAddress) Context { +func (ctx contextG[C]) WithFromAddress(addr sdk.AccAddress) contextG[C] { ctx.FromAddress = addr return ctx } // WithFeeGranterAddress returns a copy of the context with an updated fee granter account // address. -func (ctx Context) WithFeeGranterAddress(addr sdk.AccAddress) Context { +func (ctx contextG[C]) WithFeeGranterAddress(addr sdk.AccAddress) contextG[C] { ctx.FeeGranter = addr return ctx } // WithBroadcastMode returns a copy of the context with an updated broadcast // mode. -func (ctx Context) WithBroadcastMode(mode string) Context { +func (ctx contextG[C]) WithBroadcastMode(mode string) contextG[C] { ctx.BroadcastMode = mode return ctx } // WithSignModeStr returns a copy of the context with an updated SignMode // value. -func (ctx Context) WithSignModeStr(signModeStr string) Context { +func (ctx contextG[C]) WithSignModeStr(signModeStr string) contextG[C] { ctx.SignModeStr = signModeStr return ctx } // WithSkipConfirmation returns a copy of the context with an updated SkipConfirm // value. -func (ctx Context) WithSkipConfirmation(skip bool) Context { +func (ctx contextG[C]) WithSkipConfirmation(skip bool) contextG[C] { ctx.SkipConfirm = skip return ctx } // WithTxConfig returns the context with an updated TxConfig -func (ctx Context) WithTxConfig(generator TxConfig) Context { +func (ctx contextG[C]) WithTxConfig(generator TxConfig) contextG[C] { ctx.TxConfig = generator return ctx } // WithAccountRetriever returns the context with an updated AccountRetriever -func (ctx Context) WithAccountRetriever(retriever AccountRetriever) Context { +func (ctx contextG[C]) WithAccountRetriever(retriever AccountRetriever) contextG[C] { ctx.AccountRetriever = retriever return ctx } // WithInterfaceRegistry returns the context with an updated InterfaceRegistry -func (ctx Context) WithInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry) Context { +func (ctx contextG[C]) WithInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry) contextG[C] { ctx.InterfaceRegistry = interfaceRegistry return ctx } // WithViper returns the context with Viper field. This Viper instance is used to read // client-side config from the config file. -func (ctx Context) WithViper(prefix string) Context { +func (ctx contextG[C]) WithViper(prefix string) contextG[C] { v := viper.New() v.SetEnvPrefix(prefix) v.AutomaticEnv() @@ -255,13 +264,13 @@ func (ctx Context) WithViper(prefix string) Context { } // PrintString prints the raw string to ctx.Output if it's defined, otherwise to os.Stdout -func (ctx Context) PrintString(str string) error { +func (ctx contextG[C]) PrintString(str string) error { return ctx.PrintBytes([]byte(str)) } // PrintBytes prints the raw bytes to ctx.Output if it's defined, otherwise to os.Stdout. // NOTE: for printing a complex state object, you should use ctx.PrintOutput -func (ctx Context) PrintBytes(o []byte) error { +func (ctx contextG[C]) PrintBytes(o []byte) error { writer := ctx.Output if writer == nil { writer = os.Stdout @@ -274,7 +283,7 @@ func (ctx Context) PrintBytes(o []byte) error { // PrintProto outputs toPrint to the ctx.Output based on ctx.OutputFormat which is // either text or json. If text, toPrint will be YAML encoded. Otherwise, toPrint // will be JSON encoded using ctx.Codec. An error is returned upon failure. -func (ctx Context) PrintProto(toPrint proto.Message) error { +func (ctx contextG[C]) PrintProto(toPrint proto.Message) error { // always serialize JSON initially because proto json can't be directly YAML encoded out, err := ctx.Codec.MarshalAsJSON(toPrint) if err != nil { @@ -286,7 +295,7 @@ func (ctx Context) PrintProto(toPrint proto.Message) error { // PrintObjectLegacy is a variant of PrintProto that doesn't require a proto.Message type // and uses amino JSON encoding. // Deprecated: It will be removed in the near future! -func (ctx Context) PrintObjectLegacy(toPrint interface{}) error { +func (ctx contextG[C]) PrintObjectLegacy(toPrint interface{}) error { out, err := ctx.LegacyAmino.MarshalAsJSON(toPrint) if err != nil { return err @@ -294,7 +303,7 @@ func (ctx Context) PrintObjectLegacy(toPrint interface{}) error { return ctx.printOutput(out) } -func (ctx Context) printOutput(out []byte) error { +func (ctx contextG[C]) printOutput(out []byte) error { if ctx.OutputFormat == "text" { // handle text format by decoding and re-encoding JSON as YAML var j interface{} diff --git a/sei-cosmos/client/grpc_query.go b/sei-cosmos/client/grpc_query.go index a44da6e197..8cbd7f38c1 100644 --- a/sei-cosmos/client/grpc_query.go +++ b/sei-cosmos/client/grpc_query.go @@ -24,7 +24,7 @@ var _ gogogrpc.ClientConn = Context{} var protoCodec = encoding.GetCodec(proto.Name) // Invoke implements the grpc ClientConn.Invoke method -func (ctx Context) Invoke(grpcCtx gocontext.Context, method string, req, reply interface{}, opts ...grpc.CallOption) (err error) { +func (ctx contextG[C]) Invoke(grpcCtx gocontext.Context, method string, req, reply interface{}, opts ...grpc.CallOption) (err error) { // Two things can happen here: // 1. either we're broadcasting a Tx, in which call we call Tendermint's broadcast endpoint directly, // 2. or we are querying for state, in which case we call ABCI's Query. @@ -41,7 +41,7 @@ func (ctx Context) Invoke(grpcCtx gocontext.Context, method string, req, reply i return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "expected %T, got %T", (*tx.BroadcastTxResponse)(nil), req) } - broadcastRes, err := TxServiceBroadcast(grpcCtx, ctx, reqProto) + broadcastRes, err := ctx.TxServiceBroadcast(grpcCtx, reqProto) if err != nil { return err } @@ -111,6 +111,6 @@ func (ctx Context) Invoke(grpcCtx gocontext.Context, method string, req, reply i } // NewStream implements the grpc ClientConn.NewStream method -func (Context) NewStream(gocontext.Context, *grpc.StreamDesc, string, ...grpc.CallOption) (grpc.ClientStream, error) { +func (contextG[C]) NewStream(gocontext.Context, *grpc.StreamDesc, string, ...grpc.CallOption) (grpc.ClientStream, error) { return nil, fmt.Errorf("streaming rpc not supported") } diff --git a/sei-cosmos/client/query.go b/sei-cosmos/client/query.go index 6f2c0fe689..504e43c730 100644 --- a/sei-cosmos/client/query.go +++ b/sei-cosmos/client/query.go @@ -20,32 +20,31 @@ import ( // GetNode returns an RPC client. If the context's client is not defined, an // error is returned. -func (ctx Context) GetNode() (rpcclient.Client, error) { - if ctx.Client == nil { - return nil, errors.New("no RPC client is defined in offline mode") +func (ctx contextG[C]) GetNode() (rpcclient.Client, error) { + if c, ok := ctx.Client.Get(); ok { + return c, nil } - - return ctx.Client, nil + return nil, errors.New("no RPC client is defined in offline mode") } // Query performs a query to a Tendermint node with the provided path. // It returns the result and height of the query upon success or an error if // the query fails. -func (ctx Context) Query(path string) ([]byte, int64, error) { +func (ctx contextG[C]) Query(path string) ([]byte, int64, error) { return ctx.query(path, nil) } // QueryWithData performs a query to a Tendermint node with the provided path // and a data payload. It returns the result and height of the query upon success // or an error if the query fails. -func (ctx Context) QueryWithData(path string, data []byte) ([]byte, int64, error) { +func (ctx contextG[C]) QueryWithData(path string, data []byte) ([]byte, int64, error) { return ctx.query(path, data) } // QueryStore performs a query to a Tendermint node with the provided key and // store name. It returns the result and height of the query upon success // or an error if the query fails. -func (ctx Context) QueryStore(key tmbytes.HexBytes, storeName string) ([]byte, int64, error) { +func (ctx contextG[C]) QueryStore(key tmbytes.HexBytes, storeName string) ([]byte, int64, error) { return ctx.queryStore(key, storeName, "key") } @@ -53,26 +52,26 @@ func (ctx Context) QueryStore(key tmbytes.HexBytes, storeName string) ([]byte, i // It returns the ResultQuery obtained from the query. The height used to perform // the query is the RequestQuery Height if it is non-zero, otherwise the context // height is used. -func (ctx Context) QueryABCI(req abci.RequestQuery) (abci.ResponseQuery, error) { +func (ctx contextG[C]) QueryABCI(req abci.RequestQuery) (abci.ResponseQuery, error) { return ctx.queryABCI(req) } // GetFromAddress returns the from address from the context's name. -func (ctx Context) GetFromAddress() sdk.AccAddress { +func (ctx contextG[C]) GetFromAddress() sdk.AccAddress { return ctx.FromAddress } // GetFeeGranterAddress returns the fee granter address from the context -func (ctx Context) GetFeeGranterAddress() sdk.AccAddress { +func (ctx contextG[C]) GetFeeGranterAddress() sdk.AccAddress { return ctx.FeeGranter } // GetFromName returns the key name for the current context. -func (ctx Context) GetFromName() string { +func (ctx contextG[C]) GetFromName() string { return ctx.FromName } -func (ctx Context) queryABCI(req abci.RequestQuery) (abci.ResponseQuery, error) { +func (ctx contextG[C]) queryABCI(req abci.RequestQuery) (abci.ResponseQuery, error) { node, err := ctx.GetNode() if err != nil { return abci.ResponseQuery{}, err @@ -124,7 +123,7 @@ func sdkErrorToGRPCError(resp abci.ResponseQuery) error { // query performs a query to a Tendermint node with the provided store name // and path. It returns the result and height of the query upon success // or an error if the query fails. -func (ctx Context) query(path string, key tmbytes.HexBytes) ([]byte, int64, error) { +func (ctx contextG[C]) query(path string, key tmbytes.HexBytes) ([]byte, int64, error) { resp, err := ctx.queryABCI(abci.RequestQuery{ Path: path, Data: key, @@ -140,7 +139,7 @@ func (ctx Context) query(path string, key tmbytes.HexBytes) ([]byte, int64, erro // queryStore performs a query to a Tendermint node with the provided a store // name and path. It returns the result and height of the query upon success // or an error if the query fails. -func (ctx Context) queryStore(key tmbytes.HexBytes, storeName, endPath string) ([]byte, int64, error) { +func (ctx contextG[C]) queryStore(key tmbytes.HexBytes, storeName, endPath string) ([]byte, int64, error) { path := fmt.Sprintf("/store/%s/%s", storeName, endPath) return ctx.query(path, key) } diff --git a/sei-cosmos/server/start.go b/sei-cosmos/server/start.go index bbee42f884..2031ed2613 100644 --- a/sei-cosmos/server/start.go +++ b/sei-cosmos/server/start.go @@ -31,6 +31,7 @@ import ( tcmd "github.com/sei-protocol/sei-chain/sei-tendermint/cmd/tendermint/commands" "github.com/sei-protocol/sei-chain/sei-tendermint/libs/service" "github.com/sei-protocol/sei-chain/sei-tendermint/node" + rpcclient "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client" "github.com/sei-protocol/sei-chain/sei-tendermint/rpc/client/local" tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/types" "github.com/spf13/cobra" @@ -365,7 +366,7 @@ func startInProcess( if err != nil { return err } - clientCtx = clientCtx.WithClient(localClient) + clientCtx = client.WithClient[rpcclient.Client](clientCtx, localClient) app.RegisterTxService(clientCtx) app.RegisterTendermintService(clientCtx) diff --git a/sei-cosmos/testutil/network/util.go b/sei-cosmos/testutil/network/util.go index 5b86ffabcf..7804589eae 100644 --- a/sei-cosmos/testutil/network/util.go +++ b/sei-cosmos/testutil/network/util.go @@ -6,6 +6,7 @@ import ( "path/filepath" "time" + "github.com/sei-protocol/sei-chain/sei-cosmos/client" "github.com/sei-protocol/sei-chain/sei-cosmos/crypto/codec" tmtime "github.com/sei-protocol/sei-chain/sei-cosmos/std" "github.com/sei-protocol/sei-chain/sei-cosmos/telemetry" @@ -77,8 +78,7 @@ func startInProcess(cfg Config, val *Validator) error { // We'll need a RPC client if the validator exposes a gRPC or REST endpoint. if val.APIAddress != "" || val.AppConfig.GRPC.Enable { - val.ClientCtx = val.ClientCtx. - WithClient(val.RPCClient) + val.ClientCtx = client.WithClient(val.ClientCtx, val.RPCClient) // Add the tx service in the gRPC router. app.RegisterTxService(val.ClientCtx) diff --git a/sei-cosmos/x/auth/tx/service.go b/sei-cosmos/x/auth/tx/service.go index 84fa7327a7..53bc85fd6d 100644 --- a/sei-cosmos/x/auth/tx/service.go +++ b/sei-cosmos/x/auth/tx/service.go @@ -240,7 +240,7 @@ func (s txServer) GetBlockWithTxs(ctx context.Context, req *txtypes.GetBlockWith } func (s txServer) BroadcastTx(ctx context.Context, req *txtypes.BroadcastTxRequest) (*txtypes.BroadcastTxResponse, error) { - return client.TxServiceBroadcast(ctx, s.clientCtx, req) + return s.clientCtx.TxServiceBroadcast(ctx, req) } // RegisterTxService registers the tx service on the gRPC router. diff --git a/sei-cosmos/x/genutil/client/rest/query.go b/sei-cosmos/x/genutil/client/rest/query.go index 981633b0b4..555023ff42 100644 --- a/sei-cosmos/x/genutil/client/rest/query.go +++ b/sei-cosmos/x/genutil/client/rest/query.go @@ -14,7 +14,12 @@ import ( // QueryGenesisTxs writes the genesis transactions to the response if no error // occurs. func QueryGenesisTxs(clientCtx client.Context, w http.ResponseWriter) { - resultGenesis, err := clientCtx.Client.Genesis(context.Background()) + client, err := clientCtx.GetNode() + if err != nil { + rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) + return + } + resultGenesis, err := client.Genesis(context.Background()) if err != nil { rest.WriteErrorResponse( w, http.StatusInternalServerError, From 1141f9f6024f9d911ea8f315596bafb5312a9f11 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Fri, 1 May 2026 10:54:34 +0200 Subject: [PATCH 5/7] registrations for local node --- sei-cosmos/server/start.go | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/sei-cosmos/server/start.go b/sei-cosmos/server/start.go index 2031ed2613..9abde80718 100644 --- a/sei-cosmos/server/start.go +++ b/sei-cosmos/server/start.go @@ -356,20 +356,19 @@ func startInProcess( if err := tmNode.Start(goCtx); err != nil { return fmt.Errorf("error starting node: %w", err) } - } + // Add the tx service to the gRPC router. We only need to register this + // service if API or gRPC is enabled, and avoid doing so in the general + // case, because it spawns a new local tendermint RPC client. + if config.API.Enable || config.GRPC.Enable { + localClient, err := local.New(tmNode.(local.NodeService)) + if err != nil { + return err + } + clientCtx = client.WithClient[rpcclient.Client](clientCtx, localClient) - // Add the tx service to the gRPC router. We only need to register this - // service if API or gRPC is enabled, and avoid doing so in the general - // case, because it spawns a new local tendermint RPC client. - if (config.API.Enable || config.GRPC.Enable) && tmNode != nil { - localClient, err := local.New(tmNode.(local.NodeService)) - if err != nil { - return err + app.RegisterTxService(clientCtx) + app.RegisterTendermintService(clientCtx) } - clientCtx = client.WithClient[rpcclient.Client](clientCtx, localClient) - - app.RegisterTxService(clientCtx) - app.RegisterTendermintService(clientCtx) } var apiSrv *api.Server From c7ce3a0b137993e2c75358b8925555ae69782000 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Fri, 1 May 2026 11:07:32 +0200 Subject: [PATCH 6/7] reordered defers in startInProcess --- sei-cosmos/server/api/server.go | 5 ++- sei-cosmos/server/start.go | 60 ++++++++++++--------------------- 2 files changed, 25 insertions(+), 40 deletions(-) diff --git a/sei-cosmos/server/api/server.go b/sei-cosmos/server/api/server.go index 79495d1c6f..c1ebf09c70 100644 --- a/sei-cosmos/server/api/server.go +++ b/sei-cosmos/server/api/server.go @@ -128,7 +128,10 @@ func (s *Server) Start(cfg config.Config, apiMetrics *telemetry.Metrics) error { func (s *Server) Close() error { s.mtx.Lock() defer s.mtx.Unlock() - return s.listener.Close() + if s.listener != nil { + return s.listener.Close() + } + return nil } func (s *Server) registerGRPCGatewayRoutes() { diff --git a/sei-cosmos/server/start.go b/sei-cosmos/server/start.go index 9abde80718..4fc9426c1e 100644 --- a/sei-cosmos/server/start.go +++ b/sei-cosmos/server/start.go @@ -36,7 +36,6 @@ import ( tmtypes "github.com/sei-protocol/sei-chain/sei-tendermint/types" "github.com/spf13/cobra" "go.opentelemetry.io/otel/sdk/trace" - "google.golang.org/grpc" ) const ( @@ -270,7 +269,6 @@ func startInProcess( home := cfg.RootDir goCtx, cancel := context.WithCancel(context.Background()) defer cancel() - var cpuProfileCleanup func() if cpuProfile := ctx.Viper.GetString(flagCPUProfile); cpuProfile != "" { f, err := os.Create(filepath.Clean(cpuProfile)) if err != nil { @@ -281,11 +279,11 @@ func startInProcess( return fmt.Errorf("failed to start CPU Profiler %w", err) } - cpuProfileCleanup = func() { + defer func() { logger.Info("stopping CPU profiler", "profile", cpuProfile) pprof.StopCPUProfile() _ = f.Close() - } + }() } traceWriterFile := ctx.Viper.GetString(flagTraceStore) @@ -306,6 +304,12 @@ func startInProcess( "(SDK v0.45). Please explicitly put the desired minimum-gas-prices in your app.toml.") } app := appCreator(nil, traceWriter, ctx.Config, ctx.Viper) + defer func() { + logger.Info("close any other open resource...") + if err := app.Close(); err != nil { + logger.Error("error closing database", "err", err) + } + }() gRPCOnly := ctx.Viper.GetBool(flagGRPCOnly) var tmNode service.Service @@ -356,6 +360,11 @@ func startInProcess( if err := tmNode.Start(goCtx); err != nil { return fmt.Errorf("error starting node: %w", err) } + defer func() { + if tmNode.IsRunning() { + tmNode.Wait() + } + }() // Add the tx service to the gRPC router. We only need to register this // service if API or gRPC is enabled, and avoid doing so in the general // case, because it spawns a new local tendermint RPC client. @@ -371,10 +380,11 @@ func startInProcess( } } - var apiSrv *api.Server if config.API.Enable { + var apiSrv *api.Server clientCtx := clientCtx.WithHomeDir(home).WithChainID(clientCtx.ChainID) apiSrv = api.New(clientCtx) + defer apiSrv.Close() app.RegisterAPIRoutes(apiSrv, config.API) errCh := make(chan error) @@ -392,23 +402,20 @@ func startInProcess( } } - var ( - grpcSrv *grpc.Server - grpcWebSrv *http.Server - ) - if config.GRPC.Enable { - grpcSrv, err = servergrpc.StartGRPCServer(clientCtx, app, config.GRPC.Address) + grpcSrv, err := servergrpc.StartGRPCServer(clientCtx, app, config.GRPC.Address) if err != nil { return err } + defer grpcSrv.Stop() if config.GRPCWeb.Enable { - grpcWebSrv, err = servergrpc.StartGRPCWeb(grpcSrv, config) + grpcWebSrv, err := servergrpc.StartGRPCWeb(grpcSrv, config) if err != nil { logger.Error("failed to start grpc-web http server", "err", err) return err } + defer grpcWebSrv.Close() } } @@ -461,33 +468,8 @@ func startInProcess( } } - defer func() { - cancel() - if tmNode.IsRunning() { - tmNode.Wait() - } - - if cpuProfileCleanup != nil { - cpuProfileCleanup() - } - - if apiSrv != nil { - _ = apiSrv.Close() - } - - if grpcSrv != nil { - grpcSrv.Stop() - if grpcWebSrv != nil { - _ = grpcWebSrv.Close() - } - } - - logger.Info("close any other open resource...") - if err := app.Close(); err != nil { - logger.Error("error closing database", "err", err) - } - }() - + // Defer cancelling as the last so that it is called first during unwinding. + defer cancel() // wait for signal capture and gracefully return return WaitForQuitSignals(goCtx, restartCh) } From 956b0e5f8fe2fca6a4026cbd7895a28d6280d006 Mon Sep 17 00:00:00 2001 From: Grzegorz Prusak Date: Fri, 1 May 2026 11:09:29 +0200 Subject: [PATCH 7/7] compilation fix --- loadtest/sign.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/loadtest/sign.go b/loadtest/sign.go index 3d5afd75d5..b4c1726e86 100644 --- a/loadtest/sign.go +++ b/loadtest/sign.go @@ -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 { @@ -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)