-
Notifications
You must be signed in to change notification settings - Fork 271
Sync coreth test cleanup v2 #1623
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
base: master
Are you sure you want to change the base?
Conversation
@@ -38,7 +39,13 @@ var ( | |||
} | |||
|
|||
TestChainConfig = &ChainConfig{ | |||
AvalancheContext: AvalancheContext{SnowCtx: utils.TestSnowContext()}, | |||
AvalancheContext: AvalancheContext{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone with additional context could explain why this is necessary here, but was able to be removed in https://github.com/ava-labs/coreth/pull/950/files#r2080300565, that would be appreciated. Did I miss something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only difference is in Verify() where we pass c.SnowCtx.NetworkUpgrades. I think we should explicitly handle that in tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you expand upon what you mean by this - I see now why we do need the context as the verifyNetworkUpgrades
method needs to compare configured timestamps against the expected defaults from the Avalanche config.
require.NoError(t, err) | ||
require.EqualValues(t, feeConfig, testHighFeeConfig) | ||
require.Zero(t, restartedVM.blockChain.CurrentBlock().Number.Cmp(lastChangedAt)) | ||
require.EqualValues(t, restartedVM.blockChain.CurrentBlock().Number, lastChangedAt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know why this changed or why it worked before. Again would appreciate another set of eyes and brain!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two lines are functionally identical except that EqualValues assumes type compatibility?? Really lost as to why this worked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I frankly don't know why tests are broken and why it does not show anything. but it looks like something is broken in plugin/evm/ tests
@@ -38,7 +39,13 @@ var ( | |||
} | |||
|
|||
TestChainConfig = &ChainConfig{ | |||
AvalancheContext: AvalancheContext{SnowCtx: utils.TestSnowContext()}, | |||
AvalancheContext: AvalancheContext{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only difference is in Verify() where we pass c.SnowCtx.NetworkUpgrades. I think we should explicitly handle that in tests.
func setupGenesis( | ||
t *testing.T, | ||
fork upgradetest.Fork, | ||
fallbackGenesisJSON string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we should not need that and just use genesisJson option in newVM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if this would diverge further from coreth? Unless you're asking about the argument - not sure what you mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm talking about the argument, we should not need fallbackGenesisJSON
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you propose getting it alternatively? SubnetEVM and presubnetEVM are not available through the fork/upgradetest
module and there are many instances where these, or custom JSONs are passed and need to be set.
Largely mirrors ava-labs/coreth#950, but this time I don't make mistakes 😎
Do note that this PR goes beyond a simple drop in and replace in from ava-labs/coreth#950 as the testing framework upgrade had implications for tests and functionality not included in coreth (which is why I messed up on first revision)
No breaking changes
Does not require release notes