Skip to content

Commit b14573e

Browse files
blockifier: refactor bouncer weights (#9478)
1 parent c4622cd commit b14573e

File tree

5 files changed

+31
-29
lines changed

5 files changed

+31
-29
lines changed

crates/apollo_deployments/resources/app_configs/batcher_config.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
"batcher_config.block_builder_config.bouncer_config.block_max_capacity.n_events": 5000,
55
"batcher_config.block_builder_config.bouncer_config.block_max_capacity.n_txs": 500,
66
"batcher_config.block_builder_config.bouncer_config.block_max_capacity.sierra_gas": 5000000000,
7-
"batcher_config.block_builder_config.bouncer_config.block_max_capacity.proving_gas": 5500000000,
7+
"batcher_config.block_builder_config.bouncer_config.block_max_capacity.proving_gas": 6000000000,
88
"batcher_config.block_builder_config.bouncer_config.block_max_capacity.state_diff_size": 4000,
9-
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.pedersen": 4769,
9+
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.pedersen": 5722,
1010
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.range_check": 70,
11-
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.ecdsa": 1666666,
12-
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.ecop": 714875,
11+
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.ecdsa": 2000000,
12+
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.ecop": 857850,
1313
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.bitwise": 583,
14-
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.keccak": 510707,
15-
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.poseidon": 10000,
16-
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.add_mod": 312,
14+
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.keccak": 600000,
15+
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.poseidon": 11450,
16+
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.add_mod": 360,
1717
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.mul_mod": 604,
1818
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.range_check96": 56,
19-
"batcher_config.block_builder_config.bouncer_config.blake_weight": 5263,
19+
"batcher_config.block_builder_config.bouncer_config.blake_weight": 6320,
2020
"batcher_config.block_builder_config.execute_config.n_workers": 28,
2121
"batcher_config.block_builder_config.execute_config.stack_size": 62914560,
2222
"batcher_config.block_builder_config.n_concurrent_txs": 100,
@@ -51,4 +51,4 @@
5151
"batcher_config.storage.mmap_file_config.max_object_size": 1073741824,
5252
"batcher_config.storage.mmap_file_config.max_size": 1099511627776,
5353
"batcher_config.storage.scope": "StateOnly"
54-
}
54+
}

crates/apollo_node/resources/config_schema.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"batcher_config.block_builder_config.bouncer_config.blake_weight": {
2828
"description": "blake opcode gas weight.",
2929
"privacy": "Public",
30-
"value": 5263
30+
"value": 6320
3131
},
3232
"batcher_config.block_builder_config.bouncer_config.block_max_capacity.l1_gas": {
3333
"description": "An upper bound on the total l1_gas used in a block.",
@@ -52,7 +52,7 @@
5252
"batcher_config.block_builder_config.bouncer_config.block_max_capacity.proving_gas": {
5353
"description": "An upper bound on the total builtins and steps gas usage used in a block.",
5454
"privacy": "Public",
55-
"value": 5500000000
55+
"value": 6000000000
5656
},
5757
"batcher_config.block_builder_config.bouncer_config.block_max_capacity.sierra_gas": {
5858
"description": "An upper bound on the total sierra_gas used in a block.",
@@ -67,7 +67,7 @@
6767
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.add_mod": {
6868
"description": "Add_mod gas weight.",
6969
"privacy": "Public",
70-
"value": 312
70+
"value": 360
7171
},
7272
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.bitwise": {
7373
"description": "Bitwise gas weight.",
@@ -77,17 +77,17 @@
7777
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.ecdsa": {
7878
"description": "Ecdsa gas weight.",
7979
"privacy": "Public",
80-
"value": 1666666
80+
"value": 2000000
8181
},
8282
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.ecop": {
8383
"description": "Ec_op gas weight.",
8484
"privacy": "Public",
85-
"value": 714875
85+
"value": 857850
8686
},
8787
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.keccak": {
8888
"description": "Keccak gas weight.",
8989
"privacy": "Public",
90-
"value": 510707
90+
"value": 600000
9191
},
9292
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.mul_mod": {
9393
"description": "Mul_mod gas weight.",
@@ -97,12 +97,12 @@
9797
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.pedersen": {
9898
"description": "Pedersen gas weight.",
9999
"privacy": "Public",
100-
"value": 4769
100+
"value": 5722
101101
},
102102
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.poseidon": {
103103
"description": "Poseidon gas weight.",
104104
"privacy": "Public",
105-
"value": 10000
105+
"value": 11450
106106
},
107107
"batcher_config.block_builder_config.bouncer_config.builtin_weights.gas_costs.range_check": {
108108
"description": "Range_check gas weight.",
@@ -2704,4 +2704,4 @@
27042704
"privacy": "TemporaryValue",
27052705
"value": 1000000
27062706
}
2707-
}
2707+
}

crates/apollo_node_config/src/definitions.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ use std::collections::HashMap;
22

33
use apollo_config::dumping::{ConfigPointers, Pointers};
44
use apollo_config::{ParamPath, SerializedContent, SerializedParam};
5-
use serde_json::{to_value, Value};
5+
#[cfg(any(feature = "testing", test))]
6+
use serde_json::to_value;
7+
use serde_json::Value;
68

79
#[derive(Debug, Clone, Default)]
810
pub struct ConfigPointersMap(HashMap<ParamPath, (SerializedParam, Pointers)>);

crates/blockifier/src/bouncer.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl Default for BouncerConfig {
7676
Self {
7777
block_max_capacity: BouncerWeights::default(),
7878
builtin_weights: BuiltinWeights::default(),
79-
blake_weight: 5263,
79+
blake_weight: 6320,
8080
}
8181
}
8282
}
@@ -197,7 +197,7 @@ impl Default for BouncerWeights {
197197
state_diff_size: 4000,
198198
// NOTE: Must stay in sync with orchestrator_versioned_constants' max_block_size.
199199
sierra_gas: GasAmount(5000000000),
200-
proving_gas: GasAmount(5500000000),
200+
proving_gas: GasAmount(6000000000),
201201
}
202202
}
203203
}
@@ -423,14 +423,14 @@ impl Default for BuiltinWeights {
423423
fn default() -> Self {
424424
Self {
425425
gas_costs: BuiltinGasCosts {
426-
pedersen: 4769,
426+
pedersen: 5722,
427427
range_check: 70,
428-
ecdsa: 1666666,
429-
ecop: 714875,
428+
ecdsa: 2000000,
429+
ecop: 857850,
430430
bitwise: 583,
431-
keccak: 510707,
432-
poseidon: 10000,
433-
add_mod: 312,
431+
keccak: 600000,
432+
poseidon: 11450,
433+
add_mod: 360,
434434
mul_mod: 604,
435435
range_check96: 56,
436436
},

crates/blockifier/src/bouncer_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,11 +744,11 @@ fn class_hash_migration_data_from_state(
744744

745745
if should_migrate {
746746
expect![[r#"
747-
89892468
747+
93899555
748748
"#]]
749749
.assert_debug_eq(&migration_sierra_gas.0);
750750
expect![[r#"
751-
205759633
751+
227434970
752752
"#]]
753753
.assert_debug_eq(&migration_proving_gas.0);
754754
} else {

0 commit comments

Comments
 (0)