-
Notifications
You must be signed in to change notification settings - Fork 19
proptest_state_machine
over PeerMessage
#512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
I wonder if the state machine can be factored out such that:
If that's where this is headed, please point me to the location in the code where I can read it.
I don't know off the top of my head what the right weights are. Consider writing a patch for |
The state machine you're talking about should then be an implementation under testing, not the reference one. I'd be happy to convert something to this approach, but Current implementation indeed heading the way you described. It process the What do you think about not creating neptune-core/src/tests/shared.rs Line 365 in 73ec193
proptest! ? That feels more elegant since state machine brings benefits when there are actual state changes and we're checking it can't find itself in a wrong one. And as with PeerMessage it's by design looping in the single state that makes inevitable proptest-state-machine managing code just a boilerplate. =(
I don't see the point repeating the real freqs in |
fa768a9
to
0f2e21f
Compare
return the <.gitignore> change Revert "initial approach" This reverts commit f5f4b66. the second approach impacting a cached/deterministic/derandomized test align with the review comments replace `TestRunner` with some proper invocations replacing more `TestRunner` couple of strategies on `ChunkDictionary` `TransactionKernel` strategies `prop_compose!` `Utxo` add `Seed` and ditch `rng` invocations from block faking helpers it isn't meaningful to fuzz randomness `tests::shared` doesn't generate it's own randomness anymore last place of randomness in `tests::shared` ditched semantically finished ready for review ditch #proofs_presaved_compat Update src/models/state/wallet/secret_key_material.rs Co-authored-by: aszepieniec <[email protected]> the comment on the `prop_assume` for seeds an import unmerge ditch a temp binding propose solution for `Hash`-based collections in `proptest` expand the proposal to the place where the discussion is changes are moved into Neptune-Crypto#554 finilize `catch_inconsistent_shares` remove few commented out lines consistent naming
…solute index set"
fmt clean and order the strategy clean and order the strategy
381823b
to
d7a243e
Compare
- Replace equal-weight prop_oneof! with weighted strategy - Safe messages (70%): PeerListRequest, valid BlockRequests, valid Blocks - Moderate messages (20%): some random requests with minor risk - Risky messages (8%): invalid blocks, random transactions - Very risky messages (2%): SyncChallenge, SyncChallengeResponse - Increase test sequence length from 1..20 to 1..50 for longer runs - This should prevent frequent peer banning during fuzzing tests
@aszepieniec |
We have to analyze these
Can you point us to a few |
I need to think about "c)"; the first two seems quite extremes of the spectrum yet. 😵💫 And I really like the approach with examples. For a quick peek I hit
Err that the record for tip_digest isn't there. Currently I can imagine how match will be replaced with ? at some point, and then if .unwrap() will be replaced with another ? the behavior will be changed to a wrong one.
|
This
It is fair to assume that the database is not corrupt. If the database is corrupt so as trigger this scenario, there is no way to avoid an application crash. Passing around Rather than uninformatively using Flagging @Sword-Smith for double-checking but in my estimation and based on what I think I don't know there is only a 10% probability that he disagrees with this recommendation. |
@aszepieniec , I'd create a new issue from the previous comment since changing to Let's look at another example. I dug into, but not exhaustively. The test hits https://github.com/skaunov/neptune-core/blob/8698d30980b1bafafc58622fba915df07e890fb5/src/models/state/archival_state.rs#L503; it's called in the |
Wouldn't this |
@Sword-Smith , oh I misinterpreted pruning there - thanks! So is it possible to crash a node with the genesis for the tip? 🤔 |
A peer shouldn't be able to do that. If a peer disagrees on the Genesis block, that should trigger an automatic permaban of that peer. |
It's rough yet, and I'd appreciate review of the main approaches in it while I'm dealing with TODO and groom the whole contribution.
I understood @aszepieniec that the interactions are subject to change, so currently it's only outlined how an interaction outcome actually asserted (messages the peer-loop sends to the main, and checking
standing
). I can only repeat current behavior there, and if there's ideas to tune/amend that I guess it would be right place and time for that.Another decision pending is weighting
PeerMessage
variants. I guess it's important to add random "bad" once a while, but uniform distribution washes away valid interactions to the margin. I can only roughly guess the distribution you might see fit, so it's the other open question.