Skip to content

op-service: Ensure block body validation tests fail for the expected reason#8064

Merged
ajsutton merged 3 commits intodevelopfrom
aj/verify-more-than-block-hash
Nov 9, 2023
Merged

op-service: Ensure block body validation tests fail for the expected reason#8064
ajsutton merged 3 commits intodevelopfrom
aj/verify-more-than-block-hash

Conversation

@ajsutton
Copy link
Contributor

@ajsutton ajsutton commented Nov 6, 2023

Description

Adds a reason to the rpc block validation tests to ensure that the block is rejected for the intended reason and not for an unintended error in the test data (typically the block hash not matching).

Adds coverage for:

  • nil transactions and withdrawals
  • blocks with correct block hash but a transaction or withdrawal root that doesn't match the actual tx or withdrawals

Previously all tests would pass even if the validation of the actual transactions and withdrawals was completely removed.

The block body tests are no longer generated by the gen.sh script because while these were a useful starting point, they were quite limited in what they actually tested. Manually modifying the content was a lot easier than having the generation script compute correct block hashes etc.

Noticed the lack of test coverage in #7993.

…reason.

Adds coverage for nil transactions and withdrawals and blocks with correct block hash but a transaction or withdrawal root that doesn't match the body.
Removes the generation of body tests from the script as the generated scripts were a useful start, but ultimately ineffective at testing the code.
@ajsutton ajsutton requested a review from a team as a code owner November 6, 2023 23:38
@ajsutton ajsutton requested review from Inphi and protolambda November 6, 2023 23:38
@ajsutton
Copy link
Contributor Author

ajsutton commented Nov 8, 2023

ugh, sorry for the noise - GitHub wasn't showing my comments as posted, hence the repeated attempts. Now it's showing up...

@trianglesphere trianglesphere requested a review from Inphi November 8, 2023 22:41
@ajsutton ajsutton added this pull request to the merge queue Nov 9, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 9, 2023
@ajsutton ajsutton enabled auto-merge November 9, 2023 00:26
@ajsutton ajsutton added this pull request to the merge queue Nov 9, 2023
Merged via the queue into develop with commit b16608e Nov 9, 2023
@ajsutton ajsutton deleted the aj/verify-more-than-block-hash branch November 9, 2023 02:17
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