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(messaging): public cross chain message e2e #841

Merged
merged 14 commits into from
Jun 16, 2023

Conversation

Maddiaa0
Copy link
Member

@Maddiaa0 Maddiaa0 commented Jun 13, 2023

Description

fixes #616

Creates a public end to end cross chain messaging test.

As a consequence, public functions will need to be able to generate nullifiers, and read from the l1 to l2 messages tree.

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • I have linked this pull request to the issue(s) that it resolves.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • The branch has been merged or rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewer's next convenience.

@Maddiaa0 Maddiaa0 changed the base branch from master to md/com-pub June 13, 2023 16:50
Base automatically changed from md/com-pub to master June 14, 2023 12:19
@Maddiaa0 Maddiaa0 force-pushed the md/public-cross-chain-message-test branch from a1f32f7 to ba27e19 Compare June 14, 2023 18:56

const createMemDown = () => (memdown as any)() as MemDown<any, any>;

describe('Private Execution test suite', () => {
let bbWasm: CircuitsWasm;
let circuitsWasm: CircuitsWasm;
Copy link
Member Author

Choose a reason for hiding this comment

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

changed this as it put me off when bbWasm was referring to CircuitsWasm

@Maddiaa0 Maddiaa0 marked this pull request as ready for review June 15, 2023 17:16
Copy link
Contributor

@LHerskind LHerskind left a comment

Choose a reason for hiding this comment

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

Minor nits here and there. Nice work

yarn-project/acir-simulator/src/test/utils.ts Outdated Show resolved Hide resolved

const secretHash = computeSecretMessageHash(wasm, secret);

// Eventually the kernel will need to prove the kernel portal pair exists within the contract tree,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you throw in a Todo here, probably best to point to @dbanks12 for ideas around if there already is a issue addressing or when this would make sense.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you expand on this just a bit? This is for L1->L2 messages? The kernel doesn't even know that L1->L2 messages exist at the moment, does it?

yarn-project/end-to-end/src/utils.ts Outdated Show resolved Hide resolved
yarn-project/end-to-end/src/utils.ts Outdated Show resolved Hide resolved

// Compute Nullifier
let nullifier = l1_to_l2_message_data.message.compute_nullifier();
let nullifier = process_l1_to_l2_message(inputs.roots.l1_to_l2_messages_tree_root, inputs.call_context.storage_contract_address, msg_key, content, secret);
Copy link
Contributor

Choose a reason for hiding this comment

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

Love to see it.
dance party jeep GIF

@@ -3,6 +3,7 @@ use crate::types::point::Point;
use crate::messaging::l1_to_l2_message_getter_data::L1ToL2MessageGetterData;
use crate::messaging::l1_to_l2_message_getter_data::make_l1_to_l2_message_getter_data;


Copy link
Contributor

Choose a reason for hiding this comment

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

🤷

Copy link
Member Author

Choose a reason for hiding this comment

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

gotta be done

}


fn _get_mint_content_hash(amount: Field, owner_address: Field, canceller: Field) -> pub Field {
Copy link
Contributor

Choose a reason for hiding this comment

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

@kevaundray visibility for noir functions wen? 👀

Copy link
Member Author

Choose a reason for hiding this comment

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

OkAy, OkAy, OkAy, I NeEd iNtErNaL FuNcTiOnS. i cAn't tAkE ThIs aNyMoRe. EvErYdAy i'm cHeCkInG ThE InTeRnAl fUnCtIoNs aNd iT'S NoT CoMpIlInG. eVeRyDaY I ChEcK ThE DoCs, BaD DoCs. I CaN'T TaKe tHiS AnYmOrE MaN. i hAvE OvEr-iNvEsTeD, bY A LoT. iT Is wHaT It iS BuT I NeEd tHe iNtErNaL FuNcTiOnS. cAn dEvS Do sOmEtHiNg?

@LHerskind LHerskind merged commit 9f501ba into master Jun 16, 2023
@LHerskind LHerskind deleted the md/public-cross-chain-message-test branch June 16, 2023 08:47
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.

feat(public functions): consume l1 to l2 messages in public contracts
3 participants