-
Notifications
You must be signed in to change notification settings - Fork 487
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
Eval: Prefetching for heartbeat transactions #6182
Merged
jannotti
merged 3 commits into
algorand:feature/heartbeats
from
jannotti:heartbeat-prefetch
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
188 changes: 94 additions & 94 deletions
188
daemon/algod/api/server/v2/generated/nonparticipating/public/routes.go
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was confused but then realized you only need a single votingdata field set to validate a heartbeat txn — not even votefirstvalid / votelastvalid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you have a comment in apply/heartbeat.go to discuss why you are checking the current partkey, but maybe the current partkey should still be valid within some check on current round against VoteFirst/LastValid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is true right now. Let me think through whether it's correct.
First, heartbeat always uses the current
VoteID
, not one from 320 rounds ago. That seemed right to me, but I have to look more closely at how theaccountManager.Keys()
method works. I need to ensure that if the service wants to heartbeat in round 10,000 if gets the current key, not the one for 9680.If I keyreg and change my keys in round 10,000, in round 10,100 agreement will still be using my old keys, but I'm saying heartbeat should use new. Weird, but is that more or less weird than using my old keys in
apply.Heartbeat
? Usually, we don't lookback 320 rounds inapply
.I'm beginning to lean toward changing to use the old keys. In that case, it's ok to add the VoteFirst and VoteLast checks, I think, though it should not matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also wondering if you are in the "expired, but still online" state, can you keep sending free heartbeats as much as you want. though we will have auto-population of the ExpiredParticipationAccounts header too soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're concerned that if we don't check VoteFirst/VoteLast that we could get an expired account keeping himself online while his keys are already expired? I suppose that's true. I think I'm leaning toward changing the keys that are used during
apply.Heartbeat
for more consistency, and adding the VoteFirst/VoteLast checks. They won't be a problem if we're using the old keys.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK! eval has access to 320 lookback keys for the voting/online stake, as well as for generating Expired/AbsentParticipationAccounts lists, so adding it to apply doesn't seem that bad. Also having the heartbeat service and agreement service in parity on what keys to grab from the accountmanager seems good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to make that change in it's own PR, it'll probably take a while to get tests operating properly again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, SGTM!