Remove implicit approval chilling upon slash. (#12420)

* don't read slashing spans when taking election snapshot

* update cargo.toml

* bring back remote test

* fix merge stuff

* fix npos-voters function sig

* remove as much redundant diff as you can

* Update frame/staking/src/pallet/mod.rs

Co-authored-by: Andronik <write@reusable.software>

* fix

* Update frame/staking/src/pallet/impls.rs

* update lock

* fix all tests

* review comments

* fmt

* fix offence bench

* clippy

* ".git/.scripts/bench-bot.sh" pallet dev pallet_staking

Co-authored-by: Andronik <write@reusable.software>
Co-authored-by: Ankan <ankan.anurag@gmail.com>
Co-authored-by: command-bot <>
This commit is contained in:
Kian Paimani
2022-12-12 17:05:13 +00:00
committed by GitHub
parent af46f85e0c
commit 0b29691688
9 changed files with 526 additions and 546 deletions
@@ -776,6 +776,8 @@ impl<B: BlockT> Builder<B> {
/// Inject a hashed prefix. This is treated as-is, and should be pre-hashed.
///
/// Only relevant is `Mode::Online` is being used. Noop otherwise.
///
/// This should be used to inject a "PREFIX", like a storage (double) map.
pub fn inject_hashed_prefix(mut self, hashed: &[u8]) -> Self {
self.hashed_prefixes.push(hashed.to_vec());
@@ -785,6 +787,8 @@ impl<B: BlockT> Builder<B> {
/// Just a utility wrapper of [`Self::inject_hashed_prefix`] that injects
/// [`DEFAULT_CHILD_STORAGE_KEY_PREFIX`] as a prefix.
///
/// Only relevant is `Mode::Online` is being used. Noop otherwise.
///
/// If set, this will guarantee that the child-tree data of ALL pallets will be downloaded.
///
/// This is not needed if the entire state is being downloaded.
@@ -800,6 +804,8 @@ impl<B: BlockT> Builder<B> {
/// Inject a hashed key to scrape. This is treated as-is, and should be pre-hashed.
///
/// Only relevant is `Mode::Online` is being used. Noop otherwise.
///
/// This should be used to inject a "KEY", like a storage value.
pub fn inject_hashed_key(mut self, hashed: &[u8]) -> Self {
self.hashed_keys.push(hashed.to_vec());
@@ -951,7 +957,6 @@ mod tests {
#[cfg(all(test, feature = "remote-test"))]
mod remote_tests {
use super::test_prelude::*;
const REMOTE_INACCESSIBLE: &'static str = "Can't reach the remote node. Is it running?";
#[tokio::test]
async fn offline_else_online_works() {
@@ -970,7 +975,7 @@ mod remote_tests {
))
.build()
.await
.expect(REMOTE_INACCESSIBLE)
.unwrap()
.execute_with(|| {});
// this shows that in the second run, we are not using the remote
@@ -988,7 +993,7 @@ mod remote_tests {
))
.build()
.await
.expect(REMOTE_INACCESSIBLE)
.unwrap()
.execute_with(|| {});
let to_delete = std::fs::read_dir(Path::new("."))
@@ -1018,7 +1023,7 @@ mod remote_tests {
}))
.build()
.await
.expect(REMOTE_INACCESSIBLE)
.unwrap()
.execute_with(|| {});
}
@@ -1033,7 +1038,7 @@ mod remote_tests {
}))
.build()
.await
.expect(REMOTE_INACCESSIBLE)
.unwrap()
.execute_with(|| {});
Builder::<Block>::new()
@@ -1044,7 +1049,7 @@ mod remote_tests {
}))
.build()
.await
.expect(REMOTE_INACCESSIBLE)
.unwrap()
.execute_with(|| {});
}
@@ -1059,7 +1064,7 @@ mod remote_tests {
}))
.build()
.await
.expect(REMOTE_INACCESSIBLE)
.unwrap()
.execute_with(|| {});
Builder::<Block>::new()
@@ -1070,7 +1075,7 @@ mod remote_tests {
}))
.build()
.await
.expect(REMOTE_INACCESSIBLE)
.unwrap()
.execute_with(|| {});
}
@@ -1085,7 +1090,7 @@ mod remote_tests {
}))
.build()
.await
.expect(REMOTE_INACCESSIBLE)
.unwrap()
.execute_with(|| {});
let to_delete = std::fs::read_dir(Path::new("."))
@@ -1126,7 +1131,7 @@ mod remote_tests {
.inject_default_child_tree_prefix()
.build()
.await
.expect(REMOTE_INACCESSIBLE)
.unwrap()
.execute_with(|| {});
let to_delete = std::fs::read_dir(Path::new("."))
@@ -1164,7 +1169,7 @@ mod remote_tests {
}))
.build()
.await
.expect(REMOTE_INACCESSIBLE)
.unwrap()
.execute_with(|| {});
let to_delete = std::fs::read_dir(Path::new("."))
@@ -1203,7 +1208,7 @@ mod remote_tests {
}))
.build()
.await
.expect(REMOTE_INACCESSIBLE)
.unwrap()
.execute_with(|| {});
}
}