device/telemetry: lower batch size to be within transaction size limit#882
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR reduces the device telemetry batch size from 2560 to 245 samples to comply with Solana's transaction size limits based on IPv6 MTU constraints. The change ensures transactions stay within the 1232-byte packet data limit after accounting for headers.
- Updated MaxSamplesPerBatch constant from a calculated value based on data increase limits to a hardcoded 245 samples (980 bytes)
- Added comprehensive e2e tests to verify the new batch limit works and exceeding it fails appropriately
- Updated existing unit tests to reflect the new batch size calculations
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| smartcontract/sdk/go/telemetry/constants.go | Updated MaxSamplesPerBatch constant and added detailed documentation explaining the IPv6 MTU size constraint |
| e2e/sdk_telemetry_test.go | Added e2e tests for maximum batch size and over-limit failure scenarios |
| controlplane/telemetry/internal/telemetry/submitter_test.go | Updated test assertions to match new batch size calculations |
ff5b9c7 to
522b42c
Compare
522b42c to
4561217
Compare
packethog
approved these changes
Jul 22, 2025
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 of Changes
Update the device telemetry samples submission batch size to be 245 (980 bytes) so that it's within the Solana transaction size limit
After some testing, it looks like we can include at most 245 samples in our transactions. This makes sense because https://docs.anza.xyz/proposals/versioned-transactions#problem
Fixes device/telemetry: failing with transaction too large after running out of funds #876
Testing Verification