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(avm-simulator): enable compressed strings unencrypted log test #5083

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

fcarreiro
Copy link
Contributor

@fcarreiro fcarreiro commented Mar 8, 2024

Now that Brillig behaves better, we can enable the compressed strings test for unencrypted logs.

Ref: #4838.

@AztecBot
Copy link
Collaborator

AztecBot commented Mar 8, 2024

Benchmark results

Metrics with a significant change:

  • circuit_simulation_time_in_ms (private-kernel-inner): 366 (+16%)
  • l2_block_public_tx_process_time_in_ms (32): 21,259 (+16%)
  • l2_block_public_tx_process_time_in_ms (64): 42,454 (+16%)
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 8b106001 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,384 239,132 470,000
l1_rollup_execution_gas 673,847 979,953 1,388,774
l2_block_processing_time_in_ms 1,327 4,911 (+1%) 9,016 (+2%)
note_successful_decrypting_time_in_ms 128 (-6%) 486 (+1%) 945
note_trial_decrypting_time_in_ms 33.7 (-17%) 104 (+8%) 84.3 (+8%)
l2_block_building_time_in_ms 12,895 (+6%) 51,966 (+9%) 102,476 (+8%)
l2_block_rollup_simulation_time_in_ms 7,656 (+2%) 30,645 (+4%) 59,899 (+3%)
l2_block_public_tx_process_time_in_ms 5,209 (+11%) ⚠️ 21,259 (+16%) ⚠️ 42,454 (+16%)

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 14,095 (+1%) 27,608 (+4%)
note_history_successful_decrypting_time_in_ms 1,282 2,498 (+4%)
note_history_trial_decrypting_time_in_ms 114 (+14%) 182 (+26%)
node_database_size_in_bytes 18,866,256 35,586,128 (+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 284 (+14%) 44,736 28,001
private-kernel-ordering 211 (+9%) 52,625 14,627
base-rollup 682 (+4%) 177,932 997
root-rollup 69.3 (+1%) 4,320 825
private-kernel-inner ⚠️ 366 (+16%) 73,715 28,001
public-kernel-app-logic 192 (+19%) 34,920 27,972
public-kernel-tail 94.6 (+17%) 34,507 27,972
merge-rollup 8.58 (+3%) 2,840 997

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.82 (+1%) 10.1 12.1 (-1%) 16.1 (+1%) 22.0 (-1%) 35.2 (+3%) 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.570 (+2%) 0.561 0.517 (-1%) 0.499 (+1%) 0.461 (-1%) 0.439 (+3%) 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 46.1 (+2%) 71.6 (-1%) 229 444 (+2%) 862 (-1%) 1,712 (+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.473 (+2%) 0.442 (-1%) 0.419 0.416 (+2%) 0.411 (-1%) 0.411 (+3%)
batch_insert_into_indexed_tree_20_depth_ms N/A N/A N/A N/A N/A 54.0 106 333 (-1%) 659 (+2%) 1,305 2,598 (+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.482 0.478 0.454 (-1%) 0.454 (+2%) 0.453 0.452 (+3%)
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A 61.1 (+2%) 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.535 (+2%) 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,650

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes
tx_pxe_processing_time_ms 2,958 (+9%) 1,477 (+8%)
Metric 0 public data writes 1 public data writes
tx_sequencer_processing_time_ms 7.40 (-5%) 646 (+14%)

// FIXME: TagCheckError: Tag mismatch at offset 22, got UINT64, expected UINT32
// let s: CompressedString<1,13> = CompressedString::from_string("Hello, world!");
// context.emit_unencrypted_log(/*event_selector=*/ 10, /*message=*/ s);
let s: CompressedString<2,44> = CompressedString::from_string("A long time ago, in a galaxy far far away...");
Copy link
Member

Choose a reason for hiding this comment

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

Added via Giphy

// FIXME: Try this once Brillig codegen produces uniform bit sizes for LT
// const expectedCompressedString = Buffer.from('Hello, world!');
const expectedCompressedString = Buffer.from(
'\0A long time ago, in a galaxy fa' + '\0r far away...\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
Copy link
Member

Choose a reason for hiding this comment

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

lovely padding

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah man, why is the first byte the 0 one?

Base automatically changed from fc/db/avm-nested-calls to master March 11, 2024 10:55
Copy link
Contributor Author

fcarreiro commented Mar 11, 2024

Merge activity

  • Mar 11, 7:15 AM EDT: Graphite rebased this pull request as part of a merge.
  • Mar 11, 7:18 AM EDT: @fcarreiro merged this pull request with Graphite.

@fcarreiro fcarreiro merged commit 8f7519b into master Mar 11, 2024
98 checks passed
@fcarreiro fcarreiro deleted the fc/avm-enable-cs-test branch March 11, 2024 11:18
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.0</summary>

##
[0.27.0](aztec-package-v0.26.6...aztec-package-v0.27.0)
(2024-03-12)


### Features

* Add api for inclusion proof of outgoing message in block
[#4562](#4562)
([#4899](#4899))
([26d2643](26d2643))


### Miscellaneous

* Pin foundry
([#5151](#5151))
([69bd7dd](69bd7dd))
* Remove old contract deployment flow
([#4970](#4970))
([6d15947](6d15947))
</details>

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

##
[0.27.0](barretenberg.js-v0.26.6...barretenberg.js-v0.27.0)
(2024-03-12)


### Miscellaneous

* Move alpine containers to ubuntu
([#5026](#5026))
([d483e67](d483e67)),
closes
[#4708](#4708)
</details>

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

##
[0.27.0](aztec-cli-v0.26.6...aztec-cli-v0.27.0)
(2024-03-12)


### Miscellaneous

* Remove old contract deployment flow
([#4970](#4970))
([6d15947](6d15947))
</details>

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

##
[0.27.0](aztec-packages-v0.26.6...aztec-packages-v0.27.0)
(2024-03-12)


### ⚠ BREAKING CHANGES

* Remove open keyword from Noir
([#4967](#4967))

### Features

* Add api for inclusion proof of outgoing message in block
[#4562](#4562)
([#4899](#4899))
([26d2643](26d2643))
* **avm-simulator:** External calls + integration
([#5051](#5051))
([dde33f4](dde33f4))
* **avm-simulator:** External static calls + integration
([#5089](#5089))
([428d950](428d950))
* **avm:** Equivalence check between Main trace and Mem trace
([#5032](#5032))
([7f216eb](7f216eb)),
closes
[#4955](#4955)
* **avm:** Fix some Brillig problems
([#5091](#5091))
([07dd821](07dd821))
* Initial integration avm prover
([#4878](#4878))
([2e2554e](2e2554e))
* Noir pull action
([#5062](#5062))
([b2d7d14](b2d7d14))
* Restore contract inclusion proofs
([#5141](#5141))
([a39cd61](a39cd61))
* Update the core of SMT Circuit class
([#5096](#5096))
([1519d3b](1519d3b))
* Updating archiver with new inbox
([#5025](#5025))
([f6d17c9](f6d17c9)),
closes
[#4828](#4828)


### Bug Fixes

* Duplicate factory code temporarily to unblock
([#5099](#5099))
([8b10600](8b10600))
* Remove hard coded canonical gas address
([#5106](#5106))
([dc2fd9e](dc2fd9e))


### Miscellaneous

* **avm-simulator:** Enable compressed strings unencrypted log test
([#5083](#5083))
([8f7519b](8f7519b))
* **avm-simulator:** Formatting and fixes
([#5092](#5092))
([b3fa084](b3fa084))
* **AVM:** Negative unit tests for inter table relations
([#5143](#5143))
([a74dccb](a74dccb)),
closes
[#5033](#5033)
* Aztec-macros refactor
([#5127](#5127))
([2195441](2195441))
* **ci:** Fail on clippy warnings in noir
([#5101](#5101))
([54af648](54af648))
* Extract bb binary in bs fast
([#5128](#5128))
([9ca41ef](9ca41ef))
* Increase bytecode size limit
([#5098](#5098))
([53b2381](53b2381))
* Increase permitted bytecode size
([#5136](#5136))
([6865c34](6865c34))
* Join-split example Part 2
([#5016](#5016))
([0718320](0718320))
* Move alpine containers to ubuntu
([#5026](#5026))
([d483e67](d483e67)),
closes
[#4708](#4708)
* Nicer snapshots
([#5133](#5133))
([9a737eb](9a737eb))
* Pin foundry
([#5151](#5151))
([69bd7dd](69bd7dd))
* Remove old contract deployment flow
([#4970](#4970))
([6d15947](6d15947))
* Remove open keyword from Noir
([#4967](#4967))
([401557e](401557e))
* Run nargo fmt on each nargo project
([#5102](#5102))
([b327254](b327254))
* Use context interface in mark-as-initialized
([#5142](#5142))
([932c1d5](932c1d5))
</details>

<details><summary>barretenberg: 0.27.0</summary>

##
[0.27.0](barretenberg-v0.26.6...barretenberg-v0.27.0)
(2024-03-12)


### Features

* **avm:** Equivalence check between Main trace and Mem trace
([#5032](#5032))
([7f216eb](7f216eb)),
closes
[#4955](#4955)
* Initial integration avm prover
([#4878](#4878))
([2e2554e](2e2554e))
* Update the core of SMT Circuit class
([#5096](#5096))
([1519d3b](1519d3b))


### Miscellaneous

* **AVM:** Negative unit tests for inter table relations
([#5143](#5143))
([a74dccb](a74dccb)),
closes
[#5033](#5033)
* Extract bb binary in bs fast
([#5128](#5128))
([9ca41ef](9ca41ef))
* Join-split example Part 2
([#5016](#5016))
([0718320](0718320))
* Move alpine containers to ubuntu
([#5026](#5026))
([d483e67](d483e67)),
closes
[#4708](#4708)
* Pin foundry
([#5151](#5151))
([69bd7dd](69bd7dd))
</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.0</summary>

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


### Features

* Add api for inclusion proof of outgoing message in block
[#4562](AztecProtocol/aztec-packages#4562)
([#4899](AztecProtocol/aztec-packages#4899))
([26d2643](AztecProtocol/aztec-packages@26d2643))


### Miscellaneous

* Pin foundry
([#5151](AztecProtocol/aztec-packages#5151))
([69bd7dd](AztecProtocol/aztec-packages@69bd7dd))
* Remove old contract deployment flow
([#4970](AztecProtocol/aztec-packages#4970))
([6d15947](AztecProtocol/aztec-packages@6d15947))
</details>

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

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


### Miscellaneous

* Move alpine containers to ubuntu
([#5026](AztecProtocol/aztec-packages#5026))
([d483e67](AztecProtocol/aztec-packages@d483e67)),
closes
[#4708](AztecProtocol/aztec-packages#4708)
</details>

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

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


### Miscellaneous

* Remove old contract deployment flow
([#4970](AztecProtocol/aztec-packages#4970))
([6d15947](AztecProtocol/aztec-packages@6d15947))
</details>

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

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


### ⚠ BREAKING CHANGES

* Remove open keyword from Noir
([#4967](AztecProtocol/aztec-packages#4967))

### Features

* Add api for inclusion proof of outgoing message in block
[#4562](AztecProtocol/aztec-packages#4562)
([#4899](AztecProtocol/aztec-packages#4899))
([26d2643](AztecProtocol/aztec-packages@26d2643))
* **avm-simulator:** External calls + integration
([#5051](AztecProtocol/aztec-packages#5051))
([dde33f4](AztecProtocol/aztec-packages@dde33f4))
* **avm-simulator:** External static calls + integration
([#5089](AztecProtocol/aztec-packages#5089))
([428d950](AztecProtocol/aztec-packages@428d950))
* **avm:** Equivalence check between Main trace and Mem trace
([#5032](AztecProtocol/aztec-packages#5032))
([7f216eb](AztecProtocol/aztec-packages@7f216eb)),
closes
[#4955](AztecProtocol/aztec-packages#4955)
* **avm:** Fix some Brillig problems
([#5091](AztecProtocol/aztec-packages#5091))
([07dd821](AztecProtocol/aztec-packages@07dd821))
* Initial integration avm prover
([#4878](AztecProtocol/aztec-packages#4878))
([2e2554e](AztecProtocol/aztec-packages@2e2554e))
* Noir pull action
([#5062](AztecProtocol/aztec-packages#5062))
([b2d7d14](AztecProtocol/aztec-packages@b2d7d14))
* Restore contract inclusion proofs
([#5141](AztecProtocol/aztec-packages#5141))
([a39cd61](AztecProtocol/aztec-packages@a39cd61))
* Update the core of SMT Circuit class
([#5096](AztecProtocol/aztec-packages#5096))
([1519d3b](AztecProtocol/aztec-packages@1519d3b))
* Updating archiver with new inbox
([#5025](AztecProtocol/aztec-packages#5025))
([f6d17c9](AztecProtocol/aztec-packages@f6d17c9)),
closes
[#4828](AztecProtocol/aztec-packages#4828)


### Bug Fixes

* Duplicate factory code temporarily to unblock
([#5099](AztecProtocol/aztec-packages#5099))
([8b10600](AztecProtocol/aztec-packages@8b10600))
* Remove hard coded canonical gas address
([#5106](AztecProtocol/aztec-packages#5106))
([dc2fd9e](AztecProtocol/aztec-packages@dc2fd9e))


### Miscellaneous

* **avm-simulator:** Enable compressed strings unencrypted log test
([#5083](AztecProtocol/aztec-packages#5083))
([8f7519b](AztecProtocol/aztec-packages@8f7519b))
* **avm-simulator:** Formatting and fixes
([#5092](AztecProtocol/aztec-packages#5092))
([b3fa084](AztecProtocol/aztec-packages@b3fa084))
* **AVM:** Negative unit tests for inter table relations
([#5143](AztecProtocol/aztec-packages#5143))
([a74dccb](AztecProtocol/aztec-packages@a74dccb)),
closes
[#5033](AztecProtocol/aztec-packages#5033)
* Aztec-macros refactor
([#5127](AztecProtocol/aztec-packages#5127))
([2195441](AztecProtocol/aztec-packages@2195441))
* **ci:** Fail on clippy warnings in noir
([#5101](AztecProtocol/aztec-packages#5101))
([54af648](AztecProtocol/aztec-packages@54af648))
* Extract bb binary in bs fast
([#5128](AztecProtocol/aztec-packages#5128))
([9ca41ef](AztecProtocol/aztec-packages@9ca41ef))
* Increase bytecode size limit
([#5098](AztecProtocol/aztec-packages#5098))
([53b2381](AztecProtocol/aztec-packages@53b2381))
* Increase permitted bytecode size
([#5136](AztecProtocol/aztec-packages#5136))
([6865c34](AztecProtocol/aztec-packages@6865c34))
* Join-split example Part 2
([#5016](AztecProtocol/aztec-packages#5016))
([0718320](AztecProtocol/aztec-packages@0718320))
* Move alpine containers to ubuntu
([#5026](AztecProtocol/aztec-packages#5026))
([d483e67](AztecProtocol/aztec-packages@d483e67)),
closes
[#4708](AztecProtocol/aztec-packages#4708)
* Nicer snapshots
([#5133](AztecProtocol/aztec-packages#5133))
([9a737eb](AztecProtocol/aztec-packages@9a737eb))
* Pin foundry
([#5151](AztecProtocol/aztec-packages#5151))
([69bd7dd](AztecProtocol/aztec-packages@69bd7dd))
* Remove old contract deployment flow
([#4970](AztecProtocol/aztec-packages#4970))
([6d15947](AztecProtocol/aztec-packages@6d15947))
* Remove open keyword from Noir
([#4967](AztecProtocol/aztec-packages#4967))
([401557e](AztecProtocol/aztec-packages@401557e))
* Run nargo fmt on each nargo project
([#5102](AztecProtocol/aztec-packages#5102))
([b327254](AztecProtocol/aztec-packages@b327254))
* Use context interface in mark-as-initialized
([#5142](AztecProtocol/aztec-packages#5142))
([932c1d5](AztecProtocol/aztec-packages@932c1d5))
</details>

<details><summary>barretenberg: 0.27.0</summary>

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


### Features

* **avm:** Equivalence check between Main trace and Mem trace
([#5032](AztecProtocol/aztec-packages#5032))
([7f216eb](AztecProtocol/aztec-packages@7f216eb)),
closes
[#4955](AztecProtocol/aztec-packages#4955)
* Initial integration avm prover
([#4878](AztecProtocol/aztec-packages#4878))
([2e2554e](AztecProtocol/aztec-packages@2e2554e))
* Update the core of SMT Circuit class
([#5096](AztecProtocol/aztec-packages#5096))
([1519d3b](AztecProtocol/aztec-packages@1519d3b))


### Miscellaneous

* **AVM:** Negative unit tests for inter table relations
([#5143](AztecProtocol/aztec-packages#5143))
([a74dccb](AztecProtocol/aztec-packages@a74dccb)),
closes
[#5033](AztecProtocol/aztec-packages#5033)
* Extract bb binary in bs fast
([#5128](AztecProtocol/aztec-packages#5128))
([9ca41ef](AztecProtocol/aztec-packages@9ca41ef))
* Join-split example Part 2
([#5016](AztecProtocol/aztec-packages#5016))
([0718320](AztecProtocol/aztec-packages@0718320))
* Move alpine containers to ubuntu
([#5026](AztecProtocol/aztec-packages#5026))
([d483e67](AztecProtocol/aztec-packages@d483e67)),
closes
[#4708](AztecProtocol/aztec-packages#4708)
* Pin foundry
([#5151](AztecProtocol/aztec-packages#5151))
([69bd7dd](AztecProtocol/aztec-packages@69bd7dd))
</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.

None yet

3 participants