Skip to content

Commit

Permalink
Move chunk size to settings
Browse files Browse the repository at this point in the history
Signed-off-by: cyc60 <[email protected]>
  • Loading branch information
cyc60 committed Aug 24, 2023
1 parent 825809e commit 92df098
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion oracle/oracle/rewards/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
MGNO_RATE,
NETWORK,
NETWORK_CONFIG,
ORACLE_WITHDRAWAL_CHUNK_SIZE,
REWARD_VOTE_FILENAME,
WAD,
)
Expand Down Expand Up @@ -221,7 +222,7 @@ async def calculate_withdrawal_rewards(
)
execution_client = get_web3_client()

chunk_size = 50000
chunk_size = ORACLE_WITHDRAWAL_CHUNK_SIZE
for block_number in range(from_block, to_block, chunk_size):
withdrawals_amount += await self.fetch_withdrawal_chunk(
validator_indexes=validator_indexes,
Expand Down
4 changes: 4 additions & 0 deletions oracle/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

# oracle
ORACLE_PROCESS_INTERVAL = config("ORACLE_PROCESS_INTERVAL", default=15, cast=int)
ORACLE_WITHDRAWAL_CHUNK_SIZE = config(
"ORACLE_WITHDRAWAL_CHUNK_SIZE", default=50000, cast=int
)


IPFS_FETCH_ENDPOINTS = config(
"IPFS_FETCH_ENDPOINTS",
Expand Down

0 comments on commit 92df098

Please sign in to comment.