Conversation
`aztec new` and `aztec init` now create a workspace with two crates instead of a single contract crate:
- A `contract` crate (type = "contract") for the smart contract code
- A `test` crate (type = "lib") for Noir tests, which depends on the contract crate
This was done as it allow us to not re-compile contracts when only a test is modified.
The new project structure looks like:
```
my_project/
├── Nargo.toml # [workspace] members = ["contract", "test"]
├── contract/
│ ├── src/main.nr
│ └── Nargo.toml # type = "contract"
└── test/
├── src/lib.nr
└── Nargo.toml # type = "lib"
```
**What changed:**
- The `--contract` and `--lib` flags have been removed from `aztec new` and `aztec init`. These commands now always create a contract workspace.
- Contract code is now at `contract/src/main.nr` instead of `src/main.nr`.
- The `Nargo.toml` in the project root is now a workspace file. Contract dependencies go in `contract/Nargo.toml`.
- Tests should be written in the separate `test` crate (`test/src/lib.nr`) and import the contract by package name (e.g., `use my_contract::MyContract;`) instead of using `crate::`.
Other than the above the commands now generate a `README.md` and `.gitignore` files in the project root.
Closes https://linear.app/aztec-labs/issue/F-195/make-aztec-init-create-a-contract-crate-and-a-test-crate
Co-authored-by: Jan Beneš <janbenes1234@gmail.com>
Stuff I don't want hanging over my head while I'm out. Potentially (read: recommended) portable to current devnet. * Comment about the protocol contracts `generate_data` script requested by @nchamo * Fix for Niall's issue with deployments that require authwitnesses: https://linear.app/aztec-labs/issue/F-302/authwits-are-not-being-forwarded-to-the-executionpayload-in * Update playground's devnet URL * Avoid reregistering accounts on every operation in `EmbeddedWallet`
Collaborator
Author
|
🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass. |
Job handling in TXE was broken and it has been working until now because everything we have been querying was obtainable within one job. This is not the case with private events because those are obtainable only after being committed. I described [here](https://linear.app/aztec-labs/issue/F-335/make-job-committing-in-txe-reasonable) TXE is need of large refactor but Nico said on [slack](https://aztecprotocol.slack.com/archives/C07R3GTKJ49/p1771550087677089?thread_ts=1771488780.235399&cid=C07R3GTKJ49) that we are not yet confident enough in the current design for it to be worth it to invest time in it. For this reason I have created this ugly PR that makes it all work but results in the abstractions being thoroughly broken. I think it's an ok interim solution. The main problems fixed here: 1. We didn't commit jobs after a call has been performed, 2. we didn't sync contract private state before `txeGetPrivateEvents` get executed, 3. the `jobId` in `TXEOracleTopLevelContext` was set to just the initial `jobId` and was not correctly updated. Issue 3. was handled by me passing the jobId down to individual functions that needed it.
Collaborator
Author
Flakey Tests🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BEGIN_COMMIT_OVERRIDE
refactor: aztec new and init creating 2 crates (#20681)
fix: hodgepodge of small things (#20720)
test: aztec new scaffold works (#20711)
feat: add
aztec profilecommand with gate count profiling (#20695)fix(txe): committing after txs (#20714)
feat: add aztec profile flamegraph command (#20741)
feat: printing out public contract function debug logs in a tx (#20749)
END_COMMIT_OVERRIDE