Skip to content
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

eth: blockwatcher can process multiple blocks in a polling interval #1729

Merged
merged 1 commit into from
Mar 5, 2021

Conversation

kyriediculous
Copy link
Contributor

@kyriediculous kyriediculous commented Jan 6, 2021

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:

  • README and other documentation updated
  • Node runs in OSX and devenv
  • All tests in ./test.sh pass

@kyriediculous kyriediculous requested a review from yondonfu January 6, 2021 23:06
eth/blockwatch/block_watcher.go Outdated Show resolved Hide resolved
eth/blockwatch/block_watcher.go Outdated Show resolved Hide resolved
eth/blockwatch/block_watcher.go Outdated Show resolved Hide resolved
eth/blockwatch/block_watcher.go Show resolved Hide resolved
eth/blockwatch/block_watcher.go Outdated Show resolved Hide resolved
eth/blockwatch/block_watcher.go Outdated Show resolved Hide resolved
Copy link
Member

@yondonfu yondonfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚢 after squashing

@kyriediculous kyriediculous merged commit f56c02f into master Mar 5, 2021
@kyriediculous kyriediculous deleted the nv/fix-blockwatch branch March 5, 2021 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Larger than expected number of TicketParams expired errors on orchestrators
2 participants