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: auto-recompile the boxes and fix broken frontend CompleteAddress import #2727

Merged
merged 57 commits into from
Oct 10, 2023

Conversation

dan-aztec
Copy link
Contributor

@dan-aztec dan-aztec commented Oct 6, 2023

forking prior PR to see where e2e tests failed, got in a bad state so splitting into smaller PRs.

This will help keep the boxes up to date by introducing a bootstrap.sh for boxes, which recompiles within the monorepo using the latest local aztec-cli compile command.

The artifact casing changes because noir-contracts compile script does some manual changing to kebab case.

--> changes box contract Nargo.toml to be buildable within monorepo by using relative paths for deps. These get updated now in the unbox command.

Also discovered CompleteAddress was broken in the frontend, Leila helped resolve import errors. added a test for the in e2e browser. This means boxes are broken on current release of our packages, so need to release again after this lands.

Will do a follow up PR for reducing dependencies to just @aztec/aztec.js, as this PR is getting big

@dan-aztec dan-aztec changed the title Dan/auto copy box fix fix: Dan/auto copy box fix Oct 6, 2023
@dan-aztec dan-aztec force-pushed the dan/auto-copy-box-fix branch from f0720db to 452e5dd Compare October 6, 2023 15:11
@dan-aztec dan-aztec changed the title fix: Dan/auto copy box fix feat: auto-recompile the boxes and fix broken frontend CompleteAddress import Oct 6, 2023
@dan-aztec dan-aztec marked this pull request as ready for review October 6, 2023 16:02
@dan-aztec dan-aztec requested a review from LeilaWang October 6, 2023 16:03
import { ContractAbi } from '@aztec/foundation/abi';
import { Point } from '@aztec/foundation/fields';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

there was some import error with CompleteAddress inside the box frontend apps, this was the fix (same change is in a few files)

yarn-project/end-to-end/src/canary/browser.ts Outdated Show resolved Hide resolved
if (abiImportPath === `${name}.json`) {
// relative path edge case, prepending ./ for local import - the upstream logic just does
// `${name}.json`, which is not a valid import for a file in the same directory
abiImportPath = `./${name}.json`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This feels wrong. What if someone intentionally set the path to be name.json? We should find out what's calling this that should provide a relative path but didn't, and fix it there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you, did not know the imports could be configured per package. fixing

yarn-project/boxes/blank/src/tests/blank.contract.test.ts Outdated Show resolved Hide resolved
// otherwise returning a CompleteAddress makes result undefined.
return completeAddress.toString();
});
// a lot of trailing 0s get added in the return value
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why? Is it the case for any string?

@dan-aztec dan-aztec merged commit 4ec4ea0 into master Oct 10, 2023
2 checks passed
@dan-aztec dan-aztec deleted the dan/auto-copy-box-fix branch October 10, 2023 14:20
dan-aztec pushed a commit that referenced this pull request Oct 10, 2023
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-packages: 0.8.9</summary>

##
[0.8.9](aztec-packages-v0.8.8...aztec-packages-v0.8.9)
(2023-10-10)


### Features

* Auto-recompile the boxes and fix broken frontend CompleteAddress
import
([#2727](#2727))
([4ec4ea0](4ec4ea0))


### Bug Fixes

* Default export in noir-version
([#2757](#2757))
([6ff7bed](6ff7bed))
</details>

<details><summary>barretenberg.js: 0.8.9</summary>

##
[0.8.9](barretenberg.js-v0.8.8...barretenberg.js-v0.8.9)
(2023-10-10)


### Miscellaneous

* **barretenberg.js:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg: 0.8.9</summary>

##
[0.8.9](barretenberg-v0.8.8...barretenberg-v0.8.9)
(2023-10-10)


### Miscellaneous

* **barretenberg:** Synchronize aztec-packages versions
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
AztecBot added a commit to AztecProtocol/barretenberg that referenced this pull request Oct 11, 2023
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-packages: 0.8.9</summary>

##
[0.8.9](AztecProtocol/aztec-packages@aztec-packages-v0.8.8...aztec-packages-v0.8.9)
(2023-10-10)


### Features

* Auto-recompile the boxes and fix broken frontend CompleteAddress
import
([#2727](AztecProtocol/aztec-packages#2727))
([4ec4ea0](AztecProtocol/aztec-packages@4ec4ea0))


### Bug Fixes

* Default export in noir-version
([#2757](AztecProtocol/aztec-packages#2757))
([6ff7bed](AztecProtocol/aztec-packages@6ff7bed))
</details>

<details><summary>barretenberg.js: 0.8.9</summary>

##
[0.8.9](AztecProtocol/aztec-packages@barretenberg.js-v0.8.8...barretenberg.js-v0.8.9)
(2023-10-10)


### Miscellaneous

* **barretenberg.js:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg: 0.8.9</summary>

##
[0.8.9](AztecProtocol/aztec-packages@barretenberg-v0.8.8...barretenberg-v0.8.9)
(2023-10-10)


### Miscellaneous

* **barretenberg:** Synchronize aztec-packages versions
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

Noir Contract Typescript generated class's contract ABI import path bug
2 participants