Fix/accept signed transaction as input#191
Closed
jk89 wants to merge 4 commits intoRaspberry-Devs:mainfrom
Closed
Conversation
…o parse when set to JSON strings as produced by o1js, because the derived serde on Vec<u8> expects a JSON byte array instead. Added test for the real deploy-v0.0.4-unsigned.json fixture which fails to parse due to the zkappUri string field, a minimal reproduction for zkappUri as a string, a test proving the incorrect 32-character ZkappUri length limit rejects real URLs, and a minimal reproduction for tokenSymbol as a string. All four tests currently fail documenting the limitation.
…ol to accept JSON strings as produced by o1js, removed the incorrect 32-character ZkappUri length limit, and fixed from_str_network to surface actual serde errors instead of swallowing them. Resolves all four failing tests from the previous commit.
…TransactionSignature as input, only raw unsigned ZkApp or Legacy transaction JSON. This means the output of one FROST signing session cannot be fed as input to a subsequent signing session, preventing chained multi-group signing of the same transaction. The test uses a real signed fixture from a deploy-v0.0.6 ceremony and currently fails documenting the limitation.
…FROST signing session) as input to from_str_network, enabling chained multi-group signing where the output of one signing session is fed directly as input to the next. The parser now tries TransactionSignature first and extracts the inner payload which already contains the previous groups injected signature, then falls back to the existing ZkApp and Legacy parsing. Resolves the failing test from the previous commit.
Member
|
Thanks for the PR, I've duplicated the pr to fix the CI errors in #193. |
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
The transaction parser only accepts raw unsigned ZkApp or Legacy transaction JSON. When a FROST signing session completes, it outputs a TransactionSignature wrapper containing the signed payload. This wrapper cannot be fed as input to a subsequent signing session, which prevents chained multi-group signing where one group signs first and the output is passed to the next group.
This PR adds TransactionSignature as a recognized input format. The parser tries it first, extracts the inner payload (which already contains the previous group's injected signature), then falls back to the existing ZkApp and Legacy parsing.
Depends on #190 (serde fix for ZkappUri/TokenSymbol) — the signed fixture contains string-valued zkappUri and tokenSymbol fields which require that fix to deserialize.
Structure
This PR contains two commits designed to be reviewed in sequence:
addf641test: Adds a failing test using a real admin-group-signed deploy-v0.0.6 fixture, proving the parser rejects TransactionSignature input. Checkout this commit and runcargo test -p mina-tx --libto see the failure.d26b83afix: Adds TransactionSignature parsing tofrom_str_network, trying it before ZkApp and Legacy. Checkout this commit and runcargo test -p mina-tx --libto see all tests pass.