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

Validator improvements. #569

Merged
merged 1 commit into from
Jul 13, 2021
Merged

Validator improvements. #569

merged 1 commit into from
Jul 13, 2021

Conversation

winder
Copy link
Contributor

@winder winder commented Jul 13, 2021

Summary

Validator improvements:

  • Add retry count to error results.
  • Add early exit to retry loop when the rounds are equal.

Test Plan

- Add retry count to error results.
- Add early exit to retry loop when the rounds are equal.
@codecov-commenter
Copy link

codecov-commenter commented Jul 13, 2021

Codecov Report

Merging #569 (5a54138) into develop (8980d9e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #569   +/-   ##
========================================
  Coverage    46.39%   46.39%           
========================================
  Files           24       24           
  Lines         3899     3899           
========================================
  Hits          1809     1809           
  Misses        1818     1818           
  Partials       272      272           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8980d9e...5a54138. Read the comment docs.

@@ -235,7 +236,7 @@ func callProcessor(processor Processor, addrInput string, config Params, results

result, err := processor.ProcessAddress(algodData, indexerData)

if err == nil && (result.Equal || i >= config.retries) {
if err == nil && (result.Equal || result.SameRound || i >= config.retries) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think result.Equal is unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the reward base only changes every 30 rounds or so, most of the time it doesn't matter if we're on the same round. In that case result.Equal can be true and result.SameRound false.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would like to stay on the safe side and only return results with the same round. Efficiency shouldn't suffer since most of the time algod and indexer are synchronized.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There isn't any risk because the comparison has to succeed for the test to pass. Why bother waiting and trying again if the test has already passed?

Copy link
Contributor

Choose a reason for hiding this comment

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

Because two results having same data for different rounds doesn't mean they will have same data for the same round.

Copy link
Contributor

Choose a reason for hiding this comment

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

You are right. But can we make the retry delay 100ms? We can also make the number of retries very large because now we will not retry that many times if there is a discrepancy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That doesn't account for the fact that every time a goroutines is waiting we aren't checking 160/<num-threads> other accounts.

Also, only dots in the output doesn't mean that algod and indexer are synchronized. There's no indicator for matches that ignore that the round is mismatched.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought that Indexer normally lags behind algod by several seconds. We would effectively be pausing the checks by that delta for every round. Hypothetically, lets say Indexer is lagging behind algod by 100ms and we're able to hit that time perfectly.

That would put our idle time at 100ms / 4.4s = 2.3%
In the run from above it took 17.25 hours. (17.25 * 1.023) = 17.25, so an extra ~24 minutes of downtime.

I think those numbers are probably pretty generous and the impact could be much larger.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got 79000 retries in my validation, so I guess it's pretty considerable. Can we still decrease retry timeout to 100ms and increase number of retries?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, you can set those to whatever you want - there are CLI arguments

@winder winder merged commit 17ddbea into develop Jul 13, 2021
@winder winder deleted the will/improve-validator branch July 13, 2021 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants