diff --git a/dank_mids/ENVIRONMENT_VARIABLES.py b/dank_mids/ENVIRONMENT_VARIABLES.py index 4869827a..c9978516 100644 --- a/dank_mids/ENVIRONMENT_VARIABLES.py +++ b/dank_mids/ENVIRONMENT_VARIABLES.py @@ -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) diff --git a/dank_mids/controller.py b/dank_mids/controller.py index f59a312b..7786a976 100644 --- a/dank_mids/controller.py +++ b/dank_mids/controller.py @@ -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()