This repository has been archived by the owner on Dec 4, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Some of the clients experienced an issue with block tracker (which is a part of
ethgo
third party library), where on all validator nodes, it polled rootchain rpc endpointseth_getBlockByNumber
andeth_getBlockByHash
each second, causing them to spend all their allowed limit for querying rpc points on a main net such as Ethereum. This sequentially caused all other bridge actions to fail such as state sync events for deposits, or checkpointing. This issue only persisted for block trackers on validator nodes that track the state sync events (which transfer data from L1 to L2).Block tracker in
ethgo
has aPollInterval
(intime.Duration
), which determines how often it calls given rpc endpoints, but it's configuration was not exposed explicitly, so we needed to expand ourevent_tracker
to receive an interval, which then is set to the block tracker through its field.This PR introduces two new flags:
genesis
command - we introduced a new flag--block-tracker-poll-interval
, which is defined in time duration (for example,--block-tracker-poll-interval "1s"
orblock-tracker-poll-interval "12s"
). This is part of thegenesis
command andgenesis.json
file because, all validator nodes are tracking state sync events. Block proposers are the ones that add state sync commitment transactions at the end of a sprint, while the rest of the validators validate the given transaction, hence all validators need to track state sync events from rootchain. For a state sync commitment transaction to be valid, quorum of validators must be reached, meaning at lest 2/3+1 validators must have the same state sync events tracked. So if we are to set this flag on a server level, that means that each validator can have a different poll time, and will have different number of state sync events tracked at a point of time, which is not a desired behavior.server
command - we introduced a new flag--relayer-poll-interval
, which is defined in time duration (for example, example,--relayer-poll-interval "1s"
or--relayer-poll-interval "12s"
). Sincerelayer
node uses block tracker as well, but for child chain (tracking when a state sync commitment is submitted to child contract), we added this flag, so that the user can configure theirrelayer
nodes as well to poll given rpc endpoints on child chain at desired intervals.Tagging @DannyS03 to update the documentation.
Changes include
Checklist
Testing