eth: blockwatcher can process multiple blocks in a polling interval #1729
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.
What does this pull request do? Explain your changes. (required)
Currently the blockwatcher will only process a single block per polling interval. This PR implements a
syncToLatestBlock
function that's called on each polling interval.This function requests the last block from a remote ethereum node and loops
pollNextBlock()
until the block number of the top of the stack equals that of the last block.How did you test each of these updates (required)
Tested manually on rinkeby with a polling interval of 60 seconds
Does this pull request close any open issues?
Fixes #1575 where nodes would run into expired ticket param errors due to their nodes falling behind on blocks when setting polling intervals greater than the block time. This can still occur however because ticket params expiration is 5 blocks, so the polling interval should still be small enough. We could lengthen this expiration time in a subsequent PR if necessary.
Checklist:
./test.sh
pass