Skip to content

mempool to slasher stats bridge#1067

Open
Mododo wants to merge 9 commits intofeature/slasher-sessionfrom
viervbifbvkjadsbnbvasdk
Open

mempool to slasher stats bridge#1067
Mododo wants to merge 9 commits intofeature/slasher-sessionfrom
viervbifbvkjadsbnbvasdk

Conversation

@Mododo
Copy link
Copy Markdown
Member

@Mododo Mododo commented Apr 9, 2026

The questionable uncovered corner case: there is a received_and_collated=true fast path, when block is both collated and received from network. Then validation step is omitted and signatures are not reported to slasher. We actually have mempool stats for that block, but currently they are not reported.

Also in case block collation was cancelled by a received block (validate_block() returns ValidationStatus::Skipped) anchor stats are collected but not reported to slasher too.

Slasher contract is left untouched intentionally until we agree on the models and code flow

The drawbacks of suggested design are:

  • at every subset change mempool has to omit max_consensus_lag_rounds=210 rounds of anchor stats, otherwise old vset validator_idxs will be mixed with new one (mempool makes no difference between vset and subset changes), so subsets should not be changed too often
  • stats attributed to anchor are older and don't belong to that anchor history: stats are for dag rounds GC'ed after that anchor and have at least commit_history_rounds=20 rounds lag

Inherited from general design: stats may not be reported to slasher near validation session end because detached validation tasks can finish after the session has already been closed on the slasher side; same for already flushed batches during the same session. Also in case a collated block is replaced by accepted by the quorum, its stats remain in slasher.

Parent branch code suggestion #1068: in ValidatorSessionScope.remap_ids use PeerId to slot map (instead of validator_idx->slot) to allow cross-subset stat collection in mempool (like references_skipped: see commit fix(consensus): mempool stats across subset change)

@Mododo Mododo requested review from MrWad3r, Rexagon and SmaGMan April 9, 2026 14:39
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

🧪 Network Tests

To run network tests for this PR, use:

gh workflow run network-tests.yml -f pr_number=1067

Available test options:

  • Run all tests: gh workflow run network-tests.yml -f pr_number=1067
  • Run specific test: gh workflow run network-tests.yml -f pr_number=1067 -f test_selection=ping-pong

Test types: destroyable, ping-pong, one-to-many-internal-messages, fq-deploy, nft-index, persistent-sync

Results will be posted as workflow runs in the Actions tab.

@Mododo Mododo changed the base branch from master to feature/slasher-session April 9, 2026 14:40
@Mododo Mododo added this to the 105 Slashing - implementation milestone Apr 9, 2026
@Mododo Mododo added C-collator Collator module C-consesus Consesus module labels Apr 9, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 48.58223% with 272 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (feature/slasher-session@0e96c8a). Learn more about missing BASE report.

Files with missing lines Patch % Lines
slasher/src/storage/models.rs 0.00% 43 Missing ⚠️
consensus/src/engine/committer_task.rs 0.00% 34 Missing ⚠️
slasher/src/bc/mod.rs 24.24% 25 Missing ⚠️
slasher/src/bc/stub_contract.rs 19.35% 19 Missing and 6 partials ⚠️
consensus/src/test_utils/anchor_consumer.rs 0.00% 22 Missing ⚠️
slasher/src/collector/validator_events.rs 0.00% 20 Missing ⚠️
slasher-traits/src/validator.rs 42.42% 18 Missing and 1 partial ⚠️
collator/src/mempool/state_update_context.rs 0.00% 13 Missing ⚠️
consensus/src/effects/alt_format.rs 0.00% 12 Missing ⚠️
consensus/src/engine/impl_.rs 0.00% 8 Missing ⚠️
... and 15 more
Additional details and impacted files
@@                    Coverage Diff                     @@
##             feature/slasher-session    #1067   +/-   ##
==========================================================
  Coverage                           ?   56.17%           
==========================================================
  Files                              ?      458           
  Lines                              ?    77089           
  Branches                           ?    77089           
==========================================================
  Hits                               ?    43305           
  Misses                             ?    31670           
  Partials                           ?     2114           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Mododo Mododo force-pushed the viervbifbvkjadsbnbvasdk branch 3 times, most recently from 7ac1bd1 to ceef721 Compare April 10, 2026 11:25
@Mododo Mododo force-pushed the viervbifbvkjadsbnbvasdk branch from c959be2 to 2b844cc Compare April 13, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-collator Collator module C-consesus Consesus module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant