Skip to content

sdk: expose the verifier authority in the TypeScript and Python GlobalState deserializers - #4231

Open
elitegreg wants to merge 1 commit into
mainfrom
gm/sdk-globalstate-ip-verifier
Open

sdk: expose the verifier authority in the TypeScript and Python GlobalState deserializers#4231
elitegreg wants to merge 1 commit into
mainfrom
gm/sdk-globalstate-ip-verifier

Conversation

@elitegreg

Copy link
Copy Markdown
Contributor

Closes #4203. Part of RFC-27 (rfcs/rfc27-ip-verification.md, tracker #4194). Depends on #4196.

Summary

  • GlobalState gained ip_verifier_authority_pk, the RFC-27 trust root for IP ownership proof validation. The TypeScript and Python GlobalState deserializers now carry it.
  • The field is appended, so account data written before the upgrade simply ends after feed_authority_pk. Both SDKs already run a defensive reader that yields the default pubkey for a short buffer rather than raising — the same way each handles feed_authority_pk — so pre-upgrade accounts keep decoding.

The Go SDK, the Rust state, and the fixture generator already landed with #4196; make generate-fixtures produces no diff on this branch, so global_state.bin/.json are unchanged here.

Testing Verification

  • The GlobalState fixture assertion in both SDKs now covers IpVerifierAuthorityPk, so the golden pins the field's position and encoding, not just its presence.
  • A new test per SDK truncates the fixture by the trailing 32 bytes — a pre-RFC-27 account — and asserts the verifier authority decodes to the default pubkey while feed_authority_pk still decodes to its real value, so the truncation is proven to have landed where it was meant to.
  • make sdk-test green across Go, TypeScript, and Python.

@elitegreg
elitegreg force-pushed the gm/ip-proof-cli-connect branch from e4bcc1c to d357846 Compare August 27, 2026 18:02
Base automatically changed from gm/ip-proof-cli-connect to main August 27, 2026 19:53
…lState deserializers

GlobalState gained ip_verifier_authority_pk (RFC-27), so the SDKs that
deserialize it need the new trailing field. Go already carries it.

The field is appended, so account data written before the upgrade stops after
feed_authority_pk; both defensive readers already yield the default pubkey for
a short buffer rather than raising, which is what "no verifier configured"
means everywhere else. A test per SDK pins that.
@elitegreg
elitegreg force-pushed the gm/sdk-globalstate-ip-verifier branch from 8f1e0c2 to a5824eb Compare August 27, 2026 21:23
@elitegreg
elitegreg marked this pull request as ready for review August 27, 2026 21:23
@elitegreg
elitegreg requested review from a team and a lite review from Copilot August 27, 2026 21:23

Copilot AI 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.

Pull request overview

This PR updates the sdk/serviceability TypeScript and Python SDKs to expose the new GlobalState.ip_verifier_authority_pk field (RFC-27 trust root) and adds fixture-based tests that verify both the new field and pre-upgrade decoding behavior for truncated account data.

Changes:

  • Add ipVerifierAuthorityPk / ip_verifier_authority_pk to the TypeScript and Python GlobalState deserializers.
  • Extend the GlobalState golden fixture assertions in both SDKs to include the new field.
  • Add a new per-SDK test that truncates the last 32 bytes and asserts the verifier authority decodes to the default pubkey while feed_authority_pk still decodes correctly.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
sdk/serviceability/typescript/serviceability/state.ts Add ipVerifierAuthorityPk to GlobalState and read it after feedAuthorityPk.
sdk/serviceability/typescript/serviceability/tests/fixtures.test.ts Assert the new fixture field and add a pre-RFC-27 truncation decode test.
sdk/serviceability/python/serviceability/state.py Add ip_verifier_authority_pk to GlobalState and read it after feed_authority_pk.
sdk/serviceability/python/serviceability/tests/test_fixtures.py Assert the new fixture field and add a pre-RFC-27 truncation decode test.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

"SentinelAuthorityPk": gs.sentinel_authority_pk,
"HealthOraclePk": gs.health_oracle_pk,
"FeedAuthorityPk": gs.feed_authority_pk,
"IpVerifierAuthorityPk": gs.ip_verifier_authority_pk,
SentinelAuthorityPk: gs.sentinelAuthorityPk,
HealthOraclePk: gs.healthOraclePk,
FeedAuthorityPk: gs.feedAuthorityPk,
IpVerifierAuthorityPk: gs.ipVerifierAuthorityPk,
gs.feed_authority_pk = _read_pubkey(r)
# Appended after feed_authority_pk: account data written before RFC-27 stops here, and
# the defensive reader yields the default pubkey rather than raising.
gs.ip_verifier_authority_pk = _read_pubkey(r)

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 CHANGELOG.md entry for this SDK change. The Unreleased section has an SDK bullet list, and the comparable prior PR that added Feed/EdgeSeat read support to the Go, Python and TypeScript deserializers (#3956) added one. The existing RFC-27 entries cover the onchain side (#4196) and the Rust SDK command (#4200), and #4207's Serviceability bullet says nothing about the SDK readers, so as it stands the release notes will never mention that TypeScript and Python consumers can read ip_verifier_authority_pk. Consider adding an SDK bullet under Unreleased.

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.

sdk: expose the verifier authority in the Go/TypeScript/Python GlobalState deserializers

3 participants