Slasher (part 1)#1098
Merged
Merged
Conversation
🧪 Network TestsTo run network tests for this PR, use: gh workflow run network-tests.yml -f pr_number=1098Available test options:
Test types: Results will be posted as workflow runs in the Actions tab. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1098 +/- ##
==========================================
- Coverage 60.31% 59.67% -0.65%
==========================================
Files 473 484 +11
Lines 80685 82583 +1898
Branches 80685 82583 +1898
==========================================
+ Hits 48668 49279 +611
- Misses 29692 30954 +1262
- Partials 2325 2350 +25 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
0xdeafbeef
reviewed
Jun 8, 2026
Mododo
approved these changes
Jun 24, 2026
SmaGMan
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds an initial slasher impl. It observes and analyzes blocks validation (a signature collection step after collation). It gives a rough idea of how well each node works. When vset changes each node analyzes each others reports and emits some metrics (stake punishment will be implemented in later PR's).
How does it work
Each validator collects

BlocksBatches that contain a matrix of received signatures from other validator per each block.These block batches are then sent to the Slasher Contract (
message_ttl/message_retry_interval) and at the same time each validator parses all transactions from that contract. So each participant knows all block batches from everyone.When vset changes an analyzer is triggered and all batches are reduced into a list of validator ids to accuse. For now, accusations are only visible on metric
tycho_slasher_accusations_total{pubkey}.Analyzer steps:
vset_len_threshold).slow_node_factor, and flags validators whose statistically adjusted upper-bound rate is still below that slow threshold. Accusation weights from observers are accumulated per each validator.malformed_samples_threshold).Breaking Changes
Validators subset computation now uses a
vset_switch_roundfromconsensus_info.Config Changes
A new section has been added:
{ "slasher": { // TTL of messages to the slasher contract. "message_ttl": "30s", // Interval between message delivery attempts. "message_retry_interval": "1s", // Additional time to wait for the previous batch delivery. "prev_delivery_timeout": "5s", // Validator set round must contain at least this amount of blocks to run analyzer. "vset_len_threshold": 1000, // At least this number of block samples must be collected to accuse someone. "block_samples_threshold": 100, // At least this number of malformed batches must be collected to accuse someone. "malformed_samples_threshold": 5, // We treat the node as slow if its block rate is this times the median rate. "slow_node_factor": 0.5 } }