Skip to content

sdk: expose prorated fields on shreds ClientSeat#3684

Merged
snormore merged 3 commits intomainfrom
snor/shreds-sdk-prorated-fields
May 8, 2026
Merged

sdk: expose prorated fields on shreds ClientSeat#3684
snormore merged 3 commits intomainfrom
snor/shreds-sdk-prorated-fields

Conversation

@snormore
Copy link
Copy Markdown
Contributor

@snormore snormore commented May 8, 2026

Summary

  • Splits the trailing 26-byte padding in the Go ClientSeat into the actual on-chain fields: SubscriptionStartSlot (u64) and LastUSDCPriceDollars (u16), with the surrounding 2-byte and 14-byte sub-paddings preserved as Padding1 / Padding2.
  • These fields were added to the Rust onchain ClientSeat as part of the prorated service work (Add tests to verify route withdrawal on session down events #243, Correct spelling of DoubleZero in cli help #258, fix: solve doublezero tunnel list bug #293) but the Go binding was never regenerated to expose them.
  • Consumers like the lake indexer need them to compute prorated USDC charges per epoch (start_slot lets us figure out what fraction of the epoch a seat was active, and last_usdc_price_dollars is the price actually charged at allocation time, which is immune to later override changes).

The total struct size is unchanged (232 bytes) so the existing struct-size test and any byte-layout consumers continue to work; this is purely a refactor of the trailing padding into named fields.

Testing Verification

  • go test ./sdk/shreds/go/... passes, including the existing struct-size test and the updated TestClientSeatDeserialization which now asserts the new fields deserialize at offsets 144 and 152.

snormore added 3 commits May 8, 2026 08:14
Split the trailing 26-byte padding in the Go ClientSeat into the actual
on-chain fields: SubscriptionStartSlot (u64) and LastUSDCPriceDollars
(u16). These were added to the Rust onchain state in the prorated
service work and consumers (e.g. lake indexer) need them to compute
prorated charges per epoch.
The other fields on the struct have no per-field doc comments and the
canonical descriptions live on the Rust source. The Go names are
self-explanatory.
@snormore snormore force-pushed the snor/shreds-sdk-prorated-fields branch from 8913a39 to 01a5b4c Compare May 8, 2026 12:14
@snormore snormore marked this pull request as ready for review May 8, 2026 13:34
@snormore snormore merged commit 334398d into main May 8, 2026
33 checks passed
@snormore snormore deleted the snor/shreds-sdk-prorated-fields branch May 8, 2026 13:58
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.

2 participants