hedera-services
hedera-services copied to clipboard
test: add block contents validator
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 bystate_changes
(instead ofevent_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
andstate_proof
. Those blocks do not adhere to the general rule ofAn 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 anevent_header
, but forhapiTestRestart
we get state change singleton update forBLOCK_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 runninghapiTestToken
.
- In general, a
Checklist
- [X] Documented (Code comments, README, etc.)
- [X] Tested (unit, integration, etc.)