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

Geth v1.12.2 nits #1099

Merged
merged 25 commits into from
Feb 21, 2024
Merged

Geth v1.12.2 nits #1099

merged 25 commits into from
Feb 21, 2024

Conversation

ceyonur
Copy link
Collaborator

@ceyonur ceyonur commented Feb 19, 2024

Mostly cosmetic changes to reduce diff between upstream

@ceyonur ceyonur self-assigned this Feb 19, 2024
@ceyonur ceyonur mentioned this pull request Feb 19, 2024
// dataLock protects the [data] field to prevent a race condition
// in the transaction pool tests. TODO remove after re-implementing
// tx pool to be synchronous.
dataLock sync.RWMutex
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we sure this is safe to remove?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think these were fixed way before with ava-labs/coreth@8e32d43#diff-64a06d0cea30e12d6001fb322e583930c1cf3879bca4e8019fa89499ed9f7de4

Also seems like this was only an issue in tests. cc @aaronbuchwald

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I also added -race flag to UTs to catch these.

if len(set) > 1 {
Fatalf("Flags %v can't be used at the same time", strings.Join(set, ", "))
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I added this so we can avoid copying the entire cmd/utils package when doing the geth update.
This is because the entire cmd/utils package imports a lot of geth code.
So I think it's better to leave this in place with only the 2 functions we use from this package.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I totally forgot we refactored this. Reverted it and moved Fatalf function to cmd.go as in upstream.

// network upgrades
func (c *ChainConfig) AvalancheRules(blockNum *big.Int, timestamp uint64) Rules {
func (c *ChainConfig) Rules(blockNum *big.Int, timestamp uint64) Rules {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if we rename this method to Rules, like it is in upstream, should we also take the same bool isMerge parameter?
Honestly it's kinda weird that they have the isMerge parameter, but I think if the name matches the signature should also match, otherwise perhaps it's better to leave it as AvalancheRules.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

IMO we should not use that isMerge param. but I also slightly think it is probably better to use same Rules function. I can revert that if you think we should be using AvalancheRules instead.

@ceyonur ceyonur marked this pull request as ready for review February 21, 2024 13:56
@darioush darioush merged commit 7c77dff into geth-v1.12.2-x Feb 21, 2024
8 checks passed
@darioush darioush deleted the geth-v1.12.2-nits branch February 21, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants