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: Add init check by default to public fns #4897

Merged
merged 6 commits into from
Mar 5, 2024

Conversation

spalladino
Copy link
Collaborator

@spalladino spalladino commented Mar 1, 2024

Adds the init check by default to all public functions, unless they are flagged as noinitcheck.

This should break all contracts that call a public function from their constructor. Let's see...

@spalladino spalladino marked this pull request as draft March 1, 2024 21:47
@AztecBot
Copy link
Collaborator

AztecBot commented Mar 1, 2024

Benchmark results

Metrics with a significant change:

  • note_trial_decrypting_time_in_ms (8): 18.0 (-83%)
Detailed results

All benchmarks are run on txs on the Benchmarking contract on the repository. Each tx consists of a batch call to create_note and increment_balance, which guarantees that each tx has a private call, a nested private call, a public call, and a nested public call, as well as an emitted private note, an unencrypted log, and public storage read and write.

This benchmark source data is available in JSON format on S3 here.

Values are compared against data from master at commit 37476196 and shown if the difference exceeds 1%.

L2 block published to L1

Each column represents the number of txs on an L2 block published to L1.

Metric 8 txs 32 txs 64 txs
l1_rollup_calldata_size_in_bytes 5,700 18,884 36,452
l1_rollup_calldata_gas 66,048 239,156 469,736
l1_rollup_execution_gas 193,996 500,462 908,994
l2_block_processing_time_in_ms 1,199 (+1%) 4,435 (-2%) 8,803 (-2%)
note_successful_decrypting_time_in_ms 212 (+7%) 531 (-9%) 975 (-2%)
note_trial_decrypting_time_in_ms ⚠️ 18.0 (-83%) 52.5 (-49%) 106 (-15%)
l2_block_building_time_in_ms 16,560 (+5%) 63,125 125,697
l2_block_rollup_simulation_time_in_ms 12,512 (+4%) 47,944 96,058
l2_block_public_tx_process_time_in_ms 4,018 (+7%) 15,094 (+1%) 29,526 (-1%)

L2 chain processing

Each column represents the number of blocks on the L2 chain where each block has 16 txs.

Metric 5 blocks 10 blocks
node_history_sync_time_in_ms 13,750 (-4%) 26,679
note_history_successful_decrypting_time_in_ms 1,191 (-8%) 2,313 (-3%)
note_history_trial_decrypting_time_in_ms 56.5 (-51%) 100 (-30%)
node_database_size_in_bytes 18,796,624 35,258,448 (-1%)
pxe_database_size_in_bytes 29,923 59,478

Circuits stats

Stats on running time and I/O sizes collected for every circuit run across all benchmarks.

Circuit circuit_simulation_time_in_ms circuit_input_size_in_bytes circuit_output_size_in_bytes
private-kernel-init 243 (-1%) 44,736 28,001
private-kernel-ordering 174 (-1%) 52,625 14,627
base-rollup 1,257 (-2%) 177,932 933
root-rollup 68.9 (-2%) 4,192 825
private-kernel-inner 309 (-1%) 73,715 28,001
public-kernel-app-logic 186 (-2%) 32,254 25,379
merge-rollup 5.56 (-3%) 2,712 933

Tree insertion stats

The duration to insert a fixed batch of leaves into each tree type.

Metric 1 leaves 2 leaves 8 leaves 16 leaves 32 leaves 64 leaves 128 leaves 512 leaves 1024 leaves 2048 leaves 4096 leaves
batch_insert_into_append_only_tree_16_depth_ms 9.64 (-2%) 10.2 (-5%) 14.8 (+1%) 15.9 (-1%) 21.5 (-3%) 35.4 (+1%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.9 17.5 23.0 31.6 47.0 79.0 N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.560 (-2%) 0.567 (-5%) 0.631 (+2%) 0.492 (-2%) 0.452 (-3%) 0.441 N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A N/A N/A N/A 44.8 (-2%) 70.5 (-2%) 233 (+1%) 430 (-3%) 852 (-3%) 1,686 (-4%)
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A N/A N/A N/A 96.0 159 543 1,055 2,079 4,127
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A N/A N/A N/A 0.459 (-2%) 0.436 (-2%) 0.425 (+1%) 0.403 (-3%) 0.406 (-3%) 0.405 (-3%)
batch_insert_into_indexed_tree_20_depth_ms N/A N/A N/A N/A N/A 52.6 (-2%) 105 (-1%) 342 (+1%) 635 (-4%) 1,308 (-1%) 2,578 (-1%)
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A N/A N/A N/A 104 207 691 1,363 2,707 5,395
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A N/A N/A N/A 0.468 (-2%) 0.471 (-2%) 0.462 (+1%) 0.438 (-3%) 0.453 (-1%) 0.447 (-2%)
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A 59.5 (-3%) N/A N/A N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A 109 N/A N/A N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A 0.521 (-3%) N/A N/A N/A N/A N/A N/A

Miscellaneous

Transaction sizes based on how many contracts are deployed in the tx.

Metric 0 deployed contracts
tx_size_in_bytes 19,179

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes
tx_pxe_processing_time_ms 2,541 (+1%) 1,323 (-1%)
Metric 0 public data writes 1 public data writes
tx_sequencer_processing_time_ms 0.0294 (-1%) 455 (-2%)

@spalladino spalladino marked this pull request as ready for review March 1, 2024 22:43
Base automatically changed from palla/contract-deploy-19 to master March 4, 2024 09:55
@spalladino spalladino enabled auto-merge (squash) March 5, 2024 17:07
@spalladino spalladino merged commit 4550f25 into master Mar 5, 2024
73 of 75 checks passed
@spalladino spalladino deleted the palla/contract-deploy-20 branch March 5, 2024 17:27
spalladino added a commit that referenced this pull request Mar 5, 2024
rahul-kothari pushed a commit that referenced this pull request Mar 5, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-package: 0.26.0</summary>

##
[0.26.0](aztec-package-v0.25.0...aztec-package-v0.26.0)
(2024-03-05)


### ⚠ BREAKING CHANGES

* move noir out of yarn-project
([#4479](#4479))
* note type ids
([#4500](#4500))
* aztec binary
([#3927](#3927))

### Features

* Aztec binary
([#3927](#3927))
([12356d9](12356d9))
* Note type ids
([#4500](#4500))
([e1da2fd](e1da2fd))
* Parallel native/wasm bb builds. Better messaging around using ci
cache.
([#4766](#4766))
([a924e55](a924e55))


### Bug Fixes

* Add new oracle contract to devnet in CI
([#4687](#4687))
([920fa10](920fa10))
* Add registry contract to list
([#4694](#4694))
([3675e1d](3675e1d))
* Aztec binary fixes
([#4273](#4273))
([84e1f7d](84e1f7d))
* L1 contract address config
([#4684](#4684))
([20e7605](20e7605))
* P2p-bootstrap ECS command + /status route
([#4682](#4682))
([21ec23d](21ec23d))
* Relative LogFn import
([#4328](#4328))
([1faead5](1faead5))


### Miscellaneous

* Lift rollup address check & deplot kv-store to npm
([#4483](#4483))
([92d0aa4](92d0aa4))
* Move noir out of yarn-project
([#4479](#4479))
([1fe674b](1fe674b)),
closes
[#4107](#4107)
* Squash yp ypb + other build improvements.
([#4901](#4901))
([be5855c](be5855c))
* Updating viem
([#4783](#4783))
([23bc26a](23bc26a))
</details>

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

##
[0.26.0](barretenberg.js-v0.25.0...barretenberg.js-v0.26.0)
(2024-03-05)


### Miscellaneous

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

<details><summary>aztec-cli: 0.26.0</summary>

##
[0.26.0](aztec-cli-v0.25.0...aztec-cli-v0.26.0)
(2024-03-05)


### ⚠ BREAKING CHANGES

* Use new deployment flow in ContractDeployer
([#4497](#4497))
* move noir out of yarn-project
([#4479](#4479))
* note type ids
([#4500](#4500))
* Include contract class id in deployment info
([#4223](#4223))
* aztec binary
([#3927](#3927))

### Features

* **avm-transpiler:** Brillig to AVM transpiler
([#4227](#4227))
([c366c6e](c366c6e))
* Aztec binary
([#3927](#3927))
([12356d9](12356d9))
* Aztec.js API for registering a contract class
([#4469](#4469))
([d566c74](d566c74))
* Include contract class id in deployment info
([#4223](#4223))
([0ed4126](0ed4126)),
closes
[#4054](#4054)
* Moving the unbox option to npx command
([#4718](#4718))
([4c3bb92](4c3bb92))
* Note type ids
([#4500](#4500))
([e1da2fd](e1da2fd))
* Parallel native/wasm bb builds. Better messaging around using ci
cache.
([#4766](#4766))
([a924e55](a924e55))
* Use new deployment flow in ContractDeployer
([#4497](#4497))
([0702dc6](0702dc6))


### Bug Fixes

* Add new oracle contract to devnet in CI
([#4687](#4687))
([920fa10](920fa10))
* Load contract artifact from json
([#4352](#4352))
([47a0a79](47a0a79))


### Miscellaneous

* **docs:** Fix a few links to docs
([#4260](#4260))
([1c8ea49](1c8ea49))
* Move noir out of yarn-project
([#4479](#4479))
([1fe674b](1fe674b)),
closes
[#4107](#4107)
* Remove stubbed docs
([#4196](#4196))
([25a4bc4](25a4bc4))
* Squash yp ypb + other build improvements.
([#4901](#4901))
([be5855c](be5855c))
* Updating viem
([#4783](#4783))
([23bc26a](23bc26a))
</details>

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

##
[0.26.0](aztec-packages-v0.25.0...aztec-packages-v0.26.0)
(2024-03-05)


### ⚠ BREAKING CHANGES

* Internal as a macro
([#4898](#4898))

### Features

* Add init check by default to public fns
([#4897](#4897))
([4550f25](4550f25))
* Enable public constructor functions
([#4896](#4896))
([7b06895](7b06895))
* Internal as a macro
([#4898](#4898))
([73d640a](73d640a))
* We no longer update version packages via scripts
([#4962](#4962))
([31d470b](31d470b))


### Miscellaneous

* Disable failing test temporarily
([ec61974](ec61974))
* Fixed call nesting, tests and docs
([#4932](#4932))
([bd5c879](bd5c879))
* Specify packages individually for release-please
([#4960](#4960))
([dddc35f](dddc35f))
* Sync noir repo
([#4947](#4947))
([7ff9b71](7ff9b71))
* Unused vars cleanup + updated TODOs
([#4883](#4883))
([3747619](3747619))
* Update escrow to use PrivateImmutable
([#4942](#4942))
([245d801](245d801))
</details>

<details><summary>barretenberg: 0.26.0</summary>

##
[0.26.0](barretenberg-v0.25.0...barretenberg-v0.26.0)
(2024-03-05)


### 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).
github-merge-queue bot pushed a commit to noir-lang/noir that referenced this pull request Mar 5, 2024
BEGIN_COMMIT_OVERRIDE
feat: Add init check by default to public fns
(AztecProtocol/aztec-packages#4897)
feat: Enable public constructor functions
(AztecProtocol/aztec-packages#4896)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
AztecBot added a commit to AztecProtocol/barretenberg that referenced this pull request Mar 6, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-package: 0.26.0</summary>

##
[0.26.0](AztecProtocol/aztec-packages@aztec-package-v0.25.0...aztec-package-v0.26.0)
(2024-03-05)


### ⚠ BREAKING CHANGES

* move noir out of yarn-project
([#4479](AztecProtocol/aztec-packages#4479))
* note type ids
([#4500](AztecProtocol/aztec-packages#4500))
* aztec binary
([#3927](AztecProtocol/aztec-packages#3927))

### Features

* Aztec binary
([#3927](AztecProtocol/aztec-packages#3927))
([12356d9](AztecProtocol/aztec-packages@12356d9))
* Note type ids
([#4500](AztecProtocol/aztec-packages#4500))
([e1da2fd](AztecProtocol/aztec-packages@e1da2fd))
* Parallel native/wasm bb builds. Better messaging around using ci
cache.
([#4766](AztecProtocol/aztec-packages#4766))
([a924e55](AztecProtocol/aztec-packages@a924e55))


### Bug Fixes

* Add new oracle contract to devnet in CI
([#4687](AztecProtocol/aztec-packages#4687))
([920fa10](AztecProtocol/aztec-packages@920fa10))
* Add registry contract to list
([#4694](AztecProtocol/aztec-packages#4694))
([3675e1d](AztecProtocol/aztec-packages@3675e1d))
* Aztec binary fixes
([#4273](AztecProtocol/aztec-packages#4273))
([84e1f7d](AztecProtocol/aztec-packages@84e1f7d))
* L1 contract address config
([#4684](AztecProtocol/aztec-packages#4684))
([20e7605](AztecProtocol/aztec-packages@20e7605))
* P2p-bootstrap ECS command + /status route
([#4682](AztecProtocol/aztec-packages#4682))
([21ec23d](AztecProtocol/aztec-packages@21ec23d))
* Relative LogFn import
([#4328](AztecProtocol/aztec-packages#4328))
([1faead5](AztecProtocol/aztec-packages@1faead5))


### Miscellaneous

* Lift rollup address check & deplot kv-store to npm
([#4483](AztecProtocol/aztec-packages#4483))
([92d0aa4](AztecProtocol/aztec-packages@92d0aa4))
* Move noir out of yarn-project
([#4479](AztecProtocol/aztec-packages#4479))
([1fe674b](AztecProtocol/aztec-packages@1fe674b)),
closes
[#4107](AztecProtocol/aztec-packages#4107)
* Squash yp ypb + other build improvements.
([#4901](AztecProtocol/aztec-packages#4901))
([be5855c](AztecProtocol/aztec-packages@be5855c))
* Updating viem
([#4783](AztecProtocol/aztec-packages#4783))
([23bc26a](AztecProtocol/aztec-packages@23bc26a))
</details>

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

##
[0.26.0](AztecProtocol/aztec-packages@barretenberg.js-v0.25.0...barretenberg.js-v0.26.0)
(2024-03-05)


### Miscellaneous

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

<details><summary>aztec-cli: 0.26.0</summary>

##
[0.26.0](AztecProtocol/aztec-packages@aztec-cli-v0.25.0...aztec-cli-v0.26.0)
(2024-03-05)


### ⚠ BREAKING CHANGES

* Use new deployment flow in ContractDeployer
([#4497](AztecProtocol/aztec-packages#4497))
* move noir out of yarn-project
([#4479](AztecProtocol/aztec-packages#4479))
* note type ids
([#4500](AztecProtocol/aztec-packages#4500))
* Include contract class id in deployment info
([#4223](AztecProtocol/aztec-packages#4223))
* aztec binary
([#3927](AztecProtocol/aztec-packages#3927))

### Features

* **avm-transpiler:** Brillig to AVM transpiler
([#4227](AztecProtocol/aztec-packages#4227))
([c366c6e](AztecProtocol/aztec-packages@c366c6e))
* Aztec binary
([#3927](AztecProtocol/aztec-packages#3927))
([12356d9](AztecProtocol/aztec-packages@12356d9))
* Aztec.js API for registering a contract class
([#4469](AztecProtocol/aztec-packages#4469))
([d566c74](AztecProtocol/aztec-packages@d566c74))
* Include contract class id in deployment info
([#4223](AztecProtocol/aztec-packages#4223))
([0ed4126](AztecProtocol/aztec-packages@0ed4126)),
closes
[#4054](AztecProtocol/aztec-packages#4054)
* Moving the unbox option to npx command
([#4718](AztecProtocol/aztec-packages#4718))
([4c3bb92](AztecProtocol/aztec-packages@4c3bb92))
* Note type ids
([#4500](AztecProtocol/aztec-packages#4500))
([e1da2fd](AztecProtocol/aztec-packages@e1da2fd))
* Parallel native/wasm bb builds. Better messaging around using ci
cache.
([#4766](AztecProtocol/aztec-packages#4766))
([a924e55](AztecProtocol/aztec-packages@a924e55))
* Use new deployment flow in ContractDeployer
([#4497](AztecProtocol/aztec-packages#4497))
([0702dc6](AztecProtocol/aztec-packages@0702dc6))


### Bug Fixes

* Add new oracle contract to devnet in CI
([#4687](AztecProtocol/aztec-packages#4687))
([920fa10](AztecProtocol/aztec-packages@920fa10))
* Load contract artifact from json
([#4352](AztecProtocol/aztec-packages#4352))
([47a0a79](AztecProtocol/aztec-packages@47a0a79))


### Miscellaneous

* **docs:** Fix a few links to docs
([#4260](AztecProtocol/aztec-packages#4260))
([1c8ea49](AztecProtocol/aztec-packages@1c8ea49))
* Move noir out of yarn-project
([#4479](AztecProtocol/aztec-packages#4479))
([1fe674b](AztecProtocol/aztec-packages@1fe674b)),
closes
[#4107](AztecProtocol/aztec-packages#4107)
* Remove stubbed docs
([#4196](AztecProtocol/aztec-packages#4196))
([25a4bc4](AztecProtocol/aztec-packages@25a4bc4))
* Squash yp ypb + other build improvements.
([#4901](AztecProtocol/aztec-packages#4901))
([be5855c](AztecProtocol/aztec-packages@be5855c))
* Updating viem
([#4783](AztecProtocol/aztec-packages#4783))
([23bc26a](AztecProtocol/aztec-packages@23bc26a))
</details>

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

##
[0.26.0](AztecProtocol/aztec-packages@aztec-packages-v0.25.0...aztec-packages-v0.26.0)
(2024-03-05)


### ⚠ BREAKING CHANGES

* Internal as a macro
([#4898](AztecProtocol/aztec-packages#4898))

### Features

* Add init check by default to public fns
([#4897](AztecProtocol/aztec-packages#4897))
([4550f25](AztecProtocol/aztec-packages@4550f25))
* Enable public constructor functions
([#4896](AztecProtocol/aztec-packages#4896))
([7b06895](AztecProtocol/aztec-packages@7b06895))
* Internal as a macro
([#4898](AztecProtocol/aztec-packages#4898))
([73d640a](AztecProtocol/aztec-packages@73d640a))
* We no longer update version packages via scripts
([#4962](AztecProtocol/aztec-packages#4962))
([31d470b](AztecProtocol/aztec-packages@31d470b))


### Miscellaneous

* Disable failing test temporarily
([ec61974](AztecProtocol/aztec-packages@ec61974))
* Fixed call nesting, tests and docs
([#4932](AztecProtocol/aztec-packages#4932))
([bd5c879](AztecProtocol/aztec-packages@bd5c879))
* Specify packages individually for release-please
([#4960](AztecProtocol/aztec-packages#4960))
([dddc35f](AztecProtocol/aztec-packages@dddc35f))
* Sync noir repo
([#4947](AztecProtocol/aztec-packages#4947))
([7ff9b71](AztecProtocol/aztec-packages@7ff9b71))
* Unused vars cleanup + updated TODOs
([#4883](AztecProtocol/aztec-packages#4883))
([3747619](AztecProtocol/aztec-packages@3747619))
* Update escrow to use PrivateImmutable
([#4942](AztecProtocol/aztec-packages#4942))
([245d801](AztecProtocol/aztec-packages@245d801))
</details>

<details><summary>barretenberg: 0.26.0</summary>

##
[0.26.0](AztecProtocol/aztec-packages@barretenberg-v0.25.0...barretenberg-v0.26.0)
(2024-03-05)


### 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
None yet
Development

Successfully merging this pull request may close these issues.

4 participants