Skip to content

Align minCompatibleTime settings across TestNetwork and Network #3842

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

Merged
merged 1 commit into from
Jun 2, 2025

Conversation

michaelkaplan13
Copy link
Contributor

@michaelkaplan13 michaelkaplan13 commented Mar 26, 2025

Why this should be merged

Aligns TestNetwork compatibility with the Network created for full AvalancheGo nodes here. This should be updated in the future when required network upgrades are scheduled.

How this works

Passes the full UpgradeConfig to NewNetwork such that all callers (currently just node.go and test_network.go will use the same upgrade as the minimum compatible timestamp. This reduces the number of places where changes need to be made for each network upgrade in order to have Network instances be compatible.

It also results in the min compatible time of the TestNetwork being bumped to the FortunaTime.

How this was tested

N/A

Need to be documented in RELEASES.md?

No

Copy link
Contributor

@cam-schultz cam-schultz left a comment

Choose a reason for hiding this comment

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

Could we instead remove minCompatibilityTime from NewNetwork altogether, and use FortunaTime in all instances? That way the activation time used by the test network is covered by general Network upgrade tests (i.e. e2e tests that run full nodes).

@michaelkaplan13
Copy link
Contributor Author

Could we instead remove minCompatibilityTime from NewNetwork altogether, and use FortunaTime in all instances? That way the activation time used by the test network is covered by general Network upgrade tests (i.e. e2e tests that run full nodes).

I debated that, or adding the minCompatibleTime to the upgrade.Config somehow, so that nothing in the Network code needs to be changed for future network upgrades.

I think the minCompatibleTime can be defined as the time of the next scheduled network upgrade activation or, if there are no scheduled upgrades in the future, the time the last network upgrade activated.

Either way, I agree minimizing the number of places updates need to be made should be the goal in order to reduce the chance that any are missed in the future.

@michaelkaplan13
Copy link
Contributor Author

Could we instead remove minCompatibilityTime from NewNetwork altogether, and use FortunaTime in all instances? That way the activation time used by the test network is covered by general Network upgrade tests (i.e. e2e tests that run full nodes).

I updated the PR to this approach now. I agree it's less error prone since there's only one place where the minCompatibleTime is defined, and should be covered in the E2E tests. The downside is needing to pass the full upgrade.Config to NewNetwork, and the minCompatibleTime definition being embedded in the implementation is harder to find.

I'm pretty indifferent between the options myself really, open to everyone's input.

@michaelkaplan13 michaelkaplan13 changed the title Set TestNetwork minCompatibleTime to Fortuna Activation Align minCompatibleTime settings across TestNetwork and Network Apr 21, 2025
Copy link

This PR has become stale because it has been open for 30 days with no activity. Adding the lifecycle/frozen label will cause this PR to ignore lifecycle events.

@michaelkaplan13 michaelkaplan13 force-pushed the test-network-default-min-compatible branch from 9e5ddbd to 4f46c42 Compare May 30, 2025 21:43
@StephenButtolph StephenButtolph added this pull request to the merge queue Jun 2, 2025
Merged via the queue into master with commit bba3a5e Jun 2, 2025
26 checks passed
@StephenButtolph StephenButtolph deleted the test-network-default-min-compatible branch June 2, 2025 15:07
@github-project-automation github-project-automation bot moved this from In Progress 🏗️ to Done 🎉 in avalanchego Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done 🎉
Development

Successfully merging this pull request may close these issues.

4 participants