Skip to content
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

Open
wants to merge 13 commits into
base: testnet3
Choose a base branch
from
Open

Feat/synth wasm #1

wants to merge 13 commits into from

Conversation

evanmarshall
Copy link

@evanmarshall evanmarshall commented Feb 7, 2023

No description provided.

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]>
@evanmarshall
Copy link
Author

All the file renames in the resources were to ensure that none of them were accidentally being used when running the rust test and definitely should be reverted.

@@ -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);
Copy link
Author

Choose a reason for hiding this comment

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

Super weird bug here. It deserializes differently from the wasm vs the rust test. Not sure why yet, maybe some deserialization reordering. This happens when deserializing the transfer prover file.

This is the bug preventing it from working.

Screenshot 2023-02-06 at 10 32 06 PM

Screenshot 2023-02-06 at 10 32 39 PM

Screenshot 2023-02-06 at 10 33 16 PM

include_bytes!("./resources/block.genesis")
}
}
// impl GenesisBytes {
Copy link
Author

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" {
Copy link
Author

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>>> = {
Copy link
Author

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> {
Copy link
Author

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.

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.

2 participants