Malus: Implement storing invalid chunks#4711
Conversation
sandreim
left a comment
There was a problem hiding this comment.
Took a first pass, will take a second one and pay more attention to details vs reference impl.
node/core/av-store/src/lib.rs
Outdated
| let _ = tx.send(a); | ||
| }, | ||
| AvailabilityStoreMessage::QueryChunk(candidate, validator_index, tx) => { | ||
| println!("THIS IS MOST DEFF WORKING"); |
There was a problem hiding this comment.
| println!("THIS IS MOST DEFF WORKING"); | |
| println!("THIS IS MOST DEFF WORKING"); |
node/malus/src/malus.rs
Outdated
| polkadot_cli::run_node(run_cmd(cmd), BackGarbageCandidate)?, | ||
| NemesisVariant::SuggestGarbageCandidate(cmd) => | ||
| polkadot_cli::run_node(run_cmd(cmd), SuggestGarbageCandidate)?, | ||
| NemesisVariant::SuggestGarbageCandidate(_cmd) => panic! {}, |
node/malus/src/malus.rs
Outdated
| NemesisVariant::SuggestGarbageCandidate(cmd) => | ||
| polkadot_cli::run_node(run_cmd(cmd), SuggestGarbageCandidate)?, | ||
| NemesisVariant::SuggestGarbageCandidate(_cmd) => panic! {}, | ||
| //polkadot_cli::run_node(run_cmd(cmd), SuggestGarbageCandidate)?, |
There was a problem hiding this comment.
| //polkadot_cli::run_node(run_cmd(cmd), SuggestGarbageCandidate)?, | |
| //polkadot_cli::run_node(run_cmd(cmd), SuggestGarbageCandidate)?, |
| .await; | ||
| let _ = rx.timeout(std::time::Duration::from_millis(100)).await.unwrap(); | ||
| let resp = rx.timeout(std::time::Duration::from_secs(10)).await.unwrap(); | ||
| println!("RESP {:?}", resp); |
There was a problem hiding this comment.
Should we add these as logs ?
|
|
||
| /// Unix time wrapper with big-endian encoding. | ||
| #[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord)] | ||
| struct BETimestamp(u64); |
There was a problem hiding this comment.
This duplicates https://github.com/paritytech/polkadot/blob/master/node/core/av-store/src/lib.rs#L78. We can reuse that to reduce the amount of code written in malus.
| @@ -0,0 +1,353 @@ | |||
| // Copyright 2021 Parity Technologies (UK) Ltd. | |||
There was a problem hiding this comment.
Can we avoid duplicating this file: https://github.com/paritytech/polkadot/blob/master/node/core/av-store/src/lib.rs ?
| NemesisVariant::StoreMaliciousAvailableData(cmd) => | ||
| polkadot_cli::run_node(run_cmd(cmd), StoreMaliciousAvailableDataWrapper)?, | ||
| NemesisVariant::SuggestGarbageCandidate(cmd) => | ||
| polkadot_cli::run_node(run_cmd(cmd), SuggestGarbageCandidate)?, | ||
| polkadot_cli::run_node(run_cmd(cmd), BackGarbageCandidateWrapper)?, |
There was a problem hiding this comment.
Do we want to maybe combine these eventually? So we can run tests with malicious stored available data and dispute valid candidates for example.
| filter, | ||
| ) | ||
| }) | ||
| .replace_candidate_backing(move |cb| InterceptedSubsystem::new(cb, filter)) |
#4711 Co-authored-by: Lldenaurois <[email protected]> Co-authored-by: Andrei Sandu <[email protected]> Signed-off-by: Andrei Sandu <[email protected]>
…ate` implementation (#5011) * Implement fake validation results Signed-off-by: Andrei Sandu <[email protected]> * refactor Signed-off-by: Andrei Sandu <[email protected]> * cargo lock Signed-off-by: Andrei Sandu <[email protected]> * spell check Signed-off-by: Andrei Sandu <[email protected]> * spellcheck Signed-off-by: Andrei Sandu <[email protected]> * typos Signed-off-by: Andrei Sandu <[email protected]> * Review feedback Signed-off-by: Andrei Sandu <[email protected]> * move stuff around Signed-off-by: Andrei Sandu <[email protected]> * chores Signed-off-by: Andrei Sandu <[email protected]> * Impl valid - still wip Signed-off-by: Andrei Sandu <[email protected]> * fixes Signed-off-by: Andrei Sandu <[email protected]> * fmt Signed-off-by: Andrei Sandu <[email protected]> * Pull Ladi's implementation: #4711 Co-authored-by: Lldenaurois <[email protected]> Co-authored-by: Andrei Sandu <[email protected]> Signed-off-by: Andrei Sandu <[email protected]> * Fix build Signed-off-by: Andrei Sandu <[email protected]> * Logs and comments Signed-off-by: Andrei Sandu <[email protected]> * WIP: suggest garbage candidate + implement validation result caching Signed-off-by: Andrei Sandu <[email protected]> * fix Signed-off-by: Andrei Sandu <[email protected]> * Do commitment hash checks in candidate validation Signed-off-by: Andrei Sandu <[email protected]> * Minor refactor in approval, backing, dispute-coord Signed-off-by: Andrei Sandu <[email protected]> * Working version of suggest garbage candidate Signed-off-by: Andrei Sandu <[email protected]> * Dedup Signed-off-by: Andrei Sandu <[email protected]> * cleanup #1 Signed-off-by: Andrei Sandu <[email protected]> * Fix tests Signed-off-by: Andrei Sandu <[email protected]> * remove debug leftovers Signed-off-by: Andrei Sandu <[email protected]> * fmt Signed-off-by: Andrei Sandu <[email protected]> * Accidentally commited some local test Signed-off-by: Andrei Sandu <[email protected]> * spellcheck Signed-off-by: Andrei Sandu <[email protected]> * some more fixes Signed-off-by: Andrei Sandu <[email protected]> * Refactor and fix it Signed-off-by: Andrei Sandu <[email protected]> * review feedback Signed-off-by: Andrei Sandu <[email protected]> * typo Signed-off-by: Andrei Sandu <[email protected]> * tests review feedback Signed-off-by: Andrei Sandu <[email protected]> * refactor disputer Signed-off-by: Andrei Sandu <[email protected]> * fix tests Signed-off-by: Andrei Sandu <[email protected]> * Fix zombienet disputes test Signed-off-by: Andrei Sandu <[email protected]> * spellcheck Signed-off-by: Andrei Sandu <[email protected]> * fix Signed-off-by: Andrei Sandu <[email protected]> * Fix ui tests Signed-off-by: Andrei Sandu <[email protected]> * fix typo Signed-off-by: Andrei Sandu <[email protected]> Co-authored-by: Lldenaurois <[email protected]>
|
@sandreim does this bring any additional coverage to what we have? If not let's close this |
This PR implements a first attempt at intercepting AvailabilityStoreMessages and writing invalid chunks into the availability store for every
StoreAvailableDatamessage intercepted by the MessageInterceptor.