Skip to content

Commit b5a966c

Browse files
move the max proofs per day value to the config files
1 parent a59d4f3 commit b5a966c

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

aggregation_mode/batcher/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pub struct Config {
88
pub db_connection_url: String,
99
pub eth_rpc_url: String,
1010
pub payment_service_address: String,
11+
pub max_proofs_per_day: usize,
1112
}
1213

1314
impl Config {

aggregation_mode/batcher/src/server/http.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ impl BatcherServer {
102102
let state = state.get_ref();
103103

104104
// Checking if this address has submited more proofs than the ones allowed per day
105-
const MAX_PROOFS_PER_DAY: usize = 4;
106-
107105
let daily_tasks_by_address = match state
108106
.db
109107
.get_daily_tasks_by_address(&recovered_address)
@@ -116,7 +114,7 @@ impl BatcherServer {
116114
}
117115
};
118116

119-
if daily_tasks_by_address >= MAX_PROOFS_PER_DAY {
117+
if daily_tasks_by_address >= state.config.max_proofs_per_day {
120118
return HttpResponse::InternalServerError().json(AppResponse::new_unsucessfull(
121119
"Request denied: Query limit exceeded.",
122120
400,

config-files/config-agg-mode-batcher-ethereum-package.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ port: 8089
22
db_connection_url: "postgres://postgres:postgres@localhost:5435/"
33
eth_rpc_url: "http://localhost:8545"
44
payment_service_address: "0x922D6956C99E12DFeB3224DEA977D0939758A1Fe"
5+
max_proofs_per_day: 32

config-files/config-agg-mode-batcher.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ port: 8089
22
db_connection_url: "postgres://postgres:postgres@localhost:5435/"
33
eth_rpc_url: "http://localhost:8545"
44
payment_service_address: "0x922D6956C99E12DFeB3224DEA977D0939758A1Fe"
5+
max_proofs_per_day: 4

0 commit comments

Comments
 (0)