Skip to content

Fix/chunked frostd message - Permitting larger transactions by adding chunking#195

Closed
jk89 wants to merge 3 commits into
Raspberry-Devs:mainfrom
Nori-zk:fix/chunked-frostd-message-synced
Closed

Fix/chunked frostd message - Permitting larger transactions by adding chunking#195
jk89 wants to merge 3 commits into
Raspberry-Devs:mainfrom
Nori-zk:fix/chunked-frostd-message-synced

Conversation

@jk89
Copy link
Copy Markdown
Contributor

@jk89 jk89 commented May 21, 2026

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.

jk89 added 3 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.
@scaraven
Copy link
Copy Markdown
Member

Copy with fixes opened in #196

@scaraven scaraven closed this May 22, 2026
jCabala added a commit that referenced this pull request May 26, 2026
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