This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Malus: Implement storing invalid chunks #4711
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5367f35
First attempt to implement storing malicious chunks
Lldenaurois f8e2de4
Suggest garbage candidate
Lldenaurois 50eae31
Fix build error
Lldenaurois 6b0bdaf
Remove comment
Lldenaurois 98bfb89
Fix binary build
Lldenaurois 258b229
Add both variants to the malus binary
Lldenaurois a431471
Merge remote-tracking branch 'parity/master' into malus_backing
Lldenaurois 2b40707
Merge remote-tracking branch 'parity/master' into malus_backing
Lldenaurois 301e566
WORKING
Lldenaurois File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,19 @@ | |
// You should have received a copy of the GNU General Public License | ||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
use super::*; | ||
|
||
use polkadot_node_subsystem_test_helpers::*; | ||
|
||
use polkadot_node_subsystem::{ | ||
messages::{AllMessages, AvailabilityStoreMessage}, | ||
overseer::{dummy::DummySubsystem, gen::TimeoutExt, Subsystem}, | ||
overseer::{self, dummy::DummySubsystem, gen::TimeoutExt, OverseerSignal, Subsystem}, | ||
SubsystemError, | ||
}; | ||
|
||
use futures::Future; | ||
|
||
// Filter wrapping related types. | ||
use crate::interceptor::*; | ||
|
||
#[derive(Clone, Debug)] | ||
struct BlackHoleInterceptor; | ||
|
||
|
@@ -131,7 +134,8 @@ fn integrity_test_pass() { | |
AvailabilityStoreMessage::QueryChunk(Default::default(), 0.into(), tx), | ||
) | ||
.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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add these as logs ? |
||
overseer | ||
}, | ||
sub_intercepted, | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,11 +35,9 @@ use crate::interceptor::*; | |
|
||
// Import extra types relevant to the particular | ||
// subsystem. | ||
use polkadot_node_core_backing::CandidateBackingSubsystem; | ||
use polkadot_node_subsystem::messages::{ | ||
ApprovalDistributionMessage, CandidateBackingMessage, DisputeCoordinatorMessage, | ||
}; | ||
use sp_keystore::SyncCryptoStorePtr; | ||
|
||
use std::sync::Arc; | ||
|
||
|
@@ -104,17 +102,10 @@ impl OverseerGen for DisputeValidCandidates { | |
RuntimeClient::Api: ParachainHost<Block> + BabeApi<Block> + AuthorityDiscoveryApi<Block>, | ||
Spawner: 'static + SpawnNamed + Clone + Unpin, | ||
{ | ||
let spawner = args.spawner.clone(); | ||
let crypto_store_ptr = args.keystore.clone() as SyncCryptoStorePtr; | ||
let filter = ReplaceApprovalsWithDisputes; | ||
|
||
prepared_overseer_builder(args)? | ||
.replace_candidate_backing(move |cb| { | ||
InterceptedSubsystem::new( | ||
CandidateBackingSubsystem::new(spawner, crypto_store_ptr, cb.params.metrics), | ||
filter, | ||
) | ||
}) | ||
.replace_candidate_backing(move |cb| InterceptedSubsystem::new(cb, filter)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
.build_with_connector(connector) | ||
.map_err(|e| e.into()) | ||
} | ||
|
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to maybe combine these eventually? So we can run tests with malicious stored available data and dispute valid candidates for example.