-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor CallStack::Synthesize to produce consistent dummy outputs for faster nested import deployments #2598
Open
kpandl
wants to merge
9
commits into
ProvableHQ:staging
Choose a base branch
from
kpandl:optimize_callstack_synthesize
base: staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
NOTE: this PR will also significantly speed up tests using nested deployments, e.g. |
vicsn
requested changes
Jan 21, 2025
vicsn
reviewed
Jan 22, 2025
vicsn
reviewed
Jan 22, 2025
note: the failing |
@d0cd This may be relevant to some of your |
vicsn
reviewed
Jan 26, 2025
vicsn
approved these changes
Jan 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, CI flakiness is unrelated
d0cd
added a commit
that referenced
this pull request
Feb 12, 2025
…ver PR #2598 may allow that to happen
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
This PR refactors the way
CallStack::Synthesize
is run, decoupling theSynthesize
mode from the oldexecute_function
approach. It produces consistent dummy outputs (inspired byCheckDeployment
) more rapidly and skips sub-circuit construction for nested import calls. The result is significantly faster deployments for deeply nested imports, while still generating cryptographically coherent record nonces.Motivation
Previously,
Authorize
andSynthesize
modes were lumped together. As such, calls in CallStack::Synthesize were forced to run a real sub-circuit viaexecute_function
. This is slow for nested imports and has led to an exponential growth in deployment time w.r.t. the import depth.Thus, this PR refactors the
Synthesize
branch to skip full circuit execution and produce “dummy” outputs with consistent record nonces.Security
This PR is not meant to impact any validator operations, because the
CallStack::Synthesize
is only used by provers, not by validators/verifiers.Note
This PR changes expected future IDs in 3 of the
execute_and_finalize
tests. The reason is that previously, Synthesize always ran real sub-circuits, consuming RNG draws. With this PR, certain sub-circuits are skipped by producing dummy outputs. As a result, the RNG is executed less times, leading to different transaction commitments and future IDs.Test Plan
Tested the deployment and execution of programs with deep imports in a local devnet.
Related PRs