Repository navigation
test(validator): property-test slashing protection against the slashing conditions - #913
Open
pablodeymo wants to merge 1 commit into
Open
pablodeymo wants to merge 1 commit into
pablodeymo wants to merge 1 commit into
Conversation
…ng conditions Slashing protection is the one check between a validator client bug and a slashed key. `slashing_protection_properties.rs` drives the real on-disk record through random sequences of what the client does with it: proposals, attestation batches (a key listed twice included), `check_block`, restarts, a move to a fresh directory through an EIP-3076 export and import, imported histories (complete interchanges, written by hand rather than by the module's renderer) and registrations. Besides random votes, it generates relative ones, an honest next vote and a surround attempt, resolved against the key's marks when the step runs. Two oracles, neither taken from the code: - safety, from the consensus specs' slashing conditions: nothing the record approves is a double proposal, a double vote or a surround with anything the key signed, here or in an imported history; - exactness, from the documented EIP-3076 minimal rule: an independent watermark model gives every verdict the record gives, refusal reason included, so honest messages are not refused either. Every approval is a durable write, as in production, so a 40-step case takes about 160 ms on macOS; the default is 100 cases, and longer hunts set `EPHYRA_BUDGET_MS`. Result: 4,294 sequences over 3 seeds (4 minutes each), clean. The oracles are known to fire: a missing source-regression check fails in two steps (import a (1, 2) vote, then attempt (0, 3)), and a write that drops the changed marks fails in one (`Migrate`).
This branch has not been deployed
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.
🗒️ Description / Motivation
Slashing protection is the last check between a validator client bug and a slashed key. This adds an ephyra property that drives the real on-disk record (
src/slashing_protection/) through random sequences of what the client does with it, checked against two oracles that are not derived from the code:Stacked on #904 (ephyra integration). It doesn't depend on #912.
What Changed
crates/validator/tests/slashing_protection_properties.rs(new). The steps are:check_block.crates/validator/Cargo.toml:ephyradev-dependency. The lockfile change is one line.docs/property_testing.mdandCLAUDE.md: the new suite, its cost, and a findings entry.Correctness / Behavior Guarantees
EPHYRA_BUDGET_MS. If this is too slow fortest-node, it can be marked#[ignore]and run by name instead.Migrate); the new directory's record has lost its keys.Tests Added / Run
cargo test --profile release-fast -p ethlambda-validator --test slashing_protection_properties: passes (100 cases).cargo clippy --profile release-fast -p ethlambda-validator --all-targets -- -D warnings: clean.Related Issues / PRs
✅ Verification Checklist
make fmt— cleanmake lint(clippy with-D warnings) — clippy onethlambda-validatoronlymake test(test-consensusplustest-node, atrelease-fast) — the new test only