You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b57bd8b
Browse filesBrowse the repository at this point in the historyBrowse files
## Summary
- Wire a deadline enforcer into the gRPC plane: unary and stream
interceptors bound each request's context by a configurable per-method
default deadline, and normalize a bare `context.DeadlineExceeded` into
`codes.DeadlineExceeded`.
- Add `grpc.request-timeout` config (`DefaultGRPCRequestTimeout` = 30s),
applied to both native gRPC (:9090) and gRPC-Web (:9091). Deadline
interceptors run after the rate-limit interceptors, so admission
rejections don't eat into the request's time budget. `0` disables the
default deadline.
- Thread the caller's `context.Context` through query execution:
`enrichABCIQueryContext` attaches it to `sdk.Context` so gRPC module
queries, ABCI `/abci_query`, and custom queriers can honor deadlines in
store/MVCC iteration (`ctxkv`).
- Thread `context.Context` through `BaseApp.Simulate` (and
`handleQueryApp` / `txServer.Simulate`) so simulate RPC inherits the
bounded gRPC context; report simulate's `context.DeadlineExceeded` as
`codes.DeadlineExceeded` instead of `codes.Unknown`.
- During simulation, abort long-running work when the context expires:
`RunMsgs` checks between messages; EVM execution uses
`context.AfterFunc` + `evm.Cancel` (DeliverTx unchanged). Context
cancel/deadline is not logged or counted as a state-transition error.
- Stream handlers observe the bounded context on `RecvMsg` / `SendMsg`,
not only on `Context()`.
## Test plan
- [x] `sei-cosmos/server/grpc/deadline_test.go` — unary/stream
interceptor behavior (default deadline, client deadline wins, success
path, non-deadline errors pass through, stream context override,
RecvMsg/SendMsg bounded by deadline)
- [x] `sei-cosmos/x/auth/tx/service_test.go` — Simulate reports
`DeadlineExceeded` distinctly from other errors
- [x] `sei-cosmos/server/config/config_test.go` — default, override, and
negative-duration clamp for `grpc.request-timeout`
- [x] `config/cosmosbase` characterization suite updated for the new
config key
- [x] `sei-cosmos/baseapp/query_trust_test.go` — caller context
preserved on enriched ABCI/gRPC-over-ABCI queries
- [x] `sei-cosmos/baseapp/grpcserver_test.go` — gRPC server path threads
server interceptor deadline into `sdk.Context`
- [x] `sei-cosmos/baseapp/deliver_tx_test.go` — Simulate propagates
caller context to message handlers
- [x] `x/evm/keeper/msg_server_test.go` — simulation deadline cancels
in-flight EVM execution
- [x] `x/evm/keeper/msg_server_internal_test.go` — context cancellation
error classification
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
0 commit comments