Match mainnet response shapes in the RPC - #74
Open
fnordspace wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.