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!: remove delegate call and "storage address" from public #8377

Closed
wants to merge 4 commits into from

Conversation

dbanks12
Copy link
Contributor

@dbanks12 dbanks12 commented Sep 4, 2024

No description provided.

Copy link
Contributor Author

dbanks12 commented Sep 4, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @dbanks12 and the rest of your teammates on Graphite Graphite

@dbanks12 dbanks12 changed the title Remove delegate call from public chore: remove delegate call from public Sep 4, 2024
Copy link
Contributor

github-actions bot commented Sep 4, 2024

Changes to circuit sizes

Generated at commit: dc1495a14a632c1f1d80ab8eb77828d290b26c12, compared to commit: f1746999ea12cc8117efd5a0c3b2ec5d80196343

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_setup -135 ✅ -0.06% -134 ✅ -0.01%
public_kernel_teardown -135 ✅ -0.06% -134 ✅ -0.01%
public_kernel_app_logic -135 ✅ -0.06% -134 ✅ -0.01%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_setup 211,882 (-135) -0.06% 1,879,615 (-134) -0.01%
public_kernel_teardown 212,041 (-135) -0.06% 1,877,181 (-134) -0.01%
public_kernel_app_logic 211,410 (-135) -0.06% 1,876,397 (-134) -0.01%

fcarreiro
fcarreiro previously approved these changes Sep 4, 2024
Copy link
Contributor

@fcarreiro fcarreiro left a comment

Choose a reason for hiding this comment

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

LGTM, but let me send a "last call for cries" to aztec3

```

Nested context derivation is defined as follows:
```jsx
nestedExecutionEnvironment = ExecutionEnvironment {
address: M[addrOffset],
storageAddress: isDelegateCall ? context.storageAddress : M[addrOffset],
Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, a related task is to remove storageAddress and move everything to address.

I'll send a message to aztec-3 about this.

@@ -329,7 +329,7 @@ function createPublicExecutionRequest(avmEnvironment: AvmExecutionEnvironment):
msgSender: avmEnvironment.sender,
storageContractAddress: avmEnvironment.storageAddress,
functionSelector: avmEnvironment.functionSelector,
isDelegateCall: avmEnvironment.isDelegateCall,
isDelegateCall: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to keep this because CallContext is also used in private?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.... Unless we use a different call context for public....

@AztecBot
Copy link
Collaborator

AztecBot commented Sep 4, 2024

Docs Preview

Hey there! 👋 You can check your preview at https://66d9085993eedb79de81b937--aztec-docs-dev.netlify.app

@AztecBot
Copy link
Collaborator

AztecBot commented Sep 4, 2024

Benchmark results

Metrics with a significant change:

  • protocol_circuit_simulation_time_in_ms (base-rollup): 3,008 (+17%)
  • protocol_circuit_simulation_time_in_ms (private-kernel-tail-to-public): 767 (-45%)
  • avm_simulation_time_ms (FeeJuice:_increase_public_balance): 146 (+190%)
  • avm_simulation_time_ms (Token:mint_public): 59.2 (-87%)
  • avm_simulation_time_ms (Token:assert_minter_and_mint): 469 (+60%)
  • l2_block_processing_time_in_ms (8): 445 (-33%)
  • node_history_sync_time_in_ms (3): 3,023 (-28%)
  • node_history_sync_time_in_ms (5): 3,845 (-35%)
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.

Proof generation

Each column represents the number of threads used in proof generation.

Metric 1 threads 4 threads 16 threads 32 threads 64 threads
proof_construction_time_sha256_ms 5,748 1,559 711 (-1%) 782 (+4%) 776
proof_construction_time_sha256_30_ms 11,858 (+4%) 3,170 (+3%) 1,414 (+2%) 1,454 (+2%) 1,477 (+1%)
proof_construction_time_sha256_100_ms 44,050 12,165 (+3%) 5,945 (+5%) 6,114 (+1%) 5,511 (+2%)
proof_construction_time_poseidon_hash_ms 78.0 34.0 34.0 59.0 (+2%) 88.0 (+1%)
proof_construction_time_poseidon_hash_30_ms 1,530 422 203 226 267 (-2%)
proof_construction_time_poseidon_hash_100_ms 5,638 1,517 678 740 (+1%) 750 (-1%)

L2 block published to L1

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

Metric 4 txs 8 txs 16 txs
l1_rollup_calldata_size_in_bytes 4,356 7,876 14,884
l1_rollup_calldata_gas 50,268 92,852 178,180
l1_rollup_execution_gas 843,109 1,576,589 3,361,973
l2_block_processing_time_in_ms 233 (-8%) ⚠️ 445 (-33%) 822 (+3%)
l2_block_building_time_in_ms 10,940 (+1%) 21,511 (+1%) 42,814 (+1%)
l2_block_rollup_simulation_time_in_ms 10,939 (+1%) 21,510 (+1%) 42,814 (+1%)
l2_block_public_tx_process_time_in_ms 9,327 (+1%) 19,870 (+1%) 41,138 (+1%)

L2 chain processing

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

Metric 3 blocks 5 blocks
node_history_sync_time_in_ms ⚠️ 3,023 (-28%) ⚠️ 3,845 (-35%)
node_database_size_in_bytes 12,423,408 16,343,280
pxe_database_size_in_bytes 16,254 26,813

Circuits stats

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

Circuit simulation_time_in_ms witness_generation_time_in_ms input_size_in_bytes output_size_in_bytes proving_time_in_ms
private-kernel-init 71.6 (-5%) 381 (+2%) 21,377 44,898 N/A
private-kernel-inner 157 (+3%) 682 (+1%) 72,358 45,020 N/A
private-kernel-reset-tiny 277 (+3%) 672 (+1%) 65,018 44,886 N/A
private-kernel-tail 150 (+1%) 127 (-2%) 50,589 52,921 N/A
base-parity 5.60 N/A 160 96.0 N/A
root-parity 35.0 N/A 73,948 96.0 N/A
base-rollup ⚠️ 3,008 (+17%) N/A 189,207 664 N/A
block-root-rollup 41.0 N/A 58,205 2,448 N/A
public-kernel-setup 78.8 N/A 105,085 71,222 N/A
public-kernel-app-logic 92.7 (+1%) N/A 104,899 71,222 N/A
public-kernel-tail 805 (+1%) N/A 390,582 16,414 N/A
private-kernel-reset-small 272 (+2%) N/A 66,341 45,629 N/A
private-kernel-tail-to-public ⚠️ 767 (-45%) 583 (+1%) 446,144 1,825 N/A
public-kernel-teardown 78.1 (-1%) N/A 105,349 71,222 N/A
merge-rollup 20.2 (+1%) N/A 38,174 664 N/A
undefined N/A N/A N/A N/A 83,050 (-2%)

Stats on running time collected for app circuits

Function input_size_in_bytes output_size_in_bytes witness_generation_time_in_ms
ContractClassRegisterer:register 1,344 11,731 343
ContractInstanceDeployer:deploy 1,408 11,731 18.5 (+3%)
MultiCallEntrypoint:entrypoint 1,920 11,731 405 (+1%)
FeeJuice:deploy 1,376 11,731 380
SchnorrAccount:constructor 1,312 11,731 62.5
SchnorrAccount:entrypoint 2,336 11,731 370 (+1%)
FeeJuice:claim 1,344 11,731 34.6 (-5%)
Token:privately_mint_private_note 1,280 11,731 72.3 (-1%)
FPC:fee_entrypoint_public 1,344 11,731 23.9
Token:transfer 1,312 11,731 210
Benchmarking:create_note 1,344 11,731 74.1 (-2%)
SchnorrAccount:verify_private_authwit 1,280 11,731 26.2
Token:unshield 1,376 11,731 500
FPC:fee_entrypoint_private 1,376 11,731 658 (-2%)

AVM Simulation

Time to simulate various public functions in the AVM.

Function time_ms bytecode_size_in_bytes
FeeJuice:_increase_public_balance ⚠️ 146 (+190%) 2,307
FeeJuice:set_portal 15.0 (+10%) 2,680
Token:constructor 71.3 (-11%) 13,839
FPC:constructor 48.1 (-2%) 8,553
FeeJuice:check_balance 37.0 (+2%) 2,041 (+1%)
Token:mint_public ⚠️ 59.2 (-87%) 4,572
Token:assert_minter_and_mint ⚠️ 469 (+60%) 3,006 (+1%)
AuthRegistry:set_authorized 45.9 (-8%) 923
FPC:prepare_fee 69.3 (-6%) 3,925
Token:transfer_public 13.8 (-24%) 9,482
FPC:pay_refund 46.7 (+1%) 4,856
Benchmarking:increment_balance 1,167 (+1%) 3,170
Token:_increase_public_balance 40.5 (+8%) 2,284
FPC:pay_refund_with_shielded_rebate 53.0 (+3%) 4,856

Public DB Access

Time to access various public DBs.

Function time_ms
get-nullifier-index 0.153 (-7%)

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 256 leaves 512 leaves 1024 leaves
batch_insert_into_append_only_tree_16_depth_ms 2.22 (+2%) 3.93 (+1%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.8 31.7 N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.115 (+2%) 0.111 (+1%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 11.2 (+1%) 18.4 (+5%) 30.6 60.5 (+3%) 113 (+1%)
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 159 287 543 1,055
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.107 0.107 (+5%) 0.0997 0.104 (+2%) 0.101 (+1%)
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 14.4 (+1%) 25.8 (+2%) 43.8 (+2%) 83.4 (+1%) 164 (+3%)
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 107 (-1%) 207 355 691 1,363
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.110 (+1%) 0.104 (+2%) 0.103 (+2%) 0.103 (+1%) 0.103 (+3%)
batch_insert_into_indexed_tree_40_depth_ms N/A N/A 16.7 (+3%) N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A 132 (+1%) N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A 0.107 (+1%) N/A N/A N/A N/A

Miscellaneous

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

Metric 0 registered classes 1 registered classes
tx_size_in_bytes 64,838 668,997

Transaction size based on fee payment method

| Metric | |
| - | |

@dbanks12 dbanks12 changed the title chore: remove delegate call from public chore!: remove delegate call and "storage address" from public Sep 5, 2024
@dbanks12
Copy link
Contributor Author

dbanks12 commented Sep 5, 2024

Merged storage address removal PR into this one just to reduce CI load and get things merged faster

@dbanks12
Copy link
Contributor Author

replaced by #9330

@dbanks12 dbanks12 closed this Oct 22, 2024
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