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: rewardservice to use round subscription #1696

Merged
merged 3 commits into from
Dec 10, 2020

Conversation

kyriediculous
Copy link
Contributor

@kyriediculous kyriediculous commented Dec 8, 2020

What does this pull request do? Explain your changes. (required)
Remove polling on a set interval (which executes a ton of RPC requests) to only trying reward when a new round event is received from the TimeWatcher.

Specific updates (required)

  • Start reward service with time watcher
  • use a go routine to start reward service, remove the go-routine inside of rewardService.Start and block instead. This follows the convention of most of our other services
  • use an interface for the TimeWatcher so that we can unit test this service
  • Add basic reward service unit tests
  • Add some methods to the eth.MockClient to facilitate unit tests
  • Use a single channel serviceErr to catch errors from startup goroutines for several services (currently rewardService and redeemer)

How did you test each of these updates (required)
Manually tested using the devtool and added log events
Unit tests

Does this pull request close any open issues?
Fixes #1584

Checklist:

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

@kyriediculous kyriediculous force-pushed the nv/remove-reward-polling branch from c7dde98 to 2a5a59a Compare December 8, 2020 15:33
@kyriediculous kyriediculous marked this pull request as ready for review December 8, 2020 19:48
eth/eventservices/rewardservice.go Outdated Show resolved Hide resolved
eth/eventservices/rewardservice.go Show resolved Hide resolved
eth/eventservices/rewardservice_test.go Show resolved Hide resolved
@kyriediculous kyriediculous force-pushed the nv/remove-reward-polling branch from 791f5bc to 8036467 Compare December 10, 2020 01:01
eth/eventservices/rewardservice.go Outdated Show resolved Hide resolved
eth/eventservices/rewardservice.go Outdated Show resolved Hide resolved
eth/eventservices/rewardservice.go 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 force-pushed the nv/remove-reward-polling branch from d6388cc to 93ca0e2 Compare December 10, 2020 22:21
@kyriediculous kyriediculous merged commit 428a353 into master Dec 10, 2020
@kyriediculous kyriediculous deleted the nv/remove-reward-polling branch December 10, 2020 22:58
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.

Remove polling from reward service
2 participants