Skip to content

statement-store: add eviction priority ordering tests#11615

Merged
AndreiEres merged 7 commits intomasterfrom
denzelpenzel/statement-store-eviction-tests
Apr 7, 2026
Merged

statement-store: add eviction priority ordering tests#11615
AndreiEres merged 7 commits intomasterfrom
denzelpenzel/statement-store-eviction-tests

Conversation

@DenzelPenzel
Copy link
Copy Markdown
Contributor

@DenzelPenzel DenzelPenzel commented Apr 1, 2026

Description

Implement unit tests for "Eviction: verify the lowest-priority statements are evicted first, corner cases of priority ordering" #11534

Summary

  • Extend the existing constraints() test with eviction priority ordering corner cases:
    • Verify that equal priority statements are rejected with AccountFull when the account is full
    • Verify that specific evicted statement hashes appear in the expired map

@DenzelPenzel DenzelPenzel added T0-node This PR/Issue is related to the topic “node”. T10-tests This PR/Issue is related to tests. and removed T0-node This PR/Issue is related to the topic “node”. labels Apr 1, 2026
@AndreiEres
Copy link
Copy Markdown
Contributor

Honestly I think this fd18545 should be enough to cover this case

Comment thread substrate/client/statement-store/src/lib.rs Outdated
DenzelPenzel and others added 4 commits April 6, 2026 16:20
Address review feedback by removing three standalone eviction tests
and moving the unique cross-timestamp priority assertion into the
existing constraints() test.

The reviewer's commit (fd18545) already added eviction ordering
assertions to constraints() that cover lowest-priority-evicted-first
and equal-priority rejection. The only scenario not covered was
cross-timestamp dominance (a higher expiry timestamp evicts a lower
one regardless of sequence number). That assertion is now added as
an Account 4 section in constraints(), using far-future timestamps
to avoid AlreadyExpired rejection.

Removed tests:
 - eviction_removes_lowest_priority_first_in_order
 - eviction_rejects_equal_priority_statement
 - eviction_sequence_number_ordering_within_same_timestamp
@AndreiEres AndreiEres added the R0-no-crate-publish-required The change does not require any crates to be re-published. label Apr 7, 2026
@AndreiEres AndreiEres enabled auto-merge April 7, 2026 11:56
@AndreiEres
Copy link
Copy Markdown
Contributor

/cmd prdoc --audience node_dev --bump none

@AndreiEres AndreiEres added this pull request to the merge queue Apr 7, 2026
Merged via the queue into master with commit e45c297 Apr 7, 2026
269 of 278 checks passed
@AndreiEres AndreiEres deleted the denzelpenzel/statement-store-eviction-tests branch April 7, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

R0-no-crate-publish-required The change does not require any crates to be re-published. T10-tests This PR/Issue is related to tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants