Skip to content

Commit

Permalink
feat: MAX_MULTICALL_SIZE env (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Dec 2, 2023
1 parent e592126 commit 47a16ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dank_mids/ENVIRONMENT_VARIABLES.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
# TODO: fix the other modes, set default='default', and make this verbose again
OPERATION_MODE = _envs.create_env("OPERATION_MODE", OperationMode, default="infura", verbose=False)

# Max number of eth calls to include in one multicall
MAX_MULTICALL_SIZE = _envs.create_env("MAX_MULTICALL_SIZE", int, default=10_000)
# Max number of rpc calls to include in one batch call
MAX_JSONRPC_BATCH_SIZE = _envs.create_env("MAX_JSONRPC_BATCH_SIZE", int, default=500)

Expand Down
1 change: 1 addition & 0 deletions dank_mids/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def __init__(self, w3: Web3) -> None:

self.method_semaphores = MethodSemaphores(self)
self.batcher = NotSoBrightBatcher()
self.batcher.step = ENVS.MAX_MULTICALL_SIZE

self.call_uid = UIDGenerator()
self.multicall_uid: UIDGenerator = UIDGenerator()
Expand Down

0 comments on commit 47a16ca

Please sign in to comment.