Skip to content

Match mainnet response shapes in the RPC - #74

Open
fnordspace wants to merge 1 commit into
mainfrom
bugfix/2026-08-25-rpc-mainnet-response-parity
Open

Match mainnet response shapes in the RPC#74
fnordspace wants to merge 1 commit into
mainfrom
bugfix/2026-08-25-rpc-mainnet-response-parity

Conversation

@fnordspace

Copy link
Copy Markdown
Contributor

core-lite is used to develop against, so a client that works on a Lite node must work unchanged on mainnet. Several endpoints returned different JSON, which fails silently: a client reading tickInfo.epoch got undefined, not a 404.

Shapes, per qubic-http protobuff/qubic.proto:

  • tick-info/block-height: nest the full TickInfo under its own wrapper key.
  • assets/issuances: tick/universeIndex per element, not once at top level.
  • assets/:identity/owned|possessed: add "padding" and the possession's issuanceIndex. The universe-index routes keep ownershipIndex and no padding.
  • errors: HTTP 4xx/5xx with {code,message,details}, not HTTP 200.

64-bit ints serialize as strings in protobuf JSON, as mainnet returns them: transaction "amount", latest-stats "circulatingSupply" and "burnedQus".

getTickData: drop the zero fees from the [1024]int64 contractFees array, as go-archiver's contractFeesToProto() does, instead of sending ~10KB of zeros per tick. Rename "timelock"/"transactionDigests" to the "timeLock"/ "transactionHashes" mainnet uses; the bundled explorer is updated to match.

Also fixes an out-of-bounds read: issuanceToJson walked unitOfMeasurement, a char[7], with i < 8.

Dev-only and core-lite-only stats routes have no mainnet counterpart and are unchanged. Still not identical: tick-info adds alignedVotes/misalignedVotes/ mainAuxStatus, and /health, /ipos/{index}/bids, POST /assets are missing.

core-lite is used to develop against, so a client that works on a Lite node
must work unchanged on mainnet. Several endpoints returned different JSON,
which fails silently: a client reading tickInfo.epoch got undefined, not a 404.

Shapes, per qubic-http protobuff/qubic.proto:
- tick-info/block-height: nest the full TickInfo under its own wrapper key.
- assets/issuances: tick/universeIndex per element, not once at top level.
- assets/:identity/owned|possessed: add "padding" and the possession's
  issuanceIndex. The universe-index routes keep ownershipIndex and no padding.
- errors: HTTP 4xx/5xx with {code,message,details}, not HTTP 200.

64-bit ints serialize as strings in protobuf JSON, as mainnet returns them:
transaction "amount", latest-stats "circulatingSupply" and "burnedQus".

getTickData: drop the zero fees from the [1024]int64 contractFees array, as
go-archiver's contractFeesToProto() does, instead of sending ~10KB of zeros
per tick. Rename "timelock"/"transactionDigests" to the "timeLock"/
"transactionHashes" mainnet uses; the bundled explorer is updated to match.

Also fixes an out-of-bounds read: issuanceToJson walked unitOfMeasurement,
a char[7], with i < 8.

Dev-only and core-lite-only stats routes have no mainnet counterpart and are
unchanged. Still not identical: tick-info adds alignedVotes/misalignedVotes/
mainAuxStatus, and /health, /ipos/{index}/bids, POST /assets are missing.
@fnordspace
fnordspace requested a review from hackerby888 August 26, 2026 11:54
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