-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat/synth wasm #1
base: testnet3
Are you sure you want to change the base?
Conversation
…in a WASM context
This reverts the attempt to use the inclusion query object to pass in outside data from a WASM context. The reasoning behind this is that it's difficult to know ahead of time which commitments will be needed to build the proof. It is likely for full WASM support, a different set of composing functions will be needed.
Signed-off-by: Mike Turner <[email protected]>
All the file renames in the |
@@ -273,6 +274,10 @@ macro_rules! impl_primefield_serializer { | |||
|
|||
let mut masked_bytes = [0; $byte_size + 1]; | |||
reader.read_exact(&mut masked_bytes[..output_byte_size])?; | |||
let formatted_string = format!("{:?} , {}", masked_bytes, output_byte_size); |
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.
include_bytes!("./resources/block.genesis") | ||
} | ||
} | ||
// impl GenesisBytes { |
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.
Just testing the limits of how much I could remove before things break. This isn't necessary for the client.
|
||
// Synthesize the 'credits.aleo' circuit keys. | ||
for function_name in program.functions().keys() { | ||
if function_name.to_string() == "transfer" { |
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.
I imagine we can expose interfaces here to support arbitrary programs & arbitrary functions on those programs. For most applications, users shouldn't need most prover files ie the credits mint file which is only used on the genesis block.
use std::sync::Mutex; | ||
|
||
lazy_static! { | ||
pub static ref PARAMETER_PROVIDER: Mutex<IndexMap<String, Vec<u8>>> = { |
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.
This is the heart of the change. We now have a PARAMETER_PROVIDER
exposed to the WASM so it can upload files as necessary. We initialize empty Vecs for the rest of the.
pub struct $name; | ||
|
||
impl $name { | ||
pub fn load_bytes() -> Result<Vec<u8>, $crate::errors::ParameterError> { |
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.
Here's how we load those bytes.
c7b1d6d
to
7e1757b
Compare
No description provided.