-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throttle block consumption #156
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -13,6 +13,10 @@ export interface Config { | |||
rpc: string; | |||
deploymentBlock: number; | |||
watchdogTimeout?: number; | |||
/** | |||
* Throttle block processing to only process blocks every N blocks. Set to 1 to process every block, 2 to process every other block, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I feel this comment is a bit redundant (it's documented in the shema above and we don't have redundant docs for any of the other parameters)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is automatically generated from the JSON schema
Description
This PR adds a new optional config parameter to each network, allowing us to define some block throttling.
the setting is called
processEveryNumBlocks
:Also, note that even if we skip a block, it doesn't mean we don't have any work on it. We still need to check if there's new orders coming in. So what is actually skipped is only the programmatic order checks and posting orders.
Also, it persists all Prometheus metrics, so it should count as a "consumed block" for our consumption rate alerts, meaning we should see the block consumption rate progressing faster.
This is an example on how to use it:
"processEveryNumBlocks": 40,
This would do polling and post orders once every 40 blocks. In arbitrum this should be every 8 seconds