Check which CosmWasm code IDs are pinned

A slow contract call sometimes prompts a question about pinning. The wasm module exposes a list of code IDs marked for pinning, separate from the list of uploaded code.

Compare the instance code ID with the pinned set

Use a wasmd TLS gRPC endpoint with reflection. First obtain the instance’s current code ID from ContractInfo, then inspect PinnedCodes. Follow pagination before declaring an ID absent.

grpcurl -d '{"pagination":{"limit":"100"}}' "$GRPC" cosmwasm.wasm.v1.Query/PinnedCodes

If ContractInfo reports code 31 while the complete pinned list contains 7 and 19, that instance’s current code is not marked pinned. Other instances using 31 share the same code classification.

Measure performance independently

Pinning concerns code caching. The response does not measure current request latency, storage access cost or CPU pressure on a particular RPC server. Compare timings for the same smart query and state before assigning a performance regression to cache policy. github.com wasmd Query API