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

Remove subnetIDs from uptime manager #3235

Merged
merged 31 commits into from
Sep 23, 2024

Conversation

ceyonur
Copy link
Contributor

@ceyonur ceyonur commented Jul 25, 2024

Why this should be merged

With ACP-77, P-chain will not track uptimes; instead every VM should be tracking their own uptimes for their subnets. This removes any subnetID related uptime tracking logic from AvalancheGo/P-chain.

Should be merged after #3226 gets in a release

How this works

  • Removes subnetID params from uptime manager and related interfaces
  • Removes handling of subnet uptimes in APIs and metrics
  • Removes ConnectedSubnet internal message
  • Removes SubnetUptimes and it's handling in p2p ping message

How this was tested

  • Modified UTs
  • Local Testing

Comment on lines +2444 to +2450
func (s *state) GetUptime(vdrID ids.NodeID) (time.Duration, time.Time, error) {
return s.validatorState.GetUptime(vdrID, constants.PrimaryNetworkID)
}

func (s *state) SetUptime(vdrID ids.NodeID, upDuration time.Duration, lastUpdated time.Time) error {
return s.validatorState.SetUptime(vdrID, constants.PrimaryNetworkID, upDuration, lastUpdated)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Intentionally added these here to not modify validator_metadata as we will probably modify it completely by also removing delegateeReward, potential reward etc

@ceyonur ceyonur marked this pull request as ready for review July 29, 2024 23:32
Copy link
Contributor

@marun marun left a comment

Choose a reason for hiding this comment

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

Doc pointers on how a given VM is suggested to track uptime once this is removed? I didn't see mention in the merged version of ACP-77. I'm curious if each VM will have to implement something bespoke if there exists / we intend to provide (e.g. in subnet-evm or hypersdk) an easily configurable facility.

api/info/service.go Show resolved Hide resolved
vms/platformvm/txs/executor/helpers_test.go Outdated Show resolved Hide resolved
vms/platformvm/state/state_test.go Outdated Show resolved Hide resolved
vms/platformvm/service.go Outdated Show resolved Hide resolved
vms/platformvm/service.go Outdated Show resolved Hide resolved
network/peer/peer_test.go Outdated Show resolved Hide resolved
snow/uptime/manager.go Outdated Show resolved Hide resolved
snow/uptime/manager.go Outdated Show resolved Hide resolved
snow/uptime/manager.go Outdated Show resolved Hide resolved
message/ops.go Show resolved Hide resolved
proto/p2p/p2p.proto Outdated Show resolved Hide resolved
snow/uptime/manager.go Outdated Show resolved Hide resolved
vms/platformvm/service_test.go Show resolved Hide resolved
proto/p2p/p2p.proto Outdated Show resolved Hide resolved
snow/uptime/manager.go Outdated Show resolved Hide resolved
vms/platformvm/service.go Outdated Show resolved Hide resolved
ceyonur and others added 5 commits August 6, 2024 11:00
Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>
@ceyonur ceyonur self-assigned this Aug 9, 2024
@ceyonur ceyonur added the acp77 label Aug 9, 2024
@StephenButtolph StephenButtolph added this to the v1.11.12 milestone Sep 22, 2024
@StephenButtolph StephenButtolph changed the title Remove subnetid uptime manager Remove subnetIDs from uptime manager Sep 23, 2024
@StephenButtolph StephenButtolph merged commit c55a011 into master Sep 23, 2024
22 checks passed
@StephenButtolph StephenButtolph deleted the remove-subnetid-uptime-manager branch September 23, 2024 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants