sdk: expose the verifier authority in the TypeScript and Python GlobalState deserializers - #4231
sdk: expose the verifier authority in the TypeScript and Python GlobalState deserializers#4231elitegreg wants to merge 1 commit into
Conversation
e4bcc1c to
d357846
Compare
…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.
8f1e0c2 to
a5824eb
Compare
There was a problem hiding this comment.
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_pkto the TypeScript and PythonGlobalStatedeserializers. - Extend the
GlobalStategolden 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_pkstill 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) |
There was a problem hiding this comment.
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.
Closes #4203. Part of RFC-27 (
rfcs/rfc27-ip-verification.md, tracker #4194). Depends on #4196.Summary
GlobalStategainedip_verifier_authority_pk, the RFC-27 trust root for IP ownership proof validation. The TypeScript and PythonGlobalStatedeserializers now carry it.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 handlesfeed_authority_pk— so pre-upgrade accounts keep decoding.The Go SDK, the Rust state, and the fixture generator already landed with #4196;
make generate-fixturesproduces no diff on this branch, soglobal_state.bin/.jsonare unchanged here.Testing Verification
GlobalStatefixture assertion in both SDKs now coversIpVerifierAuthorityPk, so the golden pins the field's position and encoding, not just its presence.feed_authority_pkstill decodes to its real value, so the truncation is proven to have landed where it was meant to.make sdk-testgreen across Go, TypeScript, and Python.