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

cleanup: shorten upgrade names #605

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

cleanup: shorten upgrade names #605

wants to merge 2 commits into from

Conversation

darioush
Copy link
Collaborator

@darioush darioush commented Jul 22, 2024

Why this should be merged

I think "UpgradeTime" is sufficiently expressive and shorter than "UpgradeBlockTimestamp"

How this works

Renames things, should not impact deployed chains since these values are specified by the avalanchego times not the genesis

How this was tested

CI

@darioush darioush changed the title cleanup: shorten fork names cleanup: shorten upgrade names Jul 22, 2024
@darioush darioush marked this pull request as ready for review July 22, 2024 23:14
@darioush darioush requested a review from ceyonur as a code owner July 22, 2024 23:14
@@ -515,30 +437,30 @@ type ChainConfig struct {
MuirGlacierBlock *big.Int `json:"muirGlacierBlock,omitempty"` // Eip-2384 (bomb delay) switch block (nil = no fork, 0 = already activated)

// Avalanche Network Upgrades
ApricotPhase1BlockTimestamp *uint64 `json:"apricotPhase1BlockTimestamp,omitempty"` // Apricot Phase 1 Block Timestamp (nil = no fork, 0 = already activated)
ApricotPhase1Time *uint64 `json:"apricotPhase1Time,omitempty"` // Apricot Phase 1 Block Timestamp (nil = no fork, 0 = already activated)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the only bit that concerns me: presumably there will be JSON somewhere that is broken by this? I see that you updated some tests, but what needs to change in production?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is mostly fine since we have never used them from a JSON file. However it's concerning that we might have stored this as a part of genesis and we do check them here. If I'm not mistaken this might be broken since the storedcfg will have nil timestamps.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what is the best way to test this? is running a node from scratch sufficient?
should we have some node then apply this patch then restart it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes we should have a node already stored the genesis to test this out.

@darioush
Copy link
Collaborator Author

In subnet-evm, we have:

	SubnetEVMTimestamp *uint64 `json:"subnetEVMTimestamp,omitempty"`
	DurangoTimestamp *uint64 `json:"durangoTimestamp,omitempty"`
	EUpgradeTimestamp *uint64 `json:"eUpgradeTimestamp,omitempty"`

What do you recommend for consistency here?

Notably we have durangoTimestamp vs durangoBlockTimestamp (in coreth)

@ceyonur
Copy link
Collaborator

ceyonur commented Jul 26, 2024

In subnet-evm, we have:

	SubnetEVMTimestamp *uint64 `json:"subnetEVMTimestamp,omitempty"`
	DurangoTimestamp *uint64 `json:"durangoTimestamp,omitempty"`
	EUpgradeTimestamp *uint64 `json:"eUpgradeTimestamp,omitempty"`

What do you recommend for consistency here?

Notably we have durangoTimestamp vs durangoBlockTimestamp (in coreth)

I'd say durangoTimestamp

@ceyonur
Copy link
Collaborator

ceyonur commented Jul 26, 2024

After looking at Subnet-EVM code, I think it's probably best to go with xxxTimestamp as it's almost not possible to rename those JSON fields in Subnet-EVM.

@darioush
Copy link
Collaborator Author

going to move this to draft for now until I fix it up.

@darioush darioush marked this pull request as draft August 22, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants