hedera-services icon indicating copy to clipboard operation
hedera-services copied to clipboard

test: add block contents validator

Open MiroslavGatsanoga opened this issue 5 months ago • 2 comments

Description:

Create additional block stream validator that will validate the structure of the contents in each block.

Related issue(s):

Fixes https://github.com/hashgraph/hedera-services/issues/15474

Notes for reviewer:

Used this doc for defining the checks that the validator makes. There were some exceptions to the rules described, more specifically:

  • For the first block produced by a HapiTest suite run the block_header is followed by state_changes (instead of event_header), due to state migration.
  • There are a lot of blocks that don't have user transaction in them which always contain items of the following types: block_header, event_header, state_changes and state_proof. Those blocks do not adhere to the general rule of An event_header SHALL be followed by one or more event_transaction items.
  • There are two TODOs left to be discussed, namely:
    • In general, a block_header SHALL be followed by an event_header, but for hapiTestRestart we get state change singleton update for BLOCK_INFO_VALUE for a block different than the first one
    • The rule for An event_header SHALL be followed by one or more event_transaction items looks like not quite true since we can have multiple event headers in a row e.g. check results from running hapiTestToken.

Checklist

  • [X] Documented (Code comments, README, etc.)
  • [X] Tested (unit, integration, etc.)

MiroslavGatsanoga avatar Sep 17 '24 14:09 MiroslavGatsanoga