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

Masp Batch Deposits #453

Closed
wants to merge 2 commits into from
Closed

Conversation

semaraugusto
Copy link
Contributor

Summary of changes

  • Adds proof generation for the batch deposit functionality on the MASP
  • Adds masp_leaves_handler,
  • Adds masp_proxy_handler

Reference issue to close (if applicable)


Code Checklist

  • Tested
  • Documented

@semaraugusto semaraugusto changed the title Semar/masp batch deposits Masp Batch Deposits Apr 10, 2023
@salman01zp salman01zp changed the base branch from main to develop April 11, 2023 10:21
@salman01zp
Copy link
Contributor

Can you also link SPEC for MASP Relayer Integration to this PR..?

@semaraugusto
Copy link
Contributor Author

base relayer integrations spec: https://www.notion.so/MASP-Relayer-Integration-8d4f6e4c8e124dc1b87bac4766783bd5

batch deposit specific spec: https://www.notion.so/hicommonwealth/Batched-Reward-Tree-Processing-7d51b34188584288af9266e7f2a06542

pub events_watcher: EventsWatcherConfig,
/// The type of the optional signing backend used for signing proposals. It can be None for pure Tx relayers
#[serde(rename(serialize = "proposalSigningBackend"))]
pub proposal_signing_backend: Option<ProposalSigningBackendConfig>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed or used anywhere on the proxy config? I recommend starting with only the things we use so these objects don't get clogged.

let wasm_path = "../../tests/solidity-fixtures/batch-tree/4/batchMerkleTreeUpdate_4.wasm";
let prover = MaspBatchProver::new(zkey_path, wasm_path);

// pre-generated inputs
Copy link
Contributor

Choose a reason for hiding this comment

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

Please instruct how to generate these pre-generated inputs too. All pre-generated fixture tests should be reproducible from the first step.

let is_known_root =
wrapper.contract.is_known_root(root).call().await?;
tracing::trace!("Is known root: {:?}", is_known_root);
if event_data.leaf_index.as_u32() % 2 == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are requiring the local MT for the relayer to be in sync, wouldn't this prevent that if the leaf index is even? Should this be removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this function copied from the VAnchor leaf watcher? If so, are we duplicating code that can otherwise be consolidated?

@@ -0,0 +1,122 @@
use ark_bn254::{Bn254, Fr};
Copy link
Contributor

Choose a reason for hiding this comment

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

Thoughts on moving files like these into a separate crate? Something dedicated to all our proof generation needs?

@shekohex shekohex deleted the semar/masp-batch-deposits branch May 11, 2023 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants