-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Feature] Enable safe external loading of inclusion prover for wasm
targets
#2814
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
Draft
iamalwaysuncomfortable
wants to merge
27
commits into
staging
Choose a base branch
from
feat/load-inclusion-external-wasm
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.
Draft
[Feature] Enable safe external loading of inclusion prover for wasm
targets
#2814
iamalwaysuncomfortable
wants to merge
27
commits into
staging
from
feat/load-inclusion-external-wasm
Conversation
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
Co-authored-by: Michael Benfield <michaelbenfield@provable.com> Signed-off-by: vicsn <victor.s.nicolaas@protonmail.com>
…ram_edition Fail loudly when using the wrong program or record version
f5a809f
to
faad02d
Compare
Ureq default features to enable tls
Mainnet pre-release merge v4.0.0
[Release] Mainnet 4.0.0
… compiling with the wasm feature flag
336ca7b
to
dcaefc1
Compare
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.
Motivation
SnarkVM process stores the inclusion prover and verifier in static location in memory. It is initialized via
load_bytes
method defined by theimpl_remote!
macro in theparameters
and lazily loaded into a static location the first time theinclusion_proving_key
is called. If trying to build a transaction offline using a SnarkVM process running in userspace, this will first check if the inclusion prover is located at a specific location on disk, otherwise it will attempt to download it from the internet.As a matter of security, wasm runtimes run in a sandboxed environment and generally do not have access to their host machine's file system directly. Thus, the normal approach of checking the local filesystem is not available, and the sole option for initializing the inclusion prover is download it.
If desiring to build a transaction on an offline machine that is using a
wasm
binary, the inclusion prover is unable to be loaded and offline transaction building will fail. This effectively means offline transaction creation is not available in a javascript environment. Many offline wallets, custodians, and other developers generally desire to write their applications innode.js
and thus are currently blocked from doing so.This PR introduces an option to insert the inclusion prover bytes from an external source, and verify that the checksum and byte buffer length match the expected values for the inclusion prover, allowing safe external insertion of the inclusion prover.
Test Plan
Add tests that ensure
Steps Before Marking PR as Ready for Review
staging
branch (this was branched from v3.8.0 tag in order to provide the SDK the ability to test offline transaction building against the latest stablemainnet
tag)