Skip to content

Commit

Permalink
Merge branch 'leon/query_stats_verification' into 'master'
Browse files Browse the repository at this point in the history
feat(CON-1142): QueryStats PayloadBuilder validation

This MR adds the QueryStats validator and unit tests for the validator.

The validator does the following tests: 
- `NodeId` in the payload matches node id of the block (received via `ProposerContext`)
- `epoch > state.aggregated_epoch`: There is a monotony, we can not go back to old epochs
- `epoch <= epoch(certified_height)`: There can't be metrics of height greater than `certified_heights` (It is impossible to serve queries against such heights)
- No duplicate `CanisterId`s within 
    1. the payload
    2. `past_payloads` with the same proposer
    3. unaggregated state with same proposer

All of these conditions are captured by unit tests 

See merge request dfinity-lab/public/ic!15761
  • Loading branch information
Sawchord committed Dec 7, 2023
2 parents 0fea500 + b51a1fa commit bc6ce9b
Show file tree
Hide file tree
Showing 3 changed files with 385 additions and 75 deletions.

0 comments on commit bc6ce9b

Please sign in to comment.