Skip to content

Fix/chunked frostd message - Permitting larger transactions by adding chunking (copied from #195)#196

Merged
jCabala merged 9 commits into
mainfrom
fix/chunked-frostd-message-synced
May 26, 2026
Merged

Fix/chunked frostd message - Permitting larger transactions by adding chunking (copied from #195)#196
jCabala merged 9 commits into
mainfrom
fix/chunked-frostd-message-synced

Conversation

@scaraven
Copy link
Copy Markdown
Member

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.

Acknowledgements

Original pr by @jk89

jk89 and others added 6 commits April 6, 2026 14:01
…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.
Copy link
Copy Markdown
Member

@jCabala jCabala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chunks code seems a bit messy right now. Especially in participant. I think we should move this to a separate function. Also confusedd abotu the gathering logic. Why do we repeat it after loop and within loop.

Comment thread mina-frost-client/src/coordinator/comms/http.rs Outdated
Comment thread mina-frost-client/src/participant/comms/http.rs Outdated
Comment thread mina-frost-client/src/participant/comms/http.rs Outdated
@scaraven scaraven requested a review from jCabala May 26, 2026 09:39
@jCabala jCabala merged commit d996f2f into main May 26, 2026
12 checks passed
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.

3 participants