sdk: expose prorated fields on shreds ClientSeat#3684
Merged
Conversation
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.
8913a39 to
01a5b4c
Compare
martinsander00
approved these changes
May 8, 2026
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.
Summary
ClientSeatinto the actual on-chain fields:SubscriptionStartSlot(u64) andLastUSDCPriceDollars(u16), with the surrounding 2-byte and 14-byte sub-paddings preserved asPadding1/Padding2.ClientSeatas 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.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 updatedTestClientSeatDeserializationwhich now asserts the new fields deserialize at offsets 144 and 152.