Skip to content

Register historical nested pulsar types for tx queries - #985

Closed
zale144 wants to merge 2 commits into
release-v0.17.1from
alek/fix-v9-inputworker-gogo-registry
Closed

Register historical nested pulsar types for tx queries#985
zale144 wants to merge 2 commits into
release-v0.17.1from
alek/fix-v9-inputworker-gogo-registry

Conversation

@zale144

@zale144 zale144 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • After the v10 proto bump, /cosmos/tx/v1beta1/txs failed to decode pre-upgrade payloads: unknownproto looks up nested (non-Any) fields in the gogo registry, but x/emissions/types now registers those names as emissions.v10.*.
  • Register the existing pulsar nested types under their historical names (emissions v2–v9 worker/reputer/params graphs, plus mint.v1beta1.Params). These are distinct Go types from the live gogo structs, so new txs still encode as v10 / mint v5.
  • Based on v0.17.1 (release-v0.17.1).

Test plan

  • go test ./x/emissions/api/emissions/v2/ ./x/emissions/api/emissions/v3/ ./x/emissions/api/emissions/v9/ ./x/mint/api/mint/v1beta1/
  • Local in-place-testnet from a mainnet snapshot: GET /cosmos/tx/v1beta1/txs?query=tx.height=... returns worker txs instead of the parse error

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Architecture diagram
sequenceDiagram
    participant App as Allora Chain Application
    participant Registry as gogoproto Global Registry
    participant Client as Client (REST/gRPC)
    participant SDK as Cosmos SDK Tx Service
    participant UnknownProto as unknownproto Utility
    participant DB as State DB / Indexer

    Note over App, Registry: Application Startup
    App->>Registry: NEW: init() registers emissions.v9.* types
    App->>Registry: Register emissions.v10.* types (Current)

    Note over Client, DB: Runtime: Historical TX Query Flow
    Client->>SDK: GET /cosmos/tx/v1beta1/txs (Historical Height)
    SDK->>DB: Fetch raw Protobuf bytes
    DB-->>SDK: v9 encoded transaction bytes

    SDK->>UnknownProto: RejectUnknownFieldsStrict(bytes, v9Type)
    
    loop For each nested field in payload
        UnknownProto->>Registry: CHANGED: MessageType("emissions.v9.InputWorkerDataBundle")
        alt Type found in registry
            Registry-->>UnknownProto: Return v9 Go type definition
            UnknownProto->>UnknownProto: Continue recursive walk
        else Type missing (Pre-PR Failure)
            Registry-->>UnknownProto: nil
            UnknownProto-->>SDK: Error: "failed to retrieve message of type..."
        end
    end

    alt Walk Successful
        UnknownProto-->>SDK: Validation passed
        SDK-->>Client: 200 OK (Decoded JSON Response)
    else Validation Failed
        SDK-->>Client: 500 Internal Server Error
    end

    Note over Client, Registry: Runtime: New TX Flow
    Client->>SDK: Broadcast v10 Transaction
    SDK->>Registry: MessageName(v10StructInstance)
    Registry-->>SDK: "emissions.v10.InputWorkerDataBundle"
    Note over SDK: Encodes using latest v10 schema (Unchanged)
Loading

Re-trigger cubic

zale144 and others added 2 commits August 21, 2026 19:14
After the v10 proto bump, unknownproto could not resolve
emissions.v9.InputWorkerDataBundle (and OptionalParams) when decoding
pre-upgrade txs, because only the v10 gogo names were registered.

Co-authored-by: Cursor <cursoragent@cursor.com>
…eries.

Co-authored-by: Cursor <cursoragent@cursor.com>
@zale144
zale144 force-pushed the alek/fix-v9-inputworker-gogo-registry branch from 08da511 to 8a8f164 Compare August 21, 2026 17:14
@zale144 zale144 changed the title Register v9 nested pulsar types for historical tx queries Register historical nested pulsar types for tx queries Aug 21, 2026
@zale144
zale144 changed the base branch from release-v0.17.0 to release-v0.17.1 August 21, 2026 17:14
@zale144

zale144 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

closing in favor of #986

@zale144 zale144 closed this Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant