This repository was 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
add dispute metrics, some chores #3842
Merged
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
a5c1027
rename: MsgFilter -> MessageInterceptor
drahnr 44ce041
feat: add dispute metrics
drahnr dd27e29
fixup
drahnr 37ed92a
test fixins
drahnr 4850425
fix metrics
drahnr a2f4b48
dummysubsystem export and trait fn fix
drahnr fd995c7
chore: fmt
drahnr 8afcc0e
undo unwanted changes
drahnr 81e4505
foo
drahnr ee47e9b
pfmt
drahnr 4f14573
fixup
drahnr d906fc3
fixup
drahnr b6c285a
revert
drahnr 8c0bed8
some more
drahnr a0e80f4
Update node/malus/Cargo.toml
drahnr b5e6def
Update node/core/dispute-coordinator/src/metrics.rs
drahnr 7641a4b
Update node/core/dispute-coordinator/src/metrics.rs
drahnr 9f1c632
Update node/core/dispute-coordinator/src/metrics.rs
drahnr 201de95
add license header
drahnr 1211d63
fix lockfile
drahnr 5b5bd91
new with opts
drahnr ad5f5a5
fmt
drahnr d8d177b
Update node/core/dispute-coordinator/src/metrics.rs
drahnr 4f753bf
feature gate
drahnr a911304
Merge remote-tracking branch 'origin/master' into bernhard-dispute-me…
drahnr 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
foo
- Loading branch information
commit 81e45057e1571ea37cf23c4f8fe434411a8f3616
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 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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| use super::*; | ||
drahnr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| use polkadot_node_subsystem_test_helpers::*; | ||
|
|
||
| use polkadot_node_subsystem::{ | ||
| messages::{AllMessages, AvailabilityStoreMessage}, | ||
| DummySubsystem, | ||
| overseer::Subsystem, | ||
| }; | ||
|
|
||
| #[derive(Clone, Debug)] | ||
| struct BlackHoleInterceptor; | ||
|
|
||
| impl<Sender> MessageInterceptor<Sender> for BlackHoleInterceptor | ||
| where | ||
| Sender: overseer::SubsystemSender<AllMessages> + overseer::SubsystemSender<AvailabilityStoreMessage> + Clone + 'static, | ||
| { | ||
| type Message = AvailabilityStoreMessage; | ||
| fn intercept_incoming( | ||
| &self, | ||
| _sender: &mut Sender, | ||
| msg: FromOverseer<Self::Message>, | ||
| ) -> Option<FromOverseer<Self::Message>> { | ||
| None | ||
| } | ||
| } | ||
|
|
||
| async fn overseer_send<T: Into<AllMessages>> ( | ||
| overseer: &mut TestSubsystemContextHandle<T>, | ||
| msg: T, | ||
| ) { | ||
| overseer | ||
| .send(FromOverseer::Communication { msg }) | ||
| .await; | ||
| } | ||
|
|
||
|
|
||
| #[test] | ||
| fn integrity_test() { | ||
| let pool = sp_core::testing::TaskExecutor::new(); | ||
| let (context, mut overseer) = make_subsystem_context(pool); | ||
|
|
||
| let sub = DummySubsystem; | ||
|
|
||
| let sub_intercepted = InterceptedSubsystem::new(sub, BlackHoleInterceptor); | ||
|
|
||
|
|
||
| // Try to send a message we know is going to be filtered. | ||
| let test_fut = async move { | ||
| let (tx, rx) = futures::channel::oneshot::channel(); | ||
| overseer_send( | ||
| &mut overseer, | ||
| AvailabilityStoreMessage::QueryChunk(Default::default(), 0.into(), tx) | ||
| ).await; | ||
| rx.await; | ||
| overseer | ||
| }; | ||
| let subsystem = async move { sub_intercepted.start(context).await; }; | ||
|
|
||
| futures::pin_mut!(test_fut); | ||
| futures::pin_mut!(subsystem); | ||
|
|
||
| futures::executor::block_on(futures::future::join( | ||
| async move { | ||
| let mut overseer = test_fut.await; | ||
| overseer | ||
| .send(FromOverseer::Signal(OverseerSignal::Conclude)) | ||
| .await | ||
| }, | ||
| subsystem, | ||
| )) | ||
| .1 | ||
| .unwrap(); | ||
|
|
||
|
|
||
|
|
||
| } | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.