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

chore(boxes): adding clone contract option #4980

Merged
merged 7 commits into from
Mar 12, 2024
Merged

Conversation

signorecello
Copy link
Contributor

@signorecello signorecello commented Mar 6, 2024

Part of boxes work. Quick summary of this PR:

  • - Refactors the choice options with a previous "menu" to choose either a "box" or a "contract"
  • - Provides a filtered list of contracts the user may want to choose
  • - Clones the respective "box" or "contract" upon user choice
  • - If it's a contract, clones a default "contract-only box" that adds some generic tests and a README with placeholders and links to the e2e tests of the same contract

Added some other quality of life changes:

  • Shameleslly polluted the global namespace (it's a small script after all) since tag, versions, stableversion, were used everywhere
  • Added colorized and verbose logs, also in the global namespace using pino and pino-pretty
  • Refactored tests and code to match a more concise version of the wallet usage

@signorecello signorecello marked this pull request as ready for review March 6, 2024 12:17
Base automatically changed from zpedro/npx_improvs to master March 6, 2024 20:35
@signorecello signorecello force-pushed the zpedro/token_box branch 2 times, most recently from 06810ea to ece96fa Compare March 7, 2024 14:23
@signorecello signorecello force-pushed the zpedro/token_box branch 2 times, most recently from 7289168 to ec1d1da Compare March 8, 2024 12:50
@signorecello signorecello requested review from alexghr and a team March 8, 2024 12:50
Copy link

socket-security bot commented Mar 10, 2024

No dependency changes detected. Learn more about Socket for GitHub ↗︎

👍 No dependency changes detected in pull request

@signorecello
Copy link
Contributor Author

@SocketSecurity ignore npm/sharp@0.30.7

boxes/contract-only/package.json Outdated Show resolved Hide resolved
boxes/scripts/steps/chooseBox.js Outdated Show resolved Hide resolved
boxes/contract-only/package.json Outdated Show resolved Hide resolved
boxes/bin.js Outdated Show resolved Hide resolved
boxes/contract-only/tests/node.test.ts Show resolved Hide resolved
boxes/scripts/utils.js Show resolved Hide resolved
boxes/contract-only/package.json Outdated Show resolved Hide resolved
boxes/contract-only/README.md Outdated Show resolved Hide resolved
boxes/contract-only/package.json Show resolved Hide resolved
@signorecello signorecello merged commit a427aa5 into master Mar 12, 2024
95 of 96 checks passed
@signorecello signorecello deleted the zpedro/token_box branch March 12, 2024 17:14
@AztecBot
Copy link
Collaborator

Benchmark results

Metrics with a significant change:

  • circuit_simulation_time_in_ms (public-kernel-tail): 175 (+88%)
  • circuit_input_size_in_bytes (public-kernel-tail): 40,926 (+20%)
  • note_trial_decrypting_time_in_ms (64): 102 (+80%)
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 ef10d657 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,668 18,820 36,356
l1_rollup_calldata_gas 65,968 238,756 469,316
l1_rollup_execution_gas 666,600 953,617 1,336,624
l2_block_processing_time_in_ms 1,307 4,760 (-1%) 9,088 (+2%)
note_successful_decrypting_time_in_ms 134 (-2%) 488 (+2%) 970 (-6%)
note_trial_decrypting_time_in_ms 41.3 (+6%) 103 (+8%) ⚠️ 102 (+80%)
l2_block_building_time_in_ms 12,795 (+6%) 50,715 (+3%) 100,811 (+6%)
l2_block_rollup_simulation_time_in_ms 7,000 (-1%) 27,788 (-1%) 55,484 (-1%)
l2_block_public_tx_process_time_in_ms 5,772 (+15%) 22,867 (+9%) 45,227 (+15%)

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,826 (-7%) 27,326 (+1%)
note_history_successful_decrypting_time_in_ms 1,273 (+1%) 2,453 (-1%)
note_history_trial_decrypting_time_in_ms 99.9 (-3%) 160 (-15%)
node_database_size_in_bytes 19,034,192 35,676,240
pxe_database_size_in_bytes 29,859 59,414

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 274 44,338 27,700
private-kernel-ordering 205 52,324 14,326
base-rollup 629 (-1%) 177,083 925
root-rollup 67.9 (-1%) 4,176 789
private-kernel-inner 360 73,197 27,700
public-kernel-app-logic 185 (+2%) 35,198 (+2%) 28,215 (+2%)
public-kernel-tail ⚠️ 175 (+88%) ⚠️ 40,926 (+20%) 28,215 (+2%)
merge-rollup 8.28 (-1%) 2,696 925

Tree insertion stats

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

Metric 1 leaves 16 leaves 64 leaves 128 leaves 512 leaves 1024 leaves 2048 leaves 4096 leaves 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 10.0 16.1 (+1%) N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.8 31.6 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.584 0.498 (+1%) N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 46.3 (-1%) 71.8 229 (-1%) 443 866 1,724 (-1%) N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 96.0 159 543 1,055 2,079 4,127 N/A
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.475 (-1%) 0.443 0.420 0.414 0.413 0.413 (-1%) N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 53.4 106 (-1%) 336 659 1,313 2,584 (-1%) N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 104 207 691 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.477 0.480 0.457 0.454 0.454 0.450 N/A
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A N/A N/A N/A N/A 60.9
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A N/A N/A N/A N/A 109
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A N/A N/A N/A N/A 0.533

Miscellaneous

Transaction sizes based on how many contract classes are registered in the tx.

Metric 0 registered classes
tx_size_in_bytes 22,014

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes
tx_pxe_processing_time_ms 3,057 1,434
Metric 0 public data writes 1 public data writes
tx_sequencer_processing_time_ms 15.2 (+6%) 716 (+15%)

critesjosh pushed a commit that referenced this pull request Mar 12, 2024
🤖 I have created a release *beep* *boop*
---


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

##
[0.27.1](aztec-package-v0.27.0...aztec-package-v0.27.1)
(2024-03-12)


### Miscellaneous

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

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

##
[0.27.1](barretenberg.js-v0.27.0...barretenberg.js-v0.27.1)
(2024-03-12)


### Miscellaneous

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

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

##
[0.27.1](aztec-cli-v0.27.0...aztec-cli-v0.27.1)
(2024-03-12)


### Miscellaneous

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

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

##
[0.27.1](aztec-packages-v0.27.0...aztec-packages-v0.27.1)
(2024-03-12)


### Features

* Further ClientIVC breakdown
([#5146](#5146))
([c8e1cb8](c8e1cb8))
* Nullifier non membership
([#5152](#5152))
([426bd6d](426bd6d))


### Bug Fixes

* Increase the json limit for RPC requests
([#5161](#5161))
([419958c](419958c))
* Move timers for ClientIVC breakdown
([#5145](#5145))
([5457edb](5457edb))


### Miscellaneous

* **boxes:** Adding clone contract option
([#4980](#4980))
([a427aa5](a427aa5))
* Share code between provers
([#4655](#4655))
([ef10d65](ef10d65))
</details>

<details><summary>barretenberg: 0.27.1</summary>

##
[0.27.1](barretenberg-v0.27.0...barretenberg-v0.27.1)
(2024-03-12)


### Features

* Further ClientIVC breakdown
([#5146](#5146))
([c8e1cb8](c8e1cb8))


### Bug Fixes

* Move timers for ClientIVC breakdown
([#5145](#5145))
([5457edb](5457edb))


### Miscellaneous

* Share code between provers
([#4655](#4655))
([ef10d65](ef10d65))
</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 13, 2024
🤖 I have created a release *beep* *boop*
---


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

##
[0.27.1](AztecProtocol/aztec-packages@aztec-package-v0.27.0...aztec-package-v0.27.1)
(2024-03-12)


### Miscellaneous

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

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

##
[0.27.1](AztecProtocol/aztec-packages@barretenberg.js-v0.27.0...barretenberg.js-v0.27.1)
(2024-03-12)


### Miscellaneous

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

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

##
[0.27.1](AztecProtocol/aztec-packages@aztec-cli-v0.27.0...aztec-cli-v0.27.1)
(2024-03-12)


### Miscellaneous

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

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

##
[0.27.1](AztecProtocol/aztec-packages@aztec-packages-v0.27.0...aztec-packages-v0.27.1)
(2024-03-12)


### Features

* Further ClientIVC breakdown
([#5146](AztecProtocol/aztec-packages#5146))
([c8e1cb8](AztecProtocol/aztec-packages@c8e1cb8))
* Nullifier non membership
([#5152](AztecProtocol/aztec-packages#5152))
([426bd6d](AztecProtocol/aztec-packages@426bd6d))


### Bug Fixes

* Increase the json limit for RPC requests
([#5161](AztecProtocol/aztec-packages#5161))
([419958c](AztecProtocol/aztec-packages@419958c))
* Move timers for ClientIVC breakdown
([#5145](AztecProtocol/aztec-packages#5145))
([5457edb](AztecProtocol/aztec-packages@5457edb))


### Miscellaneous

* **boxes:** Adding clone contract option
([#4980](AztecProtocol/aztec-packages#4980))
([a427aa5](AztecProtocol/aztec-packages@a427aa5))
* Share code between provers
([#4655](AztecProtocol/aztec-packages#4655))
([ef10d65](AztecProtocol/aztec-packages@ef10d65))
</details>

<details><summary>barretenberg: 0.27.1</summary>

##
[0.27.1](AztecProtocol/aztec-packages@barretenberg-v0.27.0...barretenberg-v0.27.1)
(2024-03-12)


### Features

* Further ClientIVC breakdown
([#5146](AztecProtocol/aztec-packages#5146))
([c8e1cb8](AztecProtocol/aztec-packages@c8e1cb8))


### Bug Fixes

* Move timers for ClientIVC breakdown
([#5145](AztecProtocol/aztec-packages#5145))
([5457edb](AztecProtocol/aztec-packages@5457edb))


### Miscellaneous

* Share code between provers
([#4655](AztecProtocol/aztec-packages#4655))
([ef10d65](AztecProtocol/aztec-packages@ef10d65))
</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