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: CDP/Lending example contract #1554

Merged
merged 22 commits into from
Aug 23, 2023
Merged

feat: CDP/Lending example contract #1554

merged 22 commits into from
Aug 23, 2023

Conversation

LHerskind
Copy link
Contributor

@LHerskind LHerskind commented Aug 14, 2023

Finishing up the lending/cdp contract. See #1460.

  • Bumps number of public reads/writes because 8 was way too few.
  • Adds a lending/cdp implementation (sorta) with deeper stacks and closer to simple evm contract complexity.
  • Skip l1 rollup test that should have been skipped already due to changing constants (also checked in ts).

Checklist:

Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.

  • If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag.
  • I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code.
  • Every change is related to the PR description.
  • I have linked this pull request to relevant issues (if any exist).

@LHerskind LHerskind force-pushed the lh/1460-extended-lending branch 7 times, most recently from 2534f1d to 9bad3eb Compare August 19, 2023 20:52
@LHerskind LHerskind marked this pull request as ready for review August 21, 2023 08:32
@LHerskind LHerskind linked an issue Aug 21, 2023 that may be closed by this pull request
Copy link
Member

@Maddiaa0 Maddiaa0 left a comment

Choose a reason for hiding this comment

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

Overall looks pretty good, just have issues with the naming

@@ -19,7 +19,8 @@ import {Rollup} from "@aztec/core/Rollup.sol";
* Main use of these test is shorter cycles when updating the decoder contract.
*/
contract RollupTest is DecoderTest {
function testEmptyBlock() public {
// Skipping this because the block is invalid after I changed the constants.
Copy link
Member

Choose a reason for hiding this comment

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

What is the longer term solution to this:

Options:

  • Remove the test
  • Automate the creation of the block data (vm.readfile after running a script)

Copy link
Contributor

@rahul-kothari rahul-kothari Aug 22, 2023

Choose a reason for hiding this comment

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

I like the vm.readfile idea.

Edit by @LHerskind:
Created #1736

@@ -65,7 +65,7 @@ export class UnconstrainedFunctionExecution {
}

const makeLogMsg = (slot: bigint, value: string) =>
`Oracle storage read: slot=${slot.toString()} value=${value}`;
`Oracle storage read: slot=${new Fr(slot).toString()} value=${value}`;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`Oracle storage read: slot=${new Fr(slot).toString()} value=${value}`;
`Oracle storage read: slot=${slot.toString(16)} value=${value}`;

@@ -160,11 +160,13 @@ describe('e2e_cheat_codes', () => {

// initialize contract -> this updates `lastUpdatedTs` to the current timestamp of the rollup
// this should be the new timestamp
const txInit = contract.methods.init().send({ origin: recipient });
const txInit = contract.methods
Copy link
Member

Choose a reason for hiding this comment

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

Should this not use a purpose built method on the test_contract one. Rather than cross pollinating

@@ -0,0 +1,82 @@

struct SafeU120 {
Copy link
Member

Choose a reason for hiding this comment

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

Should this exist as a lib in noir-libs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possibly. @iAmMichaelConnor, what is the process currently of deciding what is in noir-libs and what is not. I think there might be a large group of "stuff" that is useful for many contract, but I would not put it into the noir-libs similar to how OZ is just something external to solidity etc.

}
}

// todo: Implement a version that avoids shadow-overflows
Copy link
Member

Choose a reason for hiding this comment

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

does this need an issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will create an issue for it and add low-prio.

return BASE + offset;
};

class Skibbidy {
Copy link
Member

Choose a reason for hiding this comment

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

OI

await this.cc.aztec.warp(this.time);
};

progressTime = async (diff: number) => {
Copy link
Member

Choose a reason for hiding this comment

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

bit odd to use arrow function syntax on a class

}

const rate = 1268391679n;
const guy = new Skibbidy(cc, account, rate);
Copy link
Member

Choose a reason for hiding this comment

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

naming hahah

expect(receipt5.status).toBe(TxStatus.MINED);
}

const rate = 1268391679n;
Copy link
Member

Choose a reason for hiding this comment

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

link to the name of this in the noir

lendingContract: LendingContract,
collateralAsset: NativeTokenContract,
stableCoin: NativeTokenContract,
aztecNode: AztecRPC,
Copy link
Member

Choose a reason for hiding this comment

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

unused

@LHerskind LHerskind force-pushed the lh/1460-extended-lending branch 2 times, most recently from cb7c794 to 96d1ab2 Compare August 22, 2023 13:48
@@ -19,7 +19,8 @@ import {Rollup} from "@aztec/core/Rollup.sol";
* Main use of these test is shorter cycles when updating the decoder contract.
*/
contract RollupTest is DecoderTest {
function testEmptyBlock() public {
// Skipping this because the block is invalid after I changed the constants.
Copy link
Contributor

@rahul-kothari rahul-kothari Aug 22, 2023

Choose a reason for hiding this comment

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

I like the vm.readfile idea.

Edit by @LHerskind:
Created #1736

const txInit = contract.methods.init().send({ origin: recipient });
await txInit.isMined({ interval: 0.1 });
const txIsTimeEqual = contract.methods.isTimeEqual(newTimestamp).send({ origin: recipient });
await txIsTimeEqual.isMined({ interval: 0.1 });
Copy link
Contributor

Choose a reason for hiding this comment

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

this is my bad but can you use wait() instead of isMined()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a reason that wait is defined as and don't just return a TxReceipt?:

public async wait(opts?: WaitOpts): Promise<FieldsOf<TxReceipt>> {

Copy link
Contributor

Choose a reason for hiding this comment

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

yea looks like FieldsOf strips of the methods - we just seem to not want to expose publicly via the wait method.

logger(`Deploying L2 public contract...`);
const tx = LendingContract.deploy(aztecRpcServer).send();
logger(`Tx sent with hash ${await tx.getTxHash()}`);
logger(`isMined: ${await tx.isMined({ interval: 0.1 })}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

if you use await tx.wait() here, which returns receipt you can skip the next two lines

stableCoin: NativeTokenContract,
account: Account,
) => {
// @todo This is horrible.
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 link Phil's issue here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See #1687 and #1691

storageValues['interest_accumulator'] = new Fr(tot['interest_accumulator']);
storageValues['last_updated_ts'] = new Fr(tot['last_updated_ts']);
storageValues['private_collateral'] = new Fr(privatePos['collateral']);
storageValues['private_debt'] = new Fr(privatePos['static_debt']);
storageValues['private_static_debt'] = new Fr(privatePos['static_debt']);
Copy link
Contributor

Choose a reason for hiding this comment

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

should these be deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. Forgot 😬

return BASE + offset;
};

class LendingSimulator {
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 add a quick comment on this class? Basically talk about how it helps with checking by keeping track of the expected contract state and how before actually calling the contract's deposit() method, yu should also call this to keep this up to date?

const tx = lendingContract.methods.withdraw_public(recipient, 10n ** 9n).send({ origin: recipient });
await tx.isMined({ interval: 0.1 });
const receipt = await tx.getReceipt();
expect(receipt.status).toBe(TxStatus.DROPPED);
Copy link
Contributor

Choose a reason for hiding this comment

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

if you do tx.wait() you can check the throw and possibly grab the assert error too.

let new_balance = storage.public_balances.at(to).read() + amount;
storage.public_balances.at(to).write(new_balance);
storage.total_supply.write(storage.total_supply.read() + amount);
context.return_values.push(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

What's this for? Is it similar to how transferFrom() returns bool?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At some point there was failures if no return values, so leftover from that.


let mut note = TransparentNote::new(amount, secret_hash);
pending_shields.insert_from_public(context, &mut note);

Copy link
Contributor

Choose a reason for hiding this comment

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

do we not need to emit an event? When transferring, we typically emit an event so that the user knows they got a note right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Were just based directly on the shield function. Also, as it is just a test token, is to be replaced by some more coordination on tokens in general.

Copy link
Member

@Maddiaa0 Maddiaa0 left a comment

Choose a reason for hiding this comment

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

overall lgtm, just these notes need issues then were gtg

mod transparent_note;

// Testing token that can be bridged in and out.
// TODOS:
Copy link
Member

Choose a reason for hiding this comment

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

are there issues for these now?

@LHerskind LHerskind force-pushed the lh/1460-extended-lending branch from 14a0320 to 1a4d354 Compare August 23, 2023 15:51
@LHerskind
Copy link
Contributor Author

overall lgtm, just these notes need issues then were gtg

There is this one: #1743

@LHerskind LHerskind force-pushed the lh/1460-extended-lending branch from a375cd2 to 9f04405 Compare August 23, 2023 17:20
@LHerskind LHerskind merged commit ecf6df2 into master Aug 23, 2023
@LHerskind LHerskind deleted the lh/1460-extended-lending branch August 23, 2023 18:12
PhilWindle pushed a commit that referenced this pull request Aug 24, 2023
🤖 I have created a new Aztec Packages release
---


##
[0.1.0-alpha46](v0.1.0-alpha45...v0.1.0-alpha46)
(2023-08-24)


### Features

* CDP/Lending example contract
([#1554](#1554))
([ecf6df2](ecf6df2))
* no unencrypted logs in private functions
([#1780](#1780))
([4d8002e](4d8002e)),
closes
[#1689](#1689)


### Miscellaneous

* **ci:** Updated release please configuration
([#1787](#1787))
([6eb2f7a](6eb2f7a))
* sync bb master
([#1776](#1776))
([7c6fb15](7c6fb15))


### Documentation

* events
([#1768](#1768))
([5a38cea](5a38cea)),
closes
[#1756](#1756)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
dan-aztec pushed a commit that referenced this pull request Aug 25, 2023
🤖 I have created a new Aztec Packages release
---


##
[0.1.0-alpha46](v0.1.0-alpha45...v0.1.0-alpha46)
(2023-08-24)


### Features

* CDP/Lending example contract
([#1554](#1554))
([ecf6df2](ecf6df2))
* no unencrypted logs in private functions
([#1780](#1780))
([4d8002e](4d8002e)),
closes
[#1689](#1689)


### Miscellaneous

* **ci:** Updated release please configuration
([#1787](#1787))
([6eb2f7a](6eb2f7a))
* sync bb master
([#1776](#1776))
([7c6fb15](7c6fb15))


### Documentation

* events
([#1768](#1768))
([5a38cea](5a38cea)),
closes
[#1756](#1756)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
dan-aztec added a commit that referenced this pull request Aug 25, 2023
refactor: consistent block number method naming (#1751)

Renamed `AztecRPC.getBlockNum` to `getBlockNumber`
and`AztecNode.getBlockHeight` to `getBlockNumber`. I decided to use the
name block number because in the Ethereum JSON RPC spec there is
`eth_blockNumber` call and I think it's a good idea to use the same
naming.

git subrepo push --branch=main docs

subrepo:
  subdir:   "docs"
  merged:   "324402a78"
upstream:
  origin:   "https://github.com/AztecProtocol/docs"
  branch:   "main"
  commit:   "324402a78"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???"

refactor: Use context instead of custom oracles for public functions (#1754)

Fixes #1753, #1755 and use context for nullifiers and commitments in
public.

docs: convert quick start guides into e2e tests (#1726)

Fixes #1564

git subrepo push --branch=main docs

subrepo:
  subdir:   "docs"
  merged:   "ba5d7a6bc"
upstream:
  origin:   "https://github.com/AztecProtocol/docs"
  branch:   "main"
  commit:   "ba5d7a6bc"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???"

feat(ci): Initial release please config (#1769)

PR with initial release please configuration

Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

docs: including "real" code in keys docs (#1767)

Including "real" code in keys docs + addressed one Noir TODO so that it
doesn't get shown inside the docs.

git subrepo push --branch=main docs

subrepo:
  subdir:   "docs"
  merged:   "842a54250"
upstream:
  origin:   "https://github.com/AztecProtocol/docs"
  branch:   "main"
  commit:   "842a54250"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???"

feat: not retrying unrecoverable errors (#1752)

Fixes #1511
Fixes #1724

With this PR all the errors thrown in the server code are considered to
be unrecoverable. Recoverable errors should not be errors and should be
handled (or shown only as warnings). For example I refactored the
`registerAccount` and `registerRecipient` to not throw if we add the
same recipient/account twice because that situation is easily
recoverable (just ignore it).

Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

feat: compress debug symbols (#1760)

Partial work towards #1224

While working on brillig debug symbols I noticed that the JSON ABIs
started to weight more than some megabytes and started to create issues
for the typescript type inference, since we're importing them as json
modules. This PR addresses that by just compressing the debug symbols
and decompressing them transparently in the utility function that we
have for this in foundation. I used https://www.npmjs.com/package/pako
for gzip since it should be compatible with the browser without issue.

Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [x] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [x] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

ci: Updated release please config (#1773)

This PR contains further release-please configuration changes.

Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

feat(bb): Use an environment variable to set the transcript URL (#1750)

Related to #1749

Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

git subrepo push --branch=master circuits/cpp/barretenberg

subrepo:
  subdir:   "circuits/cpp/barretenberg"
  merged:   "41d362e9c"
upstream:
  origin:   "https://github.com/AztecProtocol/barretenberg"
  branch:   "master"
  commit:   "41d362e9c"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???"

chore(ci): Updated release please config (#1775)

This PR provides further release-please configuration changes.

Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

chore(ci): set up nightly barretenberg releases (#1761)

This PR pulls across the publishing workflow from Noir so that
barretenberg can have nightly releases.

Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [x] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [x] Every change is related to the PR description.
- [x] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

chore(master): release 0.1.0-alpha45 (#1774)

:robot: I have created a new Aztec Packages release
---

[0.1.0-alpha45](v0.1.0-alpha44...v0.1.0-alpha45)
(2023-08-23)

* **bb:** Use an environment variable to set the transcript URL
([#1750](#1750))
([31488c1](31488c1))
* **ci:** Initial release please config
([#1769](#1769))
([4207559](4207559))
* compress debug symbols
([#1760](#1760))
([9464b25](9464b25))
* not retrying unrecoverable errors
([#1752](#1752))
([c0f2820](c0f2820))

* Download SRS using one canonical URL across the codebase
([#1748](#1748))
([899b055](899b055))
* proving fails when circuit has size &gt; ~500K
([#1739](#1739))
([708b05c](708b05c))

* **ci:** set up nightly barretenberg releases
([#1761](#1761))
([e0078da](e0078da))
* **ci:** Updated release please config
([#1775](#1775))
([0085e8b](0085e8b))
* consistent block number method naming
([#1751](#1751))
([df1afe2](df1afe2))
* Use context instead of custom oracles for public functions
([#1754](#1754))
([46de77a](46de77a))

* convert quick start guides into e2e tests
([#1726](#1726))
([802a678](802a678)),
closes
[#1564](#1564)
* including "real" code in keys docs
([#1767](#1767))
([cd9cadb](cd9cadb))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

chore: sync bb master (#1776)

Ran:

```
./scripts/git_subrepo.sh pull circuits/cpp/barretenberg
git checkout origin/master -- .gitmodules
```
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

git_subrepo.sh: Fix parent in .gitrepo file.

git subrepo push --branch=master circuits/cpp/barretenberg

subrepo:
  subdir:   "circuits/cpp/barretenberg"
  merged:   "1b1d24e82"
upstream:
  origin:   "https://github.com/AztecProtocol/barretenberg"
  branch:   "master"
  commit:   "1b1d24e82"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???"

update noir contract paths

feat: CDP/Lending example contract (#1554)

Finishing up the lending/cdp contract enough for show (no liqudation and unsecure as all the contracts). See #1460.

more instructions

also reference the generated typescript file

start frontend integration w/sandbox

cleaner parsing of functionAbi for yup schema

re-add initialValues

switch to rpcclient instead of server

hardcode some private keys from fixtures

try singleKeyAccount

thanks adam for fixing webasm import

switch to vite.config.js

switch to privateKey class

blocked by undefined methods attribute on the PrivateTokenContract object

revert yarn.lock osx change

use latest yarn.lock

docs: events (#1768)

Fixes #1756

git subrepo push --branch=main docs

subrepo:
  subdir:   "docs"
  merged:   "3c5f3c4a9"
upstream:
  origin:   "https://github.com/AztecProtocol/docs"
  branch:   "main"
  commit:   "3c5f3c4a9"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???"

feat: no unencrypted logs in private functions (#1780)

Fixes #1689

git subrepo push --branch=main docs

subrepo:
  subdir:   "docs"
  merged:   "40c05467f"
upstream:
  origin:   "https://github.com/AztecProtocol/docs"
  branch:   "main"
  commit:   "40c05467f"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???"

chore(ci): Updated release please configuration (#1787)

This PR contains further configuration changes and documentation for our
usage of release please

Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

chore(master): release 0.1.0-alpha46 (#1777)

:robot: I have created a new Aztec Packages release
---

[0.1.0-alpha46](v0.1.0-alpha45...v0.1.0-alpha46)
(2023-08-24)

* CDP/Lending example contract
([#1554](#1554))
([ecf6df2](ecf6df2))
* no unencrypted logs in private functions
([#1780](#1780))
([4d8002e](4d8002e)),
closes
[#1689](#1689)

* **ci:** Updated release please configuration
([#1787](#1787))
([6eb2f7a](6eb2f7a))
* sync bb master
([#1776](#1776))
([7c6fb15](7c6fb15))

* events
([#1768](#1768))
([5a38cea](5a38cea)),
closes
[#1756](#1756)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

chore: Add todo for using generator indices in note commitment and nullifier computation. (#1762)

fix(noir): Add workaround for latest noir in account contracts (#1781)

Workaround for this issue noir-lang/noir#2421
so we can update the aztec tag to master.

Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [x] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

chore: split out yarn-project bootstrap.sh (#1790)

Allows for more modular bootstrapping.

chore(p2p): Updated libp2p dependencies (#1792)

This PR simply updates the libp2p dependencies to the newest versions.

Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

feat: `FunctionSelector` type (#1518)

Fixes #1424

chore: Sandbox logging tweaks (#1797)

Packages a bunch of tweaks to Sandbox debugging and logging, such as:
- Wasm debug logs are now prefixed as `aztec:wasm`, not `wasm`, so they
are visible when debugging via `aztec:*`
- Defaults sandbox logging to INFO instead of DEBUG
- Allows users to configure sandbox debug by exporting `DEBUG='aztec:*'`
in their shell (related to #1605)
- Silences all anvil logs since they didn't provide any useful info
(fixes #1580)
- Renames container names in the sandbox docker-compose (anvil was not
running a fork, and the sandbox is not just an rpc-server)

fix: increment time by 1 for previous rollup was warped (#1594)

With Warp
```
L2 block 1: occurred at t = 100.
Call warp(200) => Rollup.sol's lastBlockTs = 200 & L1.setNextBlockTimeStamp = 200.
L2 block 2: txs show t = 200. Rollup published at t = 200 => Rollup.sol's lastBlockTs = 200
L2 block 3: txs show t = 200.
```
Notice how txs in block 2 and block 3 show a timestamp of 200! This is
confusing.

So we check if the last rollup was warped (here block 2), and if so, txs
in the next rollup (block 3) should show ts = 201. We check if last
rollup was warped by introducing a variable in Rollup.sol that tracks
the last time block was warped.

Also Create #1614

fix: selector name regression (#1800)

I introduced a regression in my function [selector type
PR](#1518) which
caused the selector name to be incorrect in circuits.gen.ts. The issue
was with having different names for selector in FunctionData struct in
TS and C++.

This PR fixes it.

chore(master): release 0.1.0-alpha47 (#1788)

:robot: I have created a new Aztec Packages release
---

[0.1.0-alpha47](v0.1.0-alpha46...v0.1.0-alpha47)
(2023-08-25)

* `FunctionSelector` type
([#1518](#1518))
([942f705](942f705)),
closes
[#1424](#1424)

* increment time by 1 for previous rollup was warped
([#1594](#1594))
([2a52107](2a52107))
* **noir:** Add workaround for latest noir in account contracts
([#1781](#1781))
([eb8a052](eb8a052))
* selector name regression
([#1800](#1800))
([a5be8bb](a5be8bb))

* Add todo for using generator indices in note commitment and nullifier
computation.
([#1762](#1762))
([2db6728](2db6728))
* **p2p:** Updated libp2p dependencies
([#1792](#1792))
([79df831](79df831))
* Sandbox logging tweaks
([#1797](#1797))
([0e3914e](0e3914e))
* split out yarn-project bootstrap.sh
([#1790](#1790))
([1788fe6](1788fe6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

docs: Wallet dev docs (#1746)

Developer docs on wallets. Introduces a new "architecture" section for
wallets, that elaborates on the RPC server and entrypoints. Deletes the
"building a wallet" tutorial, since building a wallet is excessively
complex for a tutorial.

Fixes #1741
Closes #1745
Pending #1744

git subrepo push --branch=main docs

subrepo:
  subdir:   "docs"
  merged:   "6f755743d"
upstream:
  origin:   "https://github.com/AztecProtocol/docs"
  branch:   "main"
  commit:   "6f755743d"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???"

feat: Update safe_math and move to libraries (#1803)

Fixes #1794 and address the wrong check in `mul`.

Would prefer to add tests directly, but noir don't support failing tests
in noir yet, so there is really no good reason to do that currently. See
noir-lang/noir#1994

test: add browser test to canary flow (#1808)

Adding Aztec.js browser test to our canary flow to ensure published npm
package is stable

Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

docs: Account contract tutorial (#1772)

Tutorial for writing an account contract. Includes tweaks to payload
helpers in aztec.js to make the process easier.

Fixes #1744
See also #1746

---------

Co-authored-by: Michael Connor <mike@aztecprotocol.com>

git subrepo push --branch=main docs

subrepo:
  subdir:   "docs"
  merged:   "2fd486a6c"
upstream:
  origin:   "https://github.com/AztecProtocol/docs"
  branch:   "main"
  commit:   "2fd486a6c"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???"

chore: fixed linter errors for `ecc`, `numeric` and `common` modules (#1714)

The majority of the barretenberg codebase does not conform to our C++
style guide rules.

This PR updates the `common`, `numeric` and `ecc` modules to conform to
the guide. These 3 modules should now produce no linter errors.

Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [x] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [x] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [x] Every change is related to the PR description.
- [x] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

---------

Co-authored-by: kevaundray <kevtheappdev@gmail.com>

git subrepo push --branch=master circuits/cpp/barretenberg

subrepo:
  subdir:   "circuits/cpp/barretenberg"
  merged:   "cca5c1bf1"
upstream:
  origin:   "https://github.com/AztecProtocol/barretenberg"
  branch:   "master"
  commit:   "cca5c1bf1"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???"

feat: More reliable getTxReceipt api. (#1793)

Closes #1402 #1548

Previous approach had too many issues - only sender and the recipients
(after they decrypt their notes) can call this api. The data in the
receipt was not consistent.
And the role of TxDao is confusing. Delete it now and remove some
complicated code around it.

Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
codygunton pushed a commit that referenced this pull request Jan 23, 2024
* dynamic reference to redis cluster subnet group (#1594)

Co-authored-by: PhilWindle <philip.windle@gmail.com>

* Created generic swapping agent for both uniswap and lido-curve bridges (#1265)

* JB/Website changes (#1554)

* Bruno changes

* Grants changes

* Update grants page, edit team page

* Fix typos, change header, footer links; noir links

* Fix sliders

* Copy changes

* Adds two RFPs

* Add Michael to Careers, typos

* Fix titles of roles

* JB/Website changes (#1612)

* Bruno changes

* Grants changes

* Update grants page, edit team page

* Fix typos, change header, footer links; noir links

* Fix sliders

* Copy changes

* Adds two RFPs

* Add Michael to Careers, typos

* Fix titles of roles

* Fix lint, replace images

* Pass the uint context to the return value of uint::at  (#1593)

* Construct return value from current context in uint::at

Fixes AztecProtocol/aztec2-internal#1433

* Add uint test which asserts context inheritance

* Move to yarn 3 plug 'n play and workspaces, pure ESM modules. (#1599)

* Transferrables and webpack to build a worker.js until we have loader chaining...

* Prod/dev conf

* Update bb imports.

* bb tests passing.

* Integrate wasm back in bb.js. Passing tests. Reduce wasm memory footprint.

* Can run halloumi and falafel.

* Falafel tests pass.

* Sdk tests pass.

* e2e.test passes.

* webpack

* bb.js yarn 3.2.2

* fix mem align

* fix bitwise warning on newer clang

* Tweaks towards wasi 16 (more to figure out)

* yarn 3.2.2

* remove encoding headers from block source client

* bb.js updates

* Blockchain test transpile to cjs for hardhat.

* Fix blockchain.

* SDK alternates proving keys.

* Falafel/halloumi start_e2e scripts args.

* Shared linting, formatting for bb.js and blockchain.

* explorer import changes. build needs fixing.

* end-to-end, falafel, halloumi linting

* Hummus just a terminal. Linting. Version upgrades.

* Linting. Bootstrapping. Wallet.

* prettier config.

* Basic working wallet.

* Fix apollo server stuff in falafel...

* account-migrator. explorer.

* Cleanup JSON stuff.

* wasabi.

* Revert jest->mocha

* Merge fixes.

* Initial zk-money.

* - Reconnect bootstrap scripts
- set prettier as js default

* - es-module style imports
- upgrade typescript
- copy wasm

* zk-money builds.

* Linting

* Dockerfile and build stuff.

* Move yarn project into own folder.

* explorer build. min cci yml.

* Introduce a build manifest to compute rebuild patterns.

* Addition of a script for auto launching tmux and running a test.

* Streamline bootstrapping.

* Add bash to falafel image.

* build image

* Attempt to fix deploy.

* Attempt to fix deploy.

* Attempt to fix deploy.

* Attempt to fix deploy.

* Attempt to fix deploy.

* Attempt to fix deploy.

* Attempt to fix deploy.

* Attempt to fix deploy.

* Attempt to fix deploy.

* Attempt to fix deploy.

* Attempt to fix deploy.

* Attempt to fix deploy.

* Attempt to fix deploy.

* Attempt to fix deploy.

* Attempt to fix deploy.

* When scanning for rollups, we only cache the last block number where … (#1611)

* When scanning for rollups, we only cache the last block number where we actually found a rollup

* Fixed bug

* fix typo in zk-money app obs intial -> initial (#1633)

* Adress comments about docs (#1500)

* Adress comments about docs

* Update schnorr.md

Co-authored-by: Michael Connor <mike@aztecprotocol.com>

* Move genesis data from bb.js to falafel (#1640)

* moved init/genesis data from bb.js to falafel along with helper functions for reading the init data.

* data files no longer need to be moved as part of bb.js webpack

* obsolete comment in bb.js env

* Moved some init helper functions back to bb.js. Renamed helper class in falafel. Fixed missing 'any' type in falafel env init.ts

* copy init account data to dest in falafel

Co-authored-by: spypsy <spypsy@users.noreply.github.com>
Co-authored-by: Jonathan Bursztyn <jobur93@gmail.com>
Co-authored-by: Guido Vranken <guidovranken@users.noreply.github.com>
Co-authored-by: Charlie Lye <charlie@aztecprotocol.com>
Co-authored-by: Charlie Lye <karl.lye@gmail.com>
Co-authored-by: David Banks <47112877+dbanks12@users.noreply.github.com>
Co-authored-by: Adrian Hamelink <adrian.hamelink@gmail.com>
Co-authored-by: Michael Connor <mike@aztecprotocol.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Finish the off-site lending example
3 participants