Skip to content

Feat/synth wasm#1

Open
evanmarshall wants to merge 13 commits into
testnet3from
feat/synth-wasm
Open

Feat/synth wasm#1
evanmarshall wants to merge 13 commits into
testnet3from
feat/synth-wasm

Conversation

@evanmarshall

@evanmarshall evanmarshall commented Feb 7, 2023

Copy link
Copy Markdown

No description provided.

iamalwaysuncomfortable and others added 11 commits January 26, 2023 03:24
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 <mturner@aleo.org>
@evanmarshall

Copy link
Copy Markdown
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.

Comment thread fields/src/macros.rs

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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