Skip to content

test(grpc-suite): add post-upgrade gRPC surface coverage#2075

Open
chalabi2 wants to merge 15 commits into
mainfrom
feat/post-upgrade-grpc-suite
Open

test(grpc-suite): add post-upgrade gRPC surface coverage#2075
chalabi2 wants to merge 15 commits into
mainfrom
feat/post-upgrade-grpc-suite

Conversation

@chalabi2

@chalabi2 chalabi2 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Description

Closes: 636

Adds the post-upgrade gRPC surface suite for testnetify-forked upgrade runs.
The suite exercises the mounted Akash and Cosmos SDK gRPC transaction/query
surface after an upgrade and fails when discovered in-scope RPCs are not covered.

Key pieces:

  • tests/upgrade/grpcsuite: authored tx packs, query smoke sweep, coverage gate
  • tests/upgrade/grpcsurface_worker_test.go: universal post-upgrade worker
  • tests/fullsurface: fast in-process local/CI driver
  • make test-grpc-surface[-tx|-query]: local runners

Validation:

  • make -C tests/upgrade test: PASS, coverage tx 76/76, query 130/130
  • make test-grpc-surface: PASS, coverage tx 76/76, query 130/130
  • make test-grpc-surface-tx: PASS, coverage tx 76/76
  • make test-grpc-surface-query: PASS, coverage query 130/130

chalabi2 added 12 commits June 17, 2026 14:41
Adds tests/upgrade/grpcsuite: a harness-agnostic suite that verifies the
chain's gRPC API surface after an upgrade. It dynamically discovers every
served query (gRPC reflection) and every registered Msg (interface registry),
exercises them strictly over the gRPC API, and fails a coverage gate if any
in-scope RPC was never run -- so a new RPC added by a future upgrade turns
CI red until a case exists.

Queries are auto-covered by a smoke sweep (130/130); transactions are
authored, dependency-ordered scenarios sharing a World. Gov-gated messages
use a batched propose/vote/wait fast-path. The suite runs as the universal
post-upgrade worker (every upgrade) against a testnetify-forked node, and via
an in-process driver for fast/CI runs (make test-grpc-surface, new
grpc-surface CI job).

Current tx coverage: deployment lifecycle, provider, and all MsgUpdateParams;
remaining Akash packs (cert, market, escrow, audit, oracle, bme) are tracked
by the coverage gate's UNCOVERED list.

Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
Covers the full market bid/lease lifecycle (create bid, create lease,
withdraw, lease-start-reclaim rejection, close lease, close bid), auditor
attribute sign/delete, and escrow account deposit. Adds a WaitBlocks helper
(lease payments settle a block after creation) and a reusable
createDeploymentFromSDL helper for packs that need extra orders/escrow
accounts. Akash tx coverage now 23/30; queries 130/130.

Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
Generates an mTLS client certificate via KeyPairManager (into a temp dir),
PEM-wraps the DER cert/pubkey as the chain expects, creates and then revokes
it. Akash tx coverage now 25/30 (remaining: oracle AddPriceEntry, bme).

Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
Authorizes a price source via a gov param change, then submits an AKT/USD
price entry (with a block-time timestamp the oracle accepts). Adds a
LatestBlockTime helper. Akash tx coverage now 26/30 (remaining: bme).

Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
Completes Akash transaction coverage at 30/30 (queries 130/130). The bme
pack funds the vault (gov), mints ACT, and tolerates the circuit-breaker
rejection on burn ACT / burn-mint (only minting is enabled on main); it
re-feeds a fresh oracle price first since bme refuses stale prices. Adds a
BroadcastTolerant helper and a reusable feedAKTPrice helper.

RequireFullCoverage is now true in both drivers, so the coverage gate fails
if any in-scope Akash tx or query stops being exercised.

Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
… module

Every Akash query RPC is now exercised with real, populated inputs (asserting
content + pagination + filters), and every major Akash tx has negative/edge
cases (not-found, signer mismatch, duplicate, out-of-bounds, disabled/gov-gated)
that assert the expected rejection. Strict full-coverage gate stays green
(tx 30/30, query 130/130).

Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
Deployment deposits must be in uact: the chain requires the deposit denom
to match the uact group price. uact is non-transferable on the real forked
chain (bank Send is gov-disabled), so funding sub-accounts with uact via
MsgSend failed there. Make the deployment owner ("tenant") the funder,
which already holds uact on both the forked chain and the in-process net,
and have it deposit its own uact directly. A deposit is an account->module
operation that bypasses SendEnabled, so this mirrors how tenants spend uact
on the real chain. Provider sub-accounts keep their uakt bid deposit.

Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
Run the exhaustive gRPC tx/query suite as an optional post-upgrade step
rather than unconditionally, matching how the hermes relayer integration is
opt-in. The universal post-upgrade worker now runs only when -grpc-suite is
set, which the upgrade make target exposes as `make test GRPC_SUITE=true`.

Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
Real testnetify forks can run with tx indexing disabled, so GetTx is not enough to prove broadcast inclusion. Scan committed blocks after CheckTx and rely on state assertions when index events are unavailable.

The real fork also starts validator0 without uact. Bootstrap ACT through the BME flow before deployment deposits and refresh the oracle price while waiting for mints to open.

Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
Adds authored Cosmos SDK packs to the post-upgrade gRPC suite so the coverage
gate exercises every discovered in-scope transaction and query on both the
in-process driver and testnetify-forked upgrade path.

Also hardens fork state preparation around rollback/testnetify so cached
upgrade runs start from clean pre-upgrade state.

Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
Adds explicit tx-only and query-only local runners for the gRPC surface suite while keeping the default target as the full tx/query coverage gate.

Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bda966cf-6e71-43d4-a22f-4f270b61018d

📥 Commits

Reviewing files that changed from the base of the PR and between 5fcf4eb and 32af38d.

📒 Files selected for processing (5)
  • tests/upgrade/grpcsuite/README.md
  • tests/upgrade/grpcsuite/coverage.go
  • tests/upgrade/grpcsuite/pack.go
  • tests/upgrade/grpcsuite/pack_cosmwasm.go
  • tests/upgrade/grpcsuite/pack_gov.go
✅ Files skipped from review due to trivial changes (1)
  • tests/upgrade/grpcsuite/README.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • tests/upgrade/grpcsuite/pack.go
  • tests/upgrade/grpcsuite/pack_gov.go
  • tests/upgrade/grpcsuite/coverage.go

Walkthrough

Introduces a comprehensive grpcsuite package implementing a gRPC-only integration test suite that dynamically discovers served services via reflection, gates test coverage by proto prefix filtering, signs and broadcasts transactions locally using DIRECT mode, and runs dependency-ordered per-module test packs covering Akash and Cosmos SDK modules. The suite executes as both a standalone TestFullSurfaceGRPC in-process local test and as a universal post-upgrade verification worker. Upgrade script testnetify flow is refactored to be asynchronous with timeout polling, early-stop on upgrade-info detection, and conditional pre-rollback. New Make targets, CI job, rollback command, and comprehensive documentation are added.

Changes

gRPC Full-Surface Test Suite

Layer / File(s) Summary
RunMode, Env, World, and Suite base types
tests/upgrade/grpcsuite/env.go
Defines RunMode enum (All, Tx, Query) with parsing and predicate helpers. Env configuration struct holding gRPC endpoint, codec/tx config, keyring, funder, bond denom, gas prices, and coverage strictness. Concurrency-safe World for cross-pack state (funded accounts and opaque handles). Suite container for test context, conn, clients, and execution state.
gRPC connection, discovery, and coverage accounting
tests/upgrade/grpcsuite/grpcconn.go, tests/upgrade/grpcsuite/coverage.go, tests/upgrade/grpcsuite/README.md
Implements dialGRPC with protobuf codec and unary interceptor hook for coverage recording. Dynamic service Discovery via reflection (v1 with v1alpha fallback) and proto descriptor matching to enumerate in-scope Msg (strict prefix filtered) and Query (prefix filtered) RPCs. Coverage recorder tracking invoked vs expected method paths and Msg type URLs with strict mode assertion gated by RunMode (All/Tx/Query).
DIRECT-mode transaction signing and broadcast with inclusion polling
tests/upgrade/grpcsuite/txbroadcast.go
Implements Broadcaster with local DIRECT-mode signing via keyring lookup, account sequence fetch, gas simulation via gRPC, unsigned tx construction, and local signing. Broadcasts over gRPC in sync mode; on CheckTx rejection returns immediately. On success, polls gRPC GetTx for inclusion; if delayed, scans block heights via GetBlockByHeight matching by hash or raw-bytes; returns indexed result or conservative TxResponse (hash+height) when indexing unavailable.
Suite.Run entrypoint and test helpers
tests/upgrade/grpcsuite/env.go
Implements Run(ctx, t, Env) that validates Env, creates coverage tracking, dials gRPC, builds SDK client context, initializes Broadcaster and Suite, discovers services, optionally bootstraps funder uACT, runs Pack subtests in dependency order with availability gating, optionally runs query smoke sweep, enforces coverage assertion. Adds helpers for per-role account funding, tenant signer/address access, deployment sequence generation with height seeding, block wait polling with timeout, latest height/time query via CMT gRPC with block format shape handling.
Query smoke sweep and Pack interface
tests/upgrade/grpcsuite/smoke.go, tests/upgrade/grpcsuite/pack.go
Implements raw-bytes codec for gRPC and querySmokeSweep that deterministically collects and invokes all discovered Query methods with empty-request, classifies responses (Unimplemented/expected-error/success), logs coverage. Defines Pack interface (Name, Available, Run) and ordered pack list for dependency-ordered sequential execution.
Bootstrap and governance proposal helpers
tests/upgrade/grpcsuite/bootstrap.go, tests/upgrade/grpcsuite/gov.go, tests/upgrade/grpcsuite/pack_cosmos_helpers.go
Implements bootstrapFunderUact with oracle module authorization, BME vault seeding via governance, and minting flow with AKT price polling. Implements PassGovProposal with proposal submission, event-based or state-search proposal ID resolution, yes-vote, pass-status polling, and coverage recording per wrapped message. Adds GovAuthority query/caching, proposal iteration/search, bonded validator query/caching, and consensus address derivation from validator pubkey.
Cosmos SDK multi-module test packs
tests/upgrade/grpcsuite/pack_cosmos_*.go
Implements eight module packs: auth (queries and vesting account creation/type verification); authz (grant/execute/revoke with overspend rejection); bank (send/multisend with full query coverage including metadata/supply/denom-owners and NotFound-tolerant metadata errors); distribution (delegation/rewards withdrawal and community-pool governance spending); feegrant (allowance grant/revoke/prune lifecycle with duplicate rejection); governance (v1 weighted-vote proposals and cancel with removal, plus v1beta1 text proposals); miscellaneous (conditional queries per module and upgrade/unjail rejection testing); staking (delegation/validator editing, redelegate with "not found" tolerance, unbond/cancel, pagination, historical info).
Akash module test packs
tests/upgrade/grpcsuite/pack_*.go (Akash modules)
Implements nine Akash-specific packs: cert (create/revoke with malformed/nonexistent/mismatched negatives); provider (create/update/query with pagination/lifecycle negatives and signer world-state publishing); audit (attribute sign/delete/query with signer/auditor mismatch negatives); deployment (SDL-based lifecycle with world-key publishing, pagination, negative close/update/close-group); escrow (deposit/query with invalid-XID negatives); market (order/bid/lease/withdraw/close lifecycle, lease-reclaim rejection, comprehensive negatives); oracle (gov-gated price source and submission with unauthorized/unsupported-denom negatives); BME (vault funding/mint/burn/query with zero-amount rejection and fresh AKT price polling); governance-params (aggregated module parameter re-apply proposal with bank send-enable and gov param special handling).
CosmWasm test pack
tests/upgrade/grpcsuite/pack_cosmwasm.go
Implements code store/instantiate/execute/migrate/admin/label lifecycle, governance proposals for instantiate config and code pin/unpin, combined store+instantiate and store+migrate paths, and comprehensive negative coverage for admin/parameter/sudo operations.
Local full-surface integration test
tests/fullsurface/fullsurface_test.go
Adds TestFullSurfaceGRPC (e2e.integration tag) that parses grpc-suite-mode flag, constructs single-validator test network with gov genesis state intercept (shortened voting/expedited periods, lowered min deposit), waits for target block height, extracts validator gRPC address and repo root, builds grpcsuite.Env with full coverage enforcement and funder/chain parameters, runs grpcsuite.Run.
Post-upgrade universal worker registration and execution
tests/upgrade/grpcsurface_worker_test.go, tests/upgrade/types/types.go, tests/upgrade/upgrade_test.go
Adds grpcSurfaceWorker (e2e.upgrade tag) registered via new RegisterUniversalPostUpgradeWorker API. Worker creates encoding config, loads keyring from testnetify state, constructs grpcsuite.Env with gRPC endpoint, codec, funder, full coverage enforcement, runs grpcsuite.Run. Extends upgrade_test.go to retrieve and execute both named and universal post-upgrade workers; sets postUpgradeParams.GRPC to 127.0.0.1:9090.
Upgrade script async testnetify and state management
script/upgrades.sh
Refactors prepare_state to aggressively reset Cosmovisor state (remove current symlink, delete upgrade-specific upgrade-info.json, re-link to genesis), clean data/ before snapshot extraction and remove upgrade-info.json at top and data/ levels. Adds conditional pre-rollback if upgrade binary exists. Converts testnetify to async background process with timeout polling, early-stop when data/upgrade-info.json appears, kill on timeout/error. Adds post-testnetify rollback with rollback target resolution and final state reset.
Make targets, CI job, rollback command, and docs
make/test-integration.mk, make/test-upgrade.mk, .github/workflows/tests.yaml, cmd/akash/cmd/root.go
Adds three test-grpc-surface Make targets (all/tx/query modes with 30m/30m/10m timeouts). Updates test-reset and prepare-state with snapshot-url and --uto flags. Adds grpc-surface CI job (ubuntu-latest, build-contracts, test-grpc-surface). Registers rollback subcommand in CLI root command.

Sequence Diagram(s)

sequenceDiagram
  participant TestFullSurface as TestFullSurfaceGRPC
  participant Network as testutil.Network
  participant RunFunc as grpcsuite.Run
  participant Discovery as Discovery
  participant Pack as Pack
  participant Broadcaster as Broadcaster
  participant Coverage as Coverage

  TestFullSurface->>Network: New(t, cfg) with gov genesis intercept
  Network-->>TestFullSurface: single validator with GRPCAddress
  TestFullSurface->>RunFunc: Run(ctx, t, Env{gRPC, RequireFullCoverage:true})
  
  RunFunc->>Discovery: discover() via reflection + descriptors
  Discovery-->>RunFunc: inScopeMsgs[], inScopeQueries[]
  
  loop each available Pack in dependency order
    RunFunc->>Pack: Run(Suite)
    activate Pack
    Note over Pack: check Available(Discovery)
    loop transactions to broadcast
      Pack->>Broadcaster: Broadcast(fromName, msgs...)
      Broadcaster-->>Pack: TxResponse (local sign + gRPC broadcast + inclusion poll)
    end
    Note over Pack: query gRPC endpoints per module
    Pack-->>RunFunc: completion
    deactivate Pack
  end
  
  RunFunc->>RunFunc: querySmokeSweep() deterministic query invocation
  RunFunc->>Coverage: AssertCoverage(RunMode)
  Coverage-->>RunFunc: pass/fail based on coverage gaps and strictness
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Poem

🐇 Hoppity-hop through the gRPC maze,
packs lined up neatly, each module ablaze,
Discovery finds what the server will serve,
Coverage tallies each method and verb.
Rollback and testnetify, async at last—
no upgrade escapes the exhaustive test blast! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.42% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'test(grpc-suite): add post-upgrade gRPC surface coverage' clearly and specifically describes the main change—adding gRPC surface coverage tests for post-upgrade scenarios.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the purpose, key components, validation results, and linking to the related issue.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/post-upgrade-grpc-suite

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

🧹 Nitpick comments (2)
tests/upgrade/grpcsuite/pack_cosmos_bank.go (1)

64-65: ⚡ Quick win

Stop swallowing denom-metadata query errors.

These two calls currently bypass assertions, so endpoint regressions can slip through as false positives in this pack. Assert explicit acceptable outcomes (nil and, if intended, NotFound) instead of discarding err.

♻️ Suggested change
-	_, _ = q.DenomMetadata(s.Ctx, &banktypes.QueryDenomMetadataRequest{Denom: s.Env.BondDenom})
-	_, _ = q.DenomMetadataByQueryString(s.Ctx, &banktypes.QueryDenomMetadataByQueryStringRequest{Denom: s.Env.BondDenom})
+	_, err = q.DenomMetadata(s.Ctx, &banktypes.QueryDenomMetadataRequest{Denom: s.Env.BondDenom})
+	require.NoError(s.T, err, "bank DenomMetadata")
+	_, err = q.DenomMetadataByQueryString(s.Ctx, &banktypes.QueryDenomMetadataByQueryStringRequest{Denom: s.Env.BondDenom})
+	require.NoError(s.T, err, "bank DenomMetadataByQueryString")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/upgrade/grpcsuite/pack_cosmos_bank.go` around lines 64 - 65, The
DenomMetadata and DenomMetadataByQueryString method calls in the test are
currently discarding errors by using blank identifiers (_, _), which allows
endpoint regressions to go undetected. Replace the blank error identifiers in
both calls with actual error variables (err1, err2 or similar names), and add
assertions after each call to verify the errors are either nil or NotFound as
appropriate for your test expectations. This ensures that unexpected errors from
these query methods will cause the test to fail rather than silently passing.
tests/upgrade/grpcsuite/pack_audit.go (1)

19-21: ⚡ Quick win

Use the published provider world key instead of hardcoding "provider".

Line 19 validates wProviderSigner, but Line 20 (and auditNegatives) bypasses it. This weakens the cross-pack contract and will break if the provider signer name ever changes.

Suggested patch
 func (auditPack) Run(s *Suite) {
-	require.NotEmpty(s.T, s.World.Get(wProviderSigner), "audit pack needs the provider pack")
-	provider := s.Addr("provider")
+	providerSigner := s.World.Get(wProviderSigner)
+	require.NotEmpty(s.T, providerSigner, "audit pack needs the provider pack")
+	provider := s.Addr(providerSigner)
 	auditor := s.FundAccountDefault("auditor")
@@
-	auditNegatives(s, auditor)
+	auditNegatives(s, provider.String(), auditor)
@@
-func auditNegatives(s *Suite, auditor sdk.AccAddress) {
+func auditNegatives(s *Suite, provider string, auditor sdk.AccAddress) {
 	s.T.Helper()
-	provider := s.Addr("provider").String()

Also applies to: 56-57, 67-70

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/upgrade/grpcsuite/pack_audit.go` around lines 19 - 21, Replace the
hardcoded `"provider"` string with the `wProviderSigner` world key variable in
the `s.Addr()` call on line 20 and in all other similar locations (lines 56-57
and 67-70 referenced in the comment). This ensures consistency with the
validation on line 19 that checks `wProviderSigner` exists, maintaining the
cross-pack contract by using the same published world key throughout instead of
relying on hardcoded strings that could become inconsistent if the provider
signer name changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/tests.yaml:
- Around line 51-58: The grpc-surface job requires security hardening to follow
least-privilege principles. Add a top-level permissions block to the job that
explicitly sets read-only permissions for contents. In the Checkout code step,
pin the actions/checkout@v4 reference to a specific commit SHA instead of using
the floating v4 tag, and add persist-credentials: false as an input parameter to
prevent credential persistence. This ensures the job only has the minimum
required permissions and reduces the attack surface of the CI workflow.

In `@make/test-upgrade.mk`:
- Line 91: The prepare-state target is missing the --snapshot-url parameter in
the upgrades.sh command invocation. Add --snapshot-url=$(SNAPSHOT_URL) to the
script call to ensure it matches the parameter set used elsewhere (such as line
87), preventing the prepare-state target from using an unintended or default
snapshot source when called directly with make prepare-state.

In `@script/upgrades.sh`:
- Around line 534-535: Remove the duplicate rollback command in the upgrades
script. The lines containing
"$rvaldir/cosmovisor/upgrades/$UPGRADE_TO/bin/akash" rollback --home "$rvaldir"
--hard are identical and appear consecutively, so delete one of the two
duplicate lines to ensure only a single rollback operation is performed.

In `@tests/upgrade/grpcsuite/pack_bme.go`:
- Around line 24-38: The bmePack.Run method calls feedAKTPrice(3) which depends
on a pre-created "pricewriter" account from the oracle pack, but this dependency
is implicit and not guaranteed to be initialized before bmePack runs. Add an
explicit dependency on the oracle pack to ensure the required account and oracle
infrastructure are available, or alternatively add a guard or assertion in the
Run method to verify that the required oracle state exists before calling
feedAKTPrice(3).

In `@tests/upgrade/grpcsuite/pack_gov.go`:
- Around line 38-127: Each module parameter query block that checks HasModule
for modules like "akash.deployment.v1beta4", "cosmos.bank.v1beta1", etc.,
currently silently ignores errors by only appending messages when err is nil.
Apply a fail-fast pattern to all these blocks by checking if err is not nil
after each Params query and returning an error instead of continuing silently,
ensuring that if a module is available but the params query fails, the pack
fails appropriately rather than omitting messages and passing incorrectly.

In `@tests/upgrade/grpcsuite/pack_market.go`:
- Line 59: The assertOrdersPaginate method fails to validate actual pagination
behavior because it executes a query but discards both the returned error and
result at lines 137-138. To fix this, modify the assertOrdersPaginate method
implementation to capture the error and result from the query execution instead
of dropping them, then add assertions to verify the pagination behavior is
correct (such as validating the number of items returned, checking limit and
offset parameters are respected, or confirming page boundaries). This will
ensure the pagination check actually validates the expected behavior rather than
always passing.
- Around line 199-205: The q.Orders gRPC call within the for loop is using s.Ctx
instead of the timeout context ctx that was created on the preceding line, which
means the 30 second timeout established by context.WithTimeout is never applied
to the RPC request. Replace s.Ctx with ctx in the q.Orders method call to ensure
the timeout context with its deadline and cancellation is properly used for the
gRPC operation.

In `@tests/upgrade/grpcsuite/smoke.go`:
- Around line 59-64: The smoke test in the invoke section currently only treats
Unimplemented status codes as failures, but other transient gRPC errors like
Unavailable, DeadlineExceeded, and Internal should also be treated as smoke
failures since they indicate handlers weren't reliably reached. Modify the error
handling block after s.Conn.Invoke to check for these additional status codes in
addition to codes.Unimplemented and report each of them as errors using
s.T.Errorf with appropriate error messages for each case.

In `@tests/upgrade/grpcsuite/txbroadcast.go`:
- Around line 143-144: The `waitForTx` function creates a 2-minute timeout
context, but the `LatestHeight()` call within the height polling loop uses the
default context (`s.Ctx`) instead of the timeout-scoped context. This allows
gRPC calls to hang beyond the intended timeout. Modify the code to pass the
timeout-scoped context created in `waitForTx` to the `LatestHeight()` call (or
create a context-aware version of this method that accepts a context parameter).
Apply this fix throughout the polling logic in the loop that starts with `latest
:= b.s.LatestHeight()` and continues through the height iteration range.
- Around line 92-99: The coverage recording for messages is happening before the
sign operation completes. Move the for loop that iterates through msgs and calls
b.s.Cov.recordMsg(sdk.MsgTypeURL(m)) to execute after the b.sign() call
succeeds. Specifically, place this loop after the error check for b.sign() so
that coverage is only recorded when signing actually succeeds, ensuring that the
tx broadcast path is properly exercised before marking it as covered.

---

Nitpick comments:
In `@tests/upgrade/grpcsuite/pack_audit.go`:
- Around line 19-21: Replace the hardcoded `"provider"` string with the
`wProviderSigner` world key variable in the `s.Addr()` call on line 20 and in
all other similar locations (lines 56-57 and 67-70 referenced in the comment).
This ensures consistency with the validation on line 19 that checks
`wProviderSigner` exists, maintaining the cross-pack contract by using the same
published world key throughout instead of relying on hardcoded strings that
could become inconsistent if the provider signer name changes.

In `@tests/upgrade/grpcsuite/pack_cosmos_bank.go`:
- Around line 64-65: The DenomMetadata and DenomMetadataByQueryString method
calls in the test are currently discarding errors by using blank identifiers (_,
_), which allows endpoint regressions to go undetected. Replace the blank error
identifiers in both calls with actual error variables (err1, err2 or similar
names), and add assertions after each call to verify the errors are either nil
or NotFound as appropriate for your test expectations. This ensures that
unexpected errors from these query methods will cause the test to fail rather
than silently passing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: daa2870b-963c-47b6-8274-04ed1e1fe075

📥 Commits

Reviewing files that changed from the base of the PR and between 7e903e6 and 7bad6ff.

📒 Files selected for processing (36)
  • .github/workflows/tests.yaml
  • cmd/akash/cmd/root.go
  • make/test-integration.mk
  • make/test-upgrade.mk
  • script/upgrades.sh
  • tests/fullsurface/fullsurface_test.go
  • tests/upgrade/grpcsuite/README.md
  • tests/upgrade/grpcsuite/bootstrap.go
  • tests/upgrade/grpcsuite/coverage.go
  • tests/upgrade/grpcsuite/env.go
  • tests/upgrade/grpcsuite/gov.go
  • tests/upgrade/grpcsuite/grpcconn.go
  • tests/upgrade/grpcsuite/pack.go
  • tests/upgrade/grpcsuite/pack_audit.go
  • tests/upgrade/grpcsuite/pack_bme.go
  • tests/upgrade/grpcsuite/pack_cert.go
  • tests/upgrade/grpcsuite/pack_cosmos_auth_vesting.go
  • tests/upgrade/grpcsuite/pack_cosmos_authz.go
  • tests/upgrade/grpcsuite/pack_cosmos_bank.go
  • tests/upgrade/grpcsuite/pack_cosmos_distribution.go
  • tests/upgrade/grpcsuite/pack_cosmos_feegrant.go
  • tests/upgrade/grpcsuite/pack_cosmos_gov.go
  • tests/upgrade/grpcsuite/pack_cosmos_helpers.go
  • tests/upgrade/grpcsuite/pack_cosmos_misc.go
  • tests/upgrade/grpcsuite/pack_cosmos_staking.go
  • tests/upgrade/grpcsuite/pack_deployment.go
  • tests/upgrade/grpcsuite/pack_escrow.go
  • tests/upgrade/grpcsuite/pack_gov.go
  • tests/upgrade/grpcsuite/pack_market.go
  • tests/upgrade/grpcsuite/pack_oracle.go
  • tests/upgrade/grpcsuite/pack_provider.go
  • tests/upgrade/grpcsuite/smoke.go
  • tests/upgrade/grpcsuite/txbroadcast.go
  • tests/upgrade/grpcsurface_worker_test.go
  • tests/upgrade/types/types.go
  • tests/upgrade/upgrade_test.go

Comment thread .github/workflows/tests.yaml
Comment thread make/test-upgrade.mk Outdated
Comment thread script/upgrades.sh
Comment thread tests/upgrade/grpcsuite/pack_bme.go
Comment thread tests/upgrade/grpcsuite/pack_gov.go
Comment thread tests/upgrade/grpcsuite/pack_market.go Outdated
Comment thread tests/upgrade/grpcsuite/pack_market.go
Comment thread tests/upgrade/grpcsuite/smoke.go
Comment thread tests/upgrade/grpcsuite/txbroadcast.go
Comment thread tests/upgrade/grpcsuite/txbroadcast.go Outdated
chalabi2 added 2 commits June 19, 2026 09:56
Tighten the post-upgrade gRPC suite around review findings: assert params
and pagination queries, keep tx coverage behind local signability, use bounded
contexts during tx inclusion polling, and document intentional fork rollback
behavior.

Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
Assert acceptable bank metadata query outcomes and route audit provider
lookups through the published provider signer world key.

Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automated post-upgrade gRPC transaction and query test suite

1 participant