Fix/chunked frostd message - Permitting larger transactions by adding chunking#195
Closed
jk89 wants to merge 3 commits into
Closed
Fix/chunked frostd message - Permitting larger transactions by adding chunking#195jk89 wants to merge 3 commits into
jk89 wants to merge 3 commits into
Conversation
…oth the cipher and coordinator comms level. Small transactions like payment-zkapp serialize, encrypt, and fit within frostds 65535-byte message limit. Large transactions like deploy-v0.0.4 with verification keys produce a serialized SigningPackage of 92KB which exceeds both the Noise protocol frame limit and frostds message size limit because frost-core hex-encodes the message bytes roughly doubling the payload size.
…ting the large deploy-v0.0.4 signing package into chunks, encrypting each chunk separately, decrypting and reassembling on the other side produces the original payload with each chunk fitting within frostds MAX_MSG_SIZE limit. This demonstrates the strategy for the fix.
…on keys) exceeded frostds 65535-byte message limit after JSON serialization hex-encoded the transaction bytes from 46KB to 92KB. The coordinator now chunks the serialized payload so each encrypted chunk fits in a single frostd message, sending a 4-byte chunk count header first followed by N encrypted chunks per recipient. The participant collects the expected number of chunks across polling cycles, decrypts each in order, and reassembles the original payload before deserializing. Cipher is unchanged, chunking lives entirely in the coordinator and participant HTTP comms layer.
Member
|
Copy with fixes opened in #196 |
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.
test: Added missing test coverage for signing package encryption at both the cipher and coordinator comms level. Small transactions like payment-zkapp serialize, encrypt, and fit within frostds 65535-byte message limit. Large transactions like deploy-v0.0.4 with verification keys produce a serialized SigningPackage of 92KB which exceeds both the Noise protocol frame limit and frostds message size limit because frost-core hex-encodes the message bytes roughly doubling the payload size.
test: Added chunked encrypt-decrypt roundtrip test proving that splitting the large deploy-v0.0.4 signing package into chunks, encrypting each chunk separately, decrypting and reassembling on the other side produces the original payload with each chunk fitting within frostds MAX_MSG_SIZE limit. This demonstrates the strategy for the fix.
fix: Large signing packages (e.g. deploy transactions with verification keys) exceeded frostds 65535-byte message limit after JSON serialization hex-encoded the transaction bytes from 46KB to 92KB. The coordinator now chunks the serialized payload so each encrypted chunk fits in a single frostd message, sending a 4-byte chunk count header first followed by N encrypted chunks per recipient. The participant collects the expected number of chunks across polling cycles, decrypts each in order, and reassembles the original payload before deserializing. Cipher is unchanged, chunking lives entirely in the coordinator and participant HTTP comms layer.