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

simulators/ethereum/engine: Increase bad hash tests coverage #521

Merged
merged 1 commit into from
Apr 25, 2022

Conversation

marioevz
Copy link
Member

@marioevz marioevz commented Apr 7, 2022

Adds first batch of new tests based on the coverage document by @mkalinin (link).

Tests added:

  • EL Not SYNCING: Invalid hash payload extending side chain
  • EL SYNCING: Invalid hash payload extending canonical chain
  • EL SYNCING: Invalid hash payload extending side chain chain

Follow up PRs will fill remaining gaps. Please advice if this format is fine: small number of new tests per PR, or a big PR with all test cases is better.

@marioevz
Copy link
Member Author

Hey @fjl @holiman, let me know if these changes are ok.

I changed some string constants for an Enum, which I think looks cleaner.

Also I added a comment with a diagram to better exemplify what the test case is trying to cover, but let me know if these kinds of diagrams are frowned upon 👀

@marioevz marioevz marked this pull request as draft April 15, 2022 16:02
@marioevz
Copy link
Member Author

I'm converting this to draft since I would like to merge a refactor that much improves readability of the test cases before this one.

@fjl
Copy link
Collaborator

fjl commented Apr 17, 2022

IMHO the enum is fine, but you can also just define constants for the string values.

Diagrams also fine.

@marioevz marioevz force-pushed the bad-hash-coverage branch from 9b64e50 to f216aa4 Compare April 22, 2022 10:40
@marioevz marioevz marked this pull request as ready for review April 22, 2022 10:42
@fjl fjl merged commit 2c672f6 into ethereum:master Apr 25, 2022
@marioevz marioevz deleted the bad-hash-coverage branch April 25, 2022 09:19
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.

2 participants