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

validation: decouple GasToken tests #803

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

bitwiseguy
Copy link
Collaborator

Closes #773

@bitwiseguy bitwiseguy requested a review from a team as a code owner December 17, 2024 20:44
@bitwiseguy bitwiseguy force-pushed the ss/refactor-gas-token branch from 7552640 to b2549f3 Compare December 19, 2024 02:22
validation/gas_token.go Outdated Show resolved Hide resolved
}
}

isCustomGasToken, err = getBool("isCustomGasToken()", superchain.Addresses[chain.ChainID].SystemConfigProxy, l2Client)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this use an l1Client?

I'd like us to revisit the "reverting is acceptable" case b/c it seems like it could be hiding many skeletons like this one. Can we double check it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yea this should be an l1Client. Good catch. What are the pre/post comments referring to? Pre-what? Those comments were just copied from existing code

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think what this is trying to do is to cope with deployments of the SystemConfig which don't expose the isCustomGasToken() method. This would indicate they don't support custom gas tokens and therefore should automatically pass the test. A better approach would be to read the semver here, and unless it is greater than or equal to some version (which we would need to look up or ask someone for) we don't do the rest of the check.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe there is a semver for the SystemConfigProxy we could check?

If its < a certain value, we don't make the following calls at all (because the method doesn't exist?):

  • SystemConfigProxy.isCustomGasToken()
  • L1BlockPredeploy.isCustomGasToken()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Discussed some findings on semver in this discord thread. Not sure how to proceed at the moment. The isCustomGasToken() method seems to be missing on the latest standard version of the SystemConfig contract

validation/gas_token.go Show resolved Hide resolved
validation/gas_token_test.go Outdated Show resolved Hide resolved
validation/gas_token_test.go Outdated Show resolved Hide resolved
validation/gas_token.go Outdated Show resolved Hide resolved
validation/gas_token_test.go Outdated Show resolved Hide resolved
validation/gas_token.go Show resolved Hide resolved
require.NoError(t, err)
}

func CheckGasToken(chain *superchain.ChainConfig, l1Client EthClient) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did we add a unit test for this yet? That is what I would expect in gas_token_test.go.

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.

validation: refactor gas-token check
2 participants