File tree Expand file tree Collapse file tree 4 files changed +4
-3
lines changed
aggregation_mode/batcher/src Expand file tree Collapse file tree 4 files changed +4
-3
lines changed Original file line number Diff line number Diff 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
1314impl Config {
Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ port: 8089
22db_connection_url : " postgres://postgres:postgres@localhost:5435/"
33eth_rpc_url : " http://localhost:8545"
44payment_service_address : " 0x922D6956C99E12DFeB3224DEA977D0939758A1Fe"
5+ max_proofs_per_day : 32
Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ port: 8089
22db_connection_url : " postgres://postgres:postgres@localhost:5435/"
33eth_rpc_url : " http://localhost:8545"
44payment_service_address : " 0x922D6956C99E12DFeB3224DEA977D0939758A1Fe"
5+ max_proofs_per_day : 4
You can’t perform that action at this time.
0 commit comments