Skip to content

max cost zkapp tx generator fixes#18734

Open
martyall wants to merge 2 commits intodevelopfrom
martyall/max-tx-generator-fixes
Open

max cost zkapp tx generator fixes#18734
martyall wants to merge 2 commits intodevelopfrom
martyall/max-tx-generator-fixes

Conversation

@martyall
Copy link
Copy Markdown
Member

@martyall martyall commented Apr 7, 2026

fixes #18730

The test_submit_to_archive --max-cost tool was generating structurally correct but completely fake max-cost zkapp transactions. The account updates claimed to have Proof authorization but carried dummy proofs that would never verify. The deployed zkapp accounts had random VKs from a quickcheck generator, while the max-cost transactions referenced a dummy VK. TLDR, even if the proofs were real, the VKs wouldn't match. The whole thing only worked because staged ledger verification was fully skipped when building blocks.

We fixed this by

  • using create_trivial_snapp to get a real VK and prover, running replace_authorizations to generate real proofs for each account update, and changing skip_staged_ledger_verification from All to Proofs so blocks are actually validated
  • added a --verify flag that calls Pickles.Side_loaded.verify on the proof triples
  • added a Buildkite CI job to run this on PRs and nightlies.

@github-project-automation github-project-automation bot moved this to To triage in Mesa Triage Apr 7, 2026
@martyall martyall changed the base branch from compatible to develop April 7, 2026 04:17
@martyall
Copy link
Copy Markdown
Member Author

martyall commented Apr 7, 2026

!ci-build-me

@martyall martyall force-pushed the martyall/max-tx-generator-fixes branch from 3195374 to 5fc1159 Compare April 7, 2026 06:45
@martyall
Copy link
Copy Markdown
Member Author

martyall commented Apr 7, 2026

!ci-build-me

@martyall martyall requested review from dkijania, georgeee and glyh April 7, 2026 08:13
@martyall martyall marked this pull request as ready for review April 7, 2026 08:14
>>| Or_error.ok_exn )
else return ()
in
let (`If_this_is_used_it_should_have_a_comment_justifying_it valid_command) =
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we add back (* This is used in the context of a test, and we know that the command is valid *) here?

let zkapp_cmd =
Quickcheck.Generator.generate
(Mina_generators.Zkapp_command_generators.gen_max_cost_zkapp_command_from
~n_updates:15
Copy link
Copy Markdown
Member

@glyh glyh Apr 9, 2026

Choose a reason for hiding this comment

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

Again, could we derive these values from node config?

~size:1
~random:(Splittable_random.State.create Random.State.default)
in
Ref.replace nonce_ref Unsigned.UInt32.succ ;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we not need to update account_state_tbl here? Also maybe lift advance_nonce to top level so it's reusable both here and in generate_txs?

in
advance_nonce () ; res
in
let (`If_this_is_used_it_should_have_a_comment_justifying_it
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add a comment here?

~key:(Signature_lib.Public_key.compress kp.Keypair.public_key)
~data:kp.Keypair.private_key )
in
Deferred.List.map rest_txs ~f:(fun block_txs ->
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The semantic changed a bit, we used to gnerate n_payments payments with n_zkapp_txs max-cost zkapp txns if max cost is set.

Now we're generating n_payments payments with n_zkapp_txs regular zkapp txs and a single max cost zkapp txn.

Is this expected? If so, could you explain a bit?

Copy link
Copy Markdown
Member

@glyh glyh left a comment

Choose a reason for hiding this comment

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

Left some comments and questions, sorry for the delay

@glyh
Copy link
Copy Markdown
Member

glyh commented Apr 9, 2026

Just a note: it doesn't fix #18730, but still it's nice to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

Max-cost zkApp transactions failing due to proof verification issues

2 participants