-
Notifications
You must be signed in to change notification settings - Fork 238
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
Pausable uptime manager #1372
Pausable uptime manager #1372
Conversation
Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org> Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org> Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org> Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
…/subnet-evm into pausable-uptime-manager
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.
Could you confirm my understanding based on going through this code in the context of ACP-77?
- Validators can are either connected/disconnected and active/inactive.
- A connected & inactive validator represents a validators running properly, but out of PAYG on the P-Chain
- A connected & active validator is both running properly and has non-zero balance on the P-Chain
- A disconnected & active validator represents an offline node that still has non-zero balance on the P-Chain
- A disconnected & inactive validator is a node that is both offline and out of PAYG balance.
- We pause nodes when they are marked as inactive, and when we pause them, we disconnect from them if we were previously connected.
- We resume nodes when they are marked as active, and reconnect to them then if necessary.
- A nodes uptime is incremented when: (it is both active and connected) OR (it isn't tracked). The second part is because we assume validators are online while we ourselves are offline.
Yes, those two states are different though. They can be connected/active disconnected/inactive etc...
True
True
True
True
True, the inner manager (who does the actual uptime tracking) is disconnected.
True. Note that they're already connected (in p2p), we just start increasing their uptime in manager.
true |
Why this should be merged
Adds pausable uptime manager interface for uptime tracking
How this works
Pausable uptime manager extends the avalanchego uptime manager by introducing callback listeners for validators state (under
plugin/evm/validators
). The idea is to pause a node's uptime and then can continue whenever it's resumed. It also modifiesConnect
,Disconnect,
StartTracking` accordingly.How this was tested
Added tests
How is this documented
Comments in code