Skip to content

enforce deployment limits on beacon blocks - #32

Open
mohammadfawaz wants to merge 5 commits into
mainfrom
enforce-deployment-limits
Open

enforce deployment limits on beacon blocks#32
mohammadfawaz wants to merge 5 commits into
mainfrom
enforce-deployment-limits

Conversation

@mohammadfawaz

@mohammadfawaz mohammadfawaz commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Devnode beacon blocks skip proof verification, but they must enforce deployment limits. snarkVM 4.9.0 does not apply the block-wide spend and synthesis limits to beacon blocks. This can let an invalid deployment enter a development ledger.

This change keeps the released snarkVM 4.9.0 dependency. The devnode calculates and applies the beacon limits before it advances a block. Placeholder proofs and the existing dev_skip_checks behavior stay active.

Changes

  • Apply the beacon spend limit from consensus V16.
  • Apply the beacon synthesis limit from consensus V18.
  • Preserve transaction order when a limit or snarkVM aborts a candidate.
  • Return an error and do not create a block after an automatic-mode abort.
  • In manual mode, remove aborted transactions and keep valid transactions for a retry.

Test Plan

  • Run cargo fmt --all -- --check.
  • Run cargo test --locked.
  • Confirm that all 6 unit tests and all 6 integration tests pass.
  • Confirm that a real deployment cost from snarkVM crosses the beacon spend ceiling and aborts the excess candidate.
  • Confirm that raw snarkVM 4.9.0 accepts deployments that exceed the block synthesis limit.
  • Confirm that the devnode rejects the over-limit deployments.
  • Confirm that a later valid deployment with the same public fee payer stays valid.
  • Confirm that an oversized automatic deployment returns 422 on /v2 and does not change the ledger height.
  • Confirm that manual block creation returns 422, removes the aborted deployment, keeps valid deployments, and permits a successful retry.

Related PRs

@mohammadfawaz mohammadfawaz self-assigned this Aug 4, 2026
@mohammadfawaz
mohammadfawaz marked this pull request as ready for review August 4, 2026 16:48
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.

1 participant