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

feat: sequencer checks fee balance #5267

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

alexghr
Copy link
Contributor

@alexghr alexghr commented Mar 16, 2024

Sequencer rejects txs that should pay fee but don't hold enough balance

Copy link
Contributor Author

alexghr commented Mar 16, 2024

@alexghr alexghr force-pushed the 03-16-refactor_extract_tx_validation_to_separate_class branch from d49662f to 8ef4d64 Compare March 16, 2024 19:30
@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch from a700726 to 9577ea2 Compare March 16, 2024 19:30
@alexghr alexghr force-pushed the 03-16-refactor_extract_tx_validation_to_separate_class branch from 8ef4d64 to a2eba26 Compare March 17, 2024 18:34
@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch from 9577ea2 to d8c8c1d Compare March 17, 2024 18:34
@alexghr alexghr force-pushed the 03-16-refactor_extract_tx_validation_to_separate_class branch from a2eba26 to 6427a18 Compare March 17, 2024 22:10
@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch from d8c8c1d to 3568dba Compare March 17, 2024 22:11
@alexghr alexghr force-pushed the 03-16-refactor_extract_tx_validation_to_separate_class branch from 6427a18 to aabacb5 Compare March 17, 2024 22:39
@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch 2 times, most recently from 3d2831e to 7aacaca Compare March 18, 2024 07:17
@alexghr alexghr force-pushed the 03-16-refactor_extract_tx_validation_to_separate_class branch from aabacb5 to b92b276 Compare March 18, 2024 07:18
@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch from 7aacaca to ca66ea8 Compare March 18, 2024 07:18
@AztecBot
Copy link
Collaborator

AztecBot commented Mar 18, 2024

Benchmark results

Metrics with a significant change:

  • note_trial_decrypting_time_in_ms (8): 91.8 (+115%)
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 640c89a0 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 66,436 238,792 469,808
l1_rollup_execution_gas 647,534 929,150 1,305,988
l2_block_processing_time_in_ms 1,313 (-2%) 4,659 (-2%) 9,063 (-1%)
note_successful_decrypting_time_in_ms 186 (-21%) 525 (-5%) 951 (-7%)
note_trial_decrypting_time_in_ms ⚠️ 91.8 (+115%) 40.2 (-44%) 83.7 (+50%)
l2_block_building_time_in_ms 18,032 (-3%) 68,085 (-2%) 135,040 (-2%)
l2_block_rollup_simulation_time_in_ms 8,051 (-2%) 28,550 (-2%) 56,239 (-2%)
l2_block_public_tx_process_time_in_ms 9,961 (-4%) 39,479 (-2%) 78,706 (-3%)

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,568 (+2%) 28,784 (+5%)
note_history_successful_decrypting_time_in_ms 1,199 (-5%) 2,410 (-7%)
note_history_trial_decrypting_time_in_ms 65.2 (-35%) 115 (-10%)
node_database_size_in_bytes 18,649,168 34,992,208
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 280 (-1%) 44,366 28,244
private-kernel-ordering 214 (-2%) 52,868 14,326
base-parity 1,894 (+2%) 128 311
base-rollup 719 (-1%) 165,787 925
root-parity 1,486 (-5%) 1,244 311
root-rollup 51.9 4,487 725
private-kernel-inner 644 (-1%) 73,771 28,244
public-kernel-app-logic 446 (-1%) 35,260 28,215
public-kernel-tail 173 (-1%) 40,926 28,215
merge-rollup 8.23 (-2%) 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.1 16.0 (-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.587 0.494 (-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 45.9 72.5 (-1%) 229 (-2%) 446 863 (-3%) 1,714 (-2%) 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.471 0.447 0.417 (-2%) 0.417 0.410 (-2%) 0.411 (-1%) N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 53.8 106 (-3%) 332 (-2%) 661 1,302 (-1%) 2,591 (-2%) 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.481 0.478 (-2%) 0.454 (-1%) 0.455 0.451 (-1%) 0.452 (-1%) 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 61.5
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.538

Miscellaneous

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

Metric 0 registered classes
tx_size_in_bytes 22,012

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes
tx_pxe_processing_time_ms 3,256 (-3%) 1,754 (-1%)
Metric 0 public data writes 1 public data writes
tx_sequencer_processing_time_ms 10.2 (-5%) 1,243 (-1%)

@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch from ca66ea8 to 6a44738 Compare March 18, 2024 09:55
@alexghr alexghr marked this pull request as ready for review March 18, 2024 09:59
Copy link
Collaborator

@PhilWindle PhilWindle left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me.

@alexghr alexghr force-pushed the 03-16-refactor_extract_tx_validation_to_separate_class branch from b92b276 to 84faea1 Compare March 18, 2024 14:22
@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch from 6a44738 to 187ddbf Compare March 18, 2024 14:22
@alexghr alexghr force-pushed the 03-16-refactor_extract_tx_validation_to_separate_class branch from 84faea1 to fd2f15f Compare March 18, 2024 15:07
@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch from 187ddbf to 99372c7 Compare March 18, 2024 15:07
@alexghr alexghr force-pushed the 03-16-refactor_extract_tx_validation_to_separate_class branch from fd2f15f to 95e524a Compare March 18, 2024 15:40
@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch from 99372c7 to 0edaf9a Compare March 18, 2024 15:40
@alexghr alexghr force-pushed the 03-16-refactor_extract_tx_validation_to_separate_class branch from 95e524a to 39c4539 Compare March 18, 2024 15:50
@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch from 0edaf9a to 7479532 Compare March 18, 2024 15:50
@alexghr alexghr force-pushed the 03-16-refactor_extract_tx_validation_to_separate_class branch from 39c4539 to b208811 Compare March 19, 2024 08:49
@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch from 7479532 to 1a5c6ef Compare March 19, 2024 08:50
@alexghr alexghr force-pushed the 03-16-refactor_extract_tx_validation_to_separate_class branch from b208811 to 727100f Compare March 19, 2024 10:19
@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch from 1a5c6ef to c1118e4 Compare March 19, 2024 10:19
@alexghr alexghr force-pushed the 03-16-refactor_extract_tx_validation_to_separate_class branch from 727100f to e72aed1 Compare March 19, 2024 10:40
@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch from c1118e4 to 69e9e19 Compare March 19, 2024 10:40
@alexghr alexghr force-pushed the 03-16-refactor_extract_tx_validation_to_separate_class branch from e72aed1 to 80390a1 Compare March 19, 2024 11:35
@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch from 69e9e19 to c1410ea Compare March 19, 2024 11:36
@alexghr alexghr force-pushed the 03-16-refactor_extract_tx_validation_to_separate_class branch from 80390a1 to 9db8e44 Compare March 19, 2024 12:12
@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch from c1410ea to d749ba3 Compare March 19, 2024 12:12
Base automatically changed from 03-16-refactor_extract_tx_validation_to_separate_class to master March 19, 2024 13:21
@alexghr alexghr force-pushed the 03-16-feat_sequencer_checks_fee_balance branch from d749ba3 to 56af753 Compare March 19, 2024 13:26
@alexghr alexghr merged commit 09b2b7c into master Mar 19, 2024
99 of 100 checks passed
@alexghr alexghr deleted the 03-16-feat_sequencer_checks_fee_balance branch March 19, 2024 14:25
@alexghr alexghr linked an issue Mar 22, 2024 that may be closed by this pull request
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.

Update sequencer to validate fee payer gas balance
4 participants