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: Base rollup in noir #3257

Merged
merged 35 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8dcb226
add note on method unused method
kevaundray Nov 3, 2023
30460b8
add is_empty methods to public_data_read and public_data_update_request
kevaundray Nov 3, 2023
8289188
fill in everything except for new nullifier_tree
kevaundray Nov 3, 2023
b8f856b
nullifier code
kevaundray Nov 6, 2023
3795864
feat: enable root rollup
sirasistant Nov 6, 2023
9f7fb20
Merge branch 'master' into arv/enable_rollups
ludamad Nov 6, 2023
0937ff0
feat: enable merge rollup
sirasistant Nov 7, 2023
09ea36d
Merge branch 'master' into arv/enable_rollups
sirasistant Nov 7, 2023
42fa4ed
Merge branch 'kw/london-offsite-ptsd-vibes' into arv/base_rollup
sirasistant Nov 7, 2023
714e1ef
feat: get base rollup compiling as unconstrained
sirasistant Nov 7, 2023
d561eeb
chore: demonstrate circuit blowup
sirasistant Nov 7, 2023
c1eb507
feat: do full field comparisons as functions
sirasistant Nov 7, 2023
3ed7180
chore: update yarn lock
sirasistant Nov 7, 2023
d036c15
fix: fixed some sibling path heights
sirasistant Nov 7, 2023
b148669
feat: export simulate base rollup
sirasistant Nov 7, 2023
3c27cc3
feat: extract finding to a separate fn
sirasistant Nov 15, 2023
2d4c09f
fix: simulate append only trees
sirasistant Nov 15, 2023
4b3c444
fix: calldata hash matching cpp
sirasistant Nov 15, 2023
fb63078
chore: don't overwrite redundantly
sirasistant Nov 15, 2023
1ffa79f
Merge branch 'master' into arv/base_rollup
sirasistant Nov 15, 2023
16b8ca6
chore: bump timeouts
sirasistant Nov 15, 2023
efcae11
Merge branch 'master' into arv/base_rollup
sirasistant Nov 21, 2023
b2fbd0a
Merge branch 'master' into arv/base_rollup
sirasistant Nov 22, 2023
08d8e00
chore: bump timeouts
sirasistant Nov 22, 2023
aca91be
test: add tests for the base rollup
sirasistant Nov 23, 2023
947eac6
chore: restore missing file
sirasistant Nov 23, 2023
0c1d55b
Merge branch 'master' into arv/base_rollup
sirasistant Nov 24, 2023
9541f4b
test: bump timeouts
sirasistant Nov 24, 2023
e0a8a10
Merge branch 'arv/base_rollup' of github.com:AztecProtocol/aztec-pack…
sirasistant Nov 24, 2023
c1cdef9
test: added some nullifier tests
sirasistant Nov 24, 2023
5b6a978
Merge branch 'master' into arv/base_rollup
sirasistant Nov 24, 2023
b6a749c
test: bump timeout
sirasistant Nov 24, 2023
864ce3b
Merge branch 'arv/base_rollup' of github.com:AztecProtocol/aztec-pack…
sirasistant Nov 24, 2023
50a9258
chore: use default instead of empty
sirasistant Nov 24, 2023
853fc51
refactor: use constants for kernel count
sirasistant Nov 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ AggregationObject aggregate_proofs(BaseRollupInputs const& baseRollupInputs)
}

/** TODO: implement
* This is not being used
* @brief Get the prover contribution hash object
*
* @return NT::fr
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/e2e_p2p_network.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('e2e_p2p_network', () => {
await context.pxeService.stop();
}
await bootstrapNode.stop();
}, 80_000);
}, 120_000);

const createBootstrapNode = async () => {
const peerId = await createLibP2PPeerId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ describe('e2e_public_cross_chain_messaging', () => {
// ensure funds are gone to owner and not user2.
await crossChainTestHarness.expectPublicBalanceOnL2(ownerAddress, bridgeAmount + unrelatedMintAmount);
await crossChainTestHarness.expectPublicBalanceOnL2(user2Wallet.getAddress(), 0n);
}, 60_000);
}, 90_000);

it("Bridge can't withdraw my funds if I don't give approval", async () => {
const mintAmountToOwner = 100n;
Expand All @@ -163,7 +163,7 @@ describe('e2e_public_cross_chain_messaging', () => {
.methods.exit_to_l1_public(ethAccount, withdrawAmount, EthAddress.ZERO, nonce)
.simulate(),
).rejects.toThrowError('Assertion failed: Message not authorized by account');
});
}, 60_000);

it("can't claim funds privately which were intended for public deposit from the token portal", async () => {
const bridgeAmount = 100n;
Expand All @@ -185,5 +185,5 @@ describe('e2e_public_cross_chain_messaging', () => {
.methods.claim_private(secretHash, bridgeAmount, ethAccount, messageKey, secret)
.simulate(),
).rejects.toThrowError("Cannot satisfy constraint 'l1_to_l2_message_data.message.content == content");
});
}, 60_000);
});
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/e2e_sandbox_example.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,5 +216,5 @@ describe('e2e_sandbox_example', () => {
// check that alice and bob are in registeredAccounts
expect(registeredAccounts.find(acc => acc.equals(alice))).toBeTruthy();
expect(registeredAccounts.find(acc => acc.equals(bob))).toBeTruthy();
});
}, 60_000);
});
20 changes: 10 additions & 10 deletions yarn-project/end-to-end/src/guides/dapp_testing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('guides/dapp/testing', () => {
owner = await createAccount(pxe);
recipient = await createAccount(pxe);
token = await TokenContract.deploy(owner, owner.getCompleteAddress()).send().deployed();
}, 30_000);
}, 60_000);

it('increases recipient funds on mint', async () => {
const recipientAddress = recipient.getAddress();
Expand Down Expand Up @@ -145,7 +145,7 @@ describe('guides/dapp/testing', () => {
// The balances mapping is defined on storage slot 3 and is indexed by user address
ownerSlot = cheats.aztec.computeSlotInMap(3n, ownerAddress);
// docs:end:calc-slot
}, 60_000);
}, 90_000);

it('checks private storage', async () => {
// docs:start:private-storage
Expand All @@ -158,7 +158,7 @@ describe('guides/dapp/testing', () => {
const balance = values.reduce((sum, current) => sum + current.toBigInt(), 0n);
expect(balance).toEqual(100n);
// docs:end:private-storage
});
}, 30_000);

it('checks public storage', async () => {
// docs:start:public-storage
Expand All @@ -167,7 +167,7 @@ describe('guides/dapp/testing', () => {
const balance = await pxe.getPublicStorageAt(token.address, ownerPublicBalanceSlot);
expect(balance!.value).toEqual(100n);
// docs:end:public-storage
});
}, 30_000);

it('checks unencrypted logs, [Kinda broken with current implementation]', async () => {
// docs:start:unencrypted-logs
Expand All @@ -180,21 +180,21 @@ describe('guides/dapp/testing', () => {
const logs = (await pxe.getUnencryptedLogs(filter)).logs;
expect(Fr.fromBuffer(logs[0].log.data)).toEqual(value);
// docs:end:unencrypted-logs
});
}, 30_000);

it('asserts a local transaction simulation fails by calling simulate', async () => {
// docs:start:local-tx-fails
const call = token.methods.transfer(owner.getAddress(), recipient.getAddress(), 200n, 0);
await expect(call.simulate()).rejects.toThrowError(/Balance too low/);
// docs:end:local-tx-fails
});
}, 30_000);

it('asserts a local transaction simulation fails by calling send', async () => {
// docs:start:local-tx-fails-send
const call = token.methods.transfer(owner.getAddress(), recipient.getAddress(), 200n, 0);
await expect(call.send().wait()).rejects.toThrowError(/Balance too low/);
// docs:end:local-tx-fails-send
});
}, 30_000);

it('asserts a transaction is dropped', async () => {
// docs:start:tx-dropped
Expand All @@ -207,21 +207,21 @@ describe('guides/dapp/testing', () => {
await call1.send().wait();
await expect(call2.send().wait()).rejects.toThrowError(/dropped/);
// docs:end:tx-dropped
});
}, 30_000);

it('asserts a simulation for a public function call fails', async () => {
// docs:start:local-pub-fails
const call = token.methods.transfer_public(owner.getAddress(), recipient.getAddress(), 1000n, 0);
await expect(call.simulate()).rejects.toThrowError(/Underflow/);
// docs:end:local-pub-fails
});
}, 30_000);

it('asserts a transaction with a failing public call is dropped (until we get public reverts)', async () => {
// docs:start:pub-dropped
const call = token.methods.transfer_public(owner.getAddress(), recipient.getAddress(), 1000n, 0);
await expect(call.send({ skipPublicSimulation: true }).wait()).rejects.toThrowError(/dropped/);
// docs:end:pub-dropped
});
}, 30_000);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,5 @@ describe('archiver integration with l1 to l2 messages', () => {

expect((await archiver.getPendingL1ToL2Messages(10)).length).toEqual(0);
expect(() => archiver.getConfirmedL1ToL2Message(Fr.ZERO)).toThrow();
});
}, 30_000);
});
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/sample-dapp/ci/index.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ describe('sample-dapp', () => {
await waitForSandbox();
await deploy();
await main();
}, 60_000);
}, 90_000);
});
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/sample-dapp/index.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ describe('token', () => {
expect(await token.methods.balance_of_private(recipient.getAddress()).view()).toEqual(0n);
await token.methods.transfer(owner.getAddress(), recipient.getAddress(), 20n, 0).send().wait();
expect(await token.methods.balance_of_private(recipient.getAddress()).view()).toEqual(20n);
});
}, 30_000);
// docs:end:test
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ struct NullifierLeafPreimage {
}

impl NullifierLeafPreimage {
// TODO(Kev): Check if this is needed.
fn is_empty(self) -> bool {
pub fn default() -> Self {
NullifierLeafPreimage {
leaf_value : 0,
next_value : 0,
next_index : 0,
}
}

pub fn is_empty(self) -> bool {
(self.leaf_value == 0) & (self.next_index == 0) & (self.next_value == 0)
}

fn hash(self) -> Field {
pub fn hash(self) -> Field {
if self.is_empty() {
0
} else {
Expand Down
Loading