Skip to content

chore(boxes): refactor npx to improve readability, added upgrade option and manual versioning#4855

Merged
signorecello merged 3 commits into
masterfrom
zpedro/npx_improvs
Mar 6, 2024
Merged

chore(boxes): refactor npx to improve readability, added upgrade option and manual versioning#4855
signorecello merged 3 commits into
masterfrom
zpedro/npx_improvs

Conversation

@signorecello

@signorecello signorecello commented Feb 29, 2024

Copy link
Copy Markdown
Contributor

Part of the Boxes work, this change splits the npx files into multiple different ones and:

  • Adds a "skip" option if you don't want to clone any box (i.e. you just want to install or update the sandbox)
  • You can now pass "latest", "master", or any semver version to a VERSION env variable when you run the script (ex. VERSION=master npx create-aztec-app). It fetch the existent boxes at that point in time for the user to choose, and clones them
  • The sandbox section now checks for the docker version of the sandbox and prompts to download it if it doesn't match the required version
  • Some other minor quality of life updates

signorecello commented Feb 29, 2024

Copy link
Copy Markdown
Contributor Author

@signorecello signorecello marked this pull request as ready for review February 29, 2024 13:03
@AztecBot

AztecBot commented Feb 29, 2024

Copy link
Copy Markdown
Collaborator

Benchmark results

Metrics with a significant change:

  • note_successful_decrypting_time_in_ms (32): 662 (+24%)
  • note_trial_decrypting_time_in_ms (8): 110 (+1272%)
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 dddc35f3 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,072 238,964 470,012
l1_rollup_execution_gas 194,020 500,270 909,270
l2_block_processing_time_in_ms 1,193 4,478 (-1%) 8,600 (-3%)
note_successful_decrypting_time_in_ms 198 (-1%) ⚠️ 662 (+24%) 961 (-3%)
note_trial_decrypting_time_in_ms ⚠️ 110 (+1272%) 83.8 (+45%) 93.3 (-23%)
l2_block_building_time_in_ms 16,134 (-1%) 64,347 124,774 (-3%)
l2_block_rollup_simulation_time_in_ms 12,251 (-1%) 48,759 (-1%) 94,515 (-4%)
l2_block_public_tx_process_time_in_ms 3,853 15,481 (+1%) 30,137 (-2%)

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 15,005 (+5%) 28,078 (+3%)
note_history_successful_decrypting_time_in_ms 1,246 (+1%) 2,466 (+2%)
note_history_trial_decrypting_time_in_ms 92.9 (+73%) 133 (+1%)
node_database_size_in_bytes 18,817,104 35,586,128
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 245 (-3%) 44,736 28,001
private-kernel-ordering 176 (-9%) 52,625 14,627
base-rollup 1,263 (-5%) 177,932 933
root-rollup 72.5 (+4%) 4,192 825
private-kernel-inner 313 (-2%) 73,715 28,001
public-kernel-app-logic 189 (-4%) 32,254 25,379
merge-rollup 5.61 (-2%) 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.78 (-1%) 10.1 (-8%) 14.8 (+4%) 16.4 (-1%) 21.9 (-3%) 34.6 (-2%) 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.567 (-1%) 0.561 (-8%) 0.632 (+5%) 0.503 (-2%) 0.460 (-2%) 0.432 (-2%) 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 45.1 (-1%) 70.8 (-2%) 230 429 (-3%) 867 1,659 (-3%)
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.463 (-1%) 0.438 (-2%) 0.420 0.402 (-3%) 0.413 0.398 (-3%)
batch_insert_into_indexed_tree_20_depth_ms N/A N/A N/A N/A N/A 54.2 (+1%) 105 (-2%) 340 638 (-4%) 1,308 2,531 (-3%)
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.481 0.474 (-2%) 0.459 0.439 (-5%) 0.455 0.439 (-3%)
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A 59.6 (-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.522 (-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,544 (-3%) 1,336 (-3%)
Metric 0 public data writes 1 public data writes
tx_sequencer_processing_time_ms 0.0323 (+15%) 462 (-4%)

@signorecello signorecello force-pushed the zpedro/npx_improvs branch 2 times, most recently from 2302f00 to c9a78aa Compare February 29, 2024 15:11
@signorecello signorecello force-pushed the zpedro/boxes_ftest_react branch from c8cd2ad to 02b1e10 Compare February 29, 2024 15:27
@signorecello signorecello force-pushed the zpedro/npx_improvs branch 2 times, most recently from 91e3e11 to 8646cd2 Compare February 29, 2024 17:08
@signorecello signorecello force-pushed the zpedro/boxes_ftest_react branch from 294ef15 to 62aae1f Compare March 1, 2024 09:35
@signorecello signorecello force-pushed the zpedro/npx_improvs branch 2 times, most recently from 580e60a to e3ba6d1 Compare March 1, 2024 10:49
@signorecello signorecello changed the base branch from zpedro/boxes_ftest_react to master March 1, 2024 10:49
@signorecello signorecello changed the base branch from master to zpedro/boxes_ftest_react March 1, 2024 11:31
@signorecello signorecello force-pushed the zpedro/npx_improvs branch 2 times, most recently from 7f813a4 to 2bed859 Compare March 1, 2024 11:34
@signorecello signorecello force-pushed the zpedro/boxes_ftest_react branch from f438ed0 to 59fe153 Compare March 1, 2024 18:55
@signorecello signorecello force-pushed the zpedro/boxes_ftest_react branch from 59fe153 to 2538c2a Compare March 4, 2024 10:28
@signorecello signorecello force-pushed the zpedro/boxes_ftest_react branch from 2538c2a to cff058c Compare March 4, 2024 10:57
@signorecello signorecello force-pushed the zpedro/boxes_ftest_react branch 2 times, most recently from b9e13a8 to f6e439f Compare March 4, 2024 17:38
Base automatically changed from zpedro/boxes_ftest_react to master March 5, 2024 11:08
@signorecello signorecello force-pushed the zpedro/npx_improvs branch 2 times, most recently from e8e4c92 to 7f51cab Compare March 5, 2024 12:03

@alexghr alexghr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IIUC npx create-aztec-app combines the sandbox installer with the aztec-cli unbox command?

Comment thread boxes/bin.js Outdated
Comment thread boxes/scripts/steps/sandbox/install.js Outdated
Comment thread boxes/scripts/steps/sandbox/install.js Outdated
Comment thread boxes/scripts/steps/sandbox/run.js Outdated
Comment thread boxes/bin.js Outdated
@signorecello

Copy link
Copy Markdown
Contributor Author

Yep exactly!

It is meant to replace the unbox command (which no longer exists). But it's not meant to replace the installer (it actually runs it, as you've seen), more like providing a "yes/no" interface to use it, and reduce the time needed to see your app on the screen

@signorecello

Copy link
Copy Markdown
Contributor Author

btw you should be able to run npm create aztec. But I haven't tested it yet 😊

@signorecello signorecello merged commit ef76d3f into master Mar 6, 2024
@signorecello signorecello deleted the zpedro/npx_improvs branch March 6, 2024 20:35
PhilWindle pushed a commit that referenced this pull request Mar 7, 2024
🤖 I have created a release *beep* *boop*
---


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

##
[0.26.5](aztec-package-v0.26.4...aztec-package-v0.26.5)
(2024-03-07)


### Features

* Integrated native ACVM
([#4903](#4903))
([3fd7025](3fd7025))
</details>

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

##
[0.26.5](barretenberg.js-v0.26.4...barretenberg.js-v0.26.5)
(2024-03-07)


### Miscellaneous

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

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

##
[0.26.5](aztec-cli-v0.26.4...aztec-cli-v0.26.5)
(2024-03-07)


### Miscellaneous

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

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

##
[0.26.5](aztec-packages-v0.26.4...aztec-packages-v0.26.5)
(2024-03-07)


### Features

* Crowdfunding contract
([#4917](#4917))
([ba3aff2](ba3aff2))
* Integrated native ACVM
([#4903](#4903))
([3fd7025](3fd7025))


### Bug Fixes

* Dependency for yarn-project-tests
([#5031](#5031))
([4b5db50](4b5db50))
* **docs:** Update writing_token_contract.md
([#5020](#5020))
([5b0f38f](5b0f38f))
* End to end dependency fix
([#5029](#5029))
([191ad93](191ad93))
* Missing dependency end-to-end =&gt; yarn-project
([#5018](#5018))
([f930bdd](f930bdd))
* **revert:** "feat(avm): storage"
([#5019](#5019))
([ba31016](ba31016))


### Miscellaneous

* **boxes:** Refactor npx to improve readability, added upgrade option
and manual versioning
([#4855](#4855))
([ef76d3f](ef76d3f))
* Purging calldata hash
([#4984](#4984))
([f6f34b7](f6f34b7))


### Documentation

* Add versions section to updating doc
([#4916](#4916))
([d4d935f](d4d935f))
</details>

<details><summary>barretenberg: 0.26.5</summary>

##
[0.26.5](barretenberg-v0.26.4...barretenberg-v0.26.5)
(2024-03-07)


### 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 Mar 8, 2024
🤖 I have created a release *beep* *boop*
---


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

##
[0.26.5](AztecProtocol/aztec-packages@aztec-package-v0.26.4...aztec-package-v0.26.5)
(2024-03-07)


### Features

* Integrated native ACVM
([#4903](AztecProtocol/aztec-packages#4903))
([3fd7025](AztecProtocol/aztec-packages@3fd7025))
</details>

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

##
[0.26.5](AztecProtocol/aztec-packages@barretenberg.js-v0.26.4...barretenberg.js-v0.26.5)
(2024-03-07)


### Miscellaneous

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

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

##
[0.26.5](AztecProtocol/aztec-packages@aztec-cli-v0.26.4...aztec-cli-v0.26.5)
(2024-03-07)


### Miscellaneous

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

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

##
[0.26.5](AztecProtocol/aztec-packages@aztec-packages-v0.26.4...aztec-packages-v0.26.5)
(2024-03-07)


### Features

* Crowdfunding contract
([#4917](AztecProtocol/aztec-packages#4917))
([ba3aff2](AztecProtocol/aztec-packages@ba3aff2))
* Integrated native ACVM
([#4903](AztecProtocol/aztec-packages#4903))
([3fd7025](AztecProtocol/aztec-packages@3fd7025))


### Bug Fixes

* Dependency for yarn-project-tests
([#5031](AztecProtocol/aztec-packages#5031))
([4b5db50](AztecProtocol/aztec-packages@4b5db50))
* **docs:** Update writing_token_contract.md
([#5020](AztecProtocol/aztec-packages#5020))
([5b0f38f](AztecProtocol/aztec-packages@5b0f38f))
* End to end dependency fix
([#5029](AztecProtocol/aztec-packages#5029))
([191ad93](AztecProtocol/aztec-packages@191ad93))
* Missing dependency end-to-end =&gt; yarn-project
([#5018](AztecProtocol/aztec-packages#5018))
([f930bdd](AztecProtocol/aztec-packages@f930bdd))
* **revert:** "feat(avm): storage"
([#5019](AztecProtocol/aztec-packages#5019))
([ba31016](AztecProtocol/aztec-packages@ba31016))


### Miscellaneous

* **boxes:** Refactor npx to improve readability, added upgrade option
and manual versioning
([#4855](AztecProtocol/aztec-packages#4855))
([ef76d3f](AztecProtocol/aztec-packages@ef76d3f))
* Purging calldata hash
([#4984](AztecProtocol/aztec-packages#4984))
([f6f34b7](AztecProtocol/aztec-packages@f6f34b7))


### Documentation

* Add versions section to updating doc
([#4916](AztecProtocol/aztec-packages#4916))
([d4d935f](AztecProtocol/aztec-packages@d4d935f))
</details>

<details><summary>barretenberg: 0.26.5</summary>

##
[0.26.5](AztecProtocol/aztec-packages@barretenberg-v0.26.4...barretenberg-v0.26.5)
(2024-03-07)


### 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.

3 participants