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

add pausable uptime manager #1340

Merged
merged 9 commits into from
Oct 28, 2024
Merged

Conversation

ceyonur
Copy link
Collaborator

@ceyonur ceyonur commented Sep 12, 2024

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 modifies Connect, Disconnect, StartTracking` accordingly.

How this was tested

Added tests

How is this documented

Comments in code

@ceyonur ceyonur changed the base branch from master to validator-state September 16, 2024 20:03
@ceyonur ceyonur marked this pull request as ready for review September 17, 2024 15:08
@ceyonur ceyonur requested review from darioush and a team as code owners September 17, 2024 15:08
plugin/evm/uptime/pausable_manager.go Outdated Show resolved Hide resolved
plugin/evm/uptime/pausable_manager.go Outdated Show resolved Hide resolved
plugin/evm/uptime/pausable_manager.go Show resolved Hide resolved
plugin/evm/uptime/pausable_manager.go Show resolved Hide resolved
currentTime = addTime(clk, 8*time.Second)
// Uptime should have increased by 8 seconds since the node was connected
checkUptime(t, up, nodeID0, 21*time.Second, currentTime)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we could improve this test using a table, may require some moving items around.
One approach could have callback fns like beforePause, afterPause etc

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

some test cases require restart/reinitializing of manager. so not sure converting it to a table is a easy one.

@ceyonur ceyonur self-assigned this Sep 26, 2024
@ceyonur ceyonur added DO NOT MERGE This PR is not meant to be merged in its current state and removed DO NOT MERGE This PR is not meant to be merged in its current state labels Oct 22, 2024
@ceyonur ceyonur merged commit 245570f into validator-state Oct 28, 2024
12 checks passed
@ceyonur ceyonur deleted the pausable-uptime-manager branch October 28, 2024 18:25
@ceyonur ceyonur restored the pausable-uptime-manager branch October 28, 2024 18:27
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.

2 participants