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

refactor: aztec-cli better volume mounting strategy #3138

Merged
merged 7 commits into from
Nov 7, 2023

Conversation

alexghr
Copy link
Contributor

@alexghr alexghr commented Oct 31, 2023

This PR changes aztec-cli.sh's mounting strategy to be more generic, ensuring fewer updates are necessary as new commands are added.

Previous strategy: "for these commands A,B,C,etc, recognize these flags and positional parameters as files/directories. Edge case: for the unbox command, mkdir first then mount"

New strategy: "go through every CLI arg and if it looks like a file or a directory, mount it in the container. Edge case: for the unbox command, mkdir first then mount"

Checklist:

Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.

  • If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag.
  • I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code.
  • Every change is related to the PR description.
  • I have linked this pull request to relevant issues (if any exist).

Comment on lines +124 to +131
if [[ -f "$arg_value" || -d "$arg_value" ]]; then
add_mount "$arg_value"
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically add_mount already checks that its argument is an existing directory so this if statement could be skipped.

@alexghr alexghr force-pushed the alexg/refactor/dockerized-aztec-cli-mounting branch from 58d1bf8 to d299ca4 Compare October 31, 2023 14:40
For commands like `compute-selector` which take arguments with reserved
characters, the bash wrapper script required callers to triple escape
characters, e.g. what normally would have been

aztec-cli compute-selector foo\(Field\)

using the `eval $DOCKER_CMD` approach required:

aztec-cli computer-selector foo\\\(Field\\\)

Replacing the `eval` with directly running the command fixed it.
@alexghr alexghr force-pushed the alexg/refactor/dockerized-aztec-cli-mounting branch from d65e4cb to 8f03ad1 Compare November 2, 2023 15:45
@AztecBot
Copy link
Collaborator

AztecBot commented Nov 2, 2023

Benchmark results

Metrics with a significant change:

  • note_trial_decrypting_time_in_ms (8): 98.0 (+2350%)
  • note_trial_decrypting_time_in_ms (32): 10.0 (-88%)
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 d02726fd 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 128 txs
l1_rollup_calldata_size_in_bytes 45,444 179,588 716,132
l1_rollup_calldata_gas 222,924 867,884 3,449,504
l1_rollup_execution_gas 842,011 3,594,992 22,204,873
l2_block_processing_time_in_ms 1,987 (-2%) 7,652 (+1%) 29,671 (-1%)
note_successful_decrypting_time_in_ms 296 (-1%) 902 (+3%) 3,152 (-2%)
note_trial_decrypting_time_in_ms ⚠️ 98.0 (+2350%) ⚠️ 10.0 (-88%) 133 (-1%)
l2_block_building_time_in_ms 13,131 (-2%) 52,512 (-1%) 209,699
l2_block_rollup_simulation_time_in_ms 11,796 (-2%) 47,195 188,662
l2_block_public_tx_process_time_in_ms 1,290 (-2%) 5,185 (-1%) 20,550 (-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 21,617 (-1%) 41,990 (-10%)
note_history_successful_decrypting_time_in_ms 1,990 (-4%) 3,913 (-8%)
note_history_trial_decrypting_time_in_ms 121 (+1%) 144 (-1%)
node_database_size_in_bytes 1,630,520 1,098,676
pxe_database_size_in_bytes 29,748 59,307

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 778 (-1%) 61,697 18,905
private-kernel-ordering 123 (-2%) 24,297 8,153
base-rollup 1,767 (-2%) 656,311 814
root-rollup 75.3 (-1%) 4,072 1,097
private-kernel-inner 786 (-2%) 81,568 18,905
public-kernel-private-input 41.4 (-2%) 41,519 18,841
public-kernel-non-first-iteration 26.3 (-2%) 41,497 18,841
merge-rollup 0.949 (-1%) 2,592 873

Miscellaneous

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

Metric 0 deployed contracts 1 deployed contracts
tx_size_in_bytes 8,787 27,547

@alexghr alexghr merged commit d40460e into master Nov 7, 2023
2 checks passed
@alexghr alexghr deleted the alexg/refactor/dockerized-aztec-cli-mounting branch November 7, 2023 12:39
rahul-kothari pushed a commit that referenced this pull request Nov 7, 2023
🤖 I have created a release *beep* *boop*
---


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

##
[0.14.2](aztec-packages-v0.14.1...aztec-packages-v0.14.2)
(2023-11-07)


### Features

* Load private tests and docs
([#3243](#3243))
([f3d8aae](f3d8aae)),
closes
[#1285](#1285)
* Run solidity tests for all acir artifacts
([#3161](#3161))
([d09f667](d09f667))


### Bug Fixes

* Wait for accounts to catch up with notes when deployed
([#2834](#2834))
([a8f3119](a8f3119))


### Miscellaneous

* Add noir-protocol-circuits to deploy_npm
([#3268](#3268))
([1a22cae](1a22cae))
* Aztec-cli better volume mounting strategy
([#3138](#3138))
([d40460e](d40460e))
* Disable circuits tasks
([#3253](#3253))
([e8945f8](e8945f8))
</details>

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

##
[0.14.2](barretenberg.js-v0.14.1...barretenberg.js-v0.14.2)
(2023-11-07)


### Features

* Run solidity tests for all acir artifacts
([#3161](#3161))
([d09f667](d09f667))
</details>

<details><summary>barretenberg: 0.14.2</summary>

##
[0.14.2](barretenberg-v0.14.1...barretenberg-v0.14.2)
(2023-11-07)


### Features

* Run solidity tests for all acir artifacts
([#3161](#3161))
([d09f667](d09f667))
</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 Nov 8, 2023
🤖 I have created a release *beep* *boop*
---


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

##
[0.14.2](AztecProtocol/aztec-packages@aztec-packages-v0.14.1...aztec-packages-v0.14.2)
(2023-11-07)


### Features

* Load private tests and docs
([#3243](AztecProtocol/aztec-packages#3243))
([f3d8aae](AztecProtocol/aztec-packages@f3d8aae)),
closes
[#1285](AztecProtocol/aztec-packages#1285)
* Run solidity tests for all acir artifacts
([#3161](AztecProtocol/aztec-packages#3161))
([d09f667](AztecProtocol/aztec-packages@d09f667))


### Bug Fixes

* Wait for accounts to catch up with notes when deployed
([#2834](AztecProtocol/aztec-packages#2834))
([a8f3119](AztecProtocol/aztec-packages@a8f3119))


### Miscellaneous

* Add noir-protocol-circuits to deploy_npm
([#3268](AztecProtocol/aztec-packages#3268))
([1a22cae](AztecProtocol/aztec-packages@1a22cae))
* Aztec-cli better volume mounting strategy
([#3138](AztecProtocol/aztec-packages#3138))
([d40460e](AztecProtocol/aztec-packages@d40460e))
* Disable circuits tasks
([#3253](AztecProtocol/aztec-packages#3253))
([e8945f8](AztecProtocol/aztec-packages@e8945f8))
</details>

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

##
[0.14.2](AztecProtocol/aztec-packages@barretenberg.js-v0.14.1...barretenberg.js-v0.14.2)
(2023-11-07)


### Features

* Run solidity tests for all acir artifacts
([#3161](AztecProtocol/aztec-packages#3161))
([d09f667](AztecProtocol/aztec-packages@d09f667))
</details>

<details><summary>barretenberg: 0.14.2</summary>

##
[0.14.2](AztecProtocol/aztec-packages@barretenberg-v0.14.1...barretenberg-v0.14.2)
(2023-11-07)


### Features

* Run solidity tests for all acir artifacts
([#3161](AztecProtocol/aztec-packages#3161))
([d09f667](AztecProtocol/aztec-packages@d09f667))
</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.

3 participants