Skip to content
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

stake-tracker remote externalities tests + improvements #4436

Closed
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
2ed0f3e
rustls: Disable logging (#4426)
bkchr May 10, 2024
0044077
Disabling Strategy Implementers Guide (#2955)
Overkillus May 10, 2024
7d63e90
add stake tracker migration test
Ank4n May 9, 2024
a993513
Add docs to request_core_count (#4423)
seadanda May 10, 2024
84d6437
Remove pallet::getter usage from pallet-contracts-mock-network (#4417)
PolkadotDom May 10, 2024
32deb60
Remove `pallet::getter` usage from authority-discovery pallet (#4091)
PolkadotDom May 10, 2024
75f06ce
ext tests and changes
gpestana May 11, 2024
9e0e5fc
xcm-emlator: Use `BlockNumberFor` instead of `parachains_common::Bloc…
bkontur May 12, 2024
5f31981
`remote-externalities`: store block header in snapshot (#4349)
liamaharon May 12, 2024
efc2132
migrations: `take()`should consume read and write operation weight (#…
dastansam May 12, 2024
0fcbd4e
Remove `substrate-frame-cli` (#4403)
ggwpez May 13, 2024
805d54d
Rococo AH: undeploy trie migration (#4414)
ggwpez May 13, 2024
f4b73bd
Add generate and verify logic for `AncestryProof` (#4430)
serban300 May 13, 2024
6d3a6d8
`CheckWeight` SE: Check for extrinsic length + proof size combined (#…
skunert May 13, 2024
477a120
[ci] Add forklift to GHA ARC (#4372)
alvicsam May 13, 2024
d68b3ac
more improvements (wip)
gpestana May 13, 2024
d36da12
prospective-parachains rework (#4035)
alindima May 13, 2024
e973ac9
[ci] Run check-runtime-migration in GHA (#4441)
alvicsam May 13, 2024
fb7362f
Bump `proc-macro-crate` to the latest version (#4409)
tdimitrov May 13, 2024
594c3ed
improve MockValidationDataInherentDataProvider to support async back…
librelois May 13, 2024
115c247
Bridge: use *-uri CLI arguments when starting relayer (#4451)
svyatonik May 14, 2024
cedb1d4
[ci] Cleanup and order GHA workflows (#4449)
alvicsam May 14, 2024
5ac1874
Bridge: add subcommand to relay messages range (#4383)
svyatonik May 14, 2024
712a750
Bump nix from 0.27.1 to 0.28.0 (#4438)
dependabot[bot] May 14, 2024
12ab315
make polkadot-parachain chain-spec extension more relaxed (#4452)
kianenigma May 14, 2024
9c69bb9
Change forks pruning algorithm. (#3962)
shamil-gadelshin May 15, 2024
494f123
Bump fatality crate to 0.1.1 (#4464)
alexggh May 15, 2024
005e3a7
Please consider adding RadiumBlock bootnodes for Westend People and W…
radiumb May 15, 2024
3fcdada
chore: update zombienet version (#4463)
pepoviola May 15, 2024
e6d934c
Update BABE README.md (#4138)
drewstone May 15, 2024
4d47b44
Introduces: Delegated Staking Pallet (#3904)
Ank4n May 15, 2024
f2b367e
Add OnFinality kusama bootnode (#4458)
AlexZhenWang May 15, 2024
404027e
Fix extrinsics count logging in frame-system (#4461)
liuchengxu May 15, 2024
59d7e03
Export all public functions of `sc-service` (#4457)
dastansam May 15, 2024
e31fcff
Make vscode rustanalyzer fast again (#4470)
alexggh May 15, 2024
23c5bbc
[ci] Use default gh runners for small workloads (#4473)
alvicsam May 15, 2024
3a20232
Include RUNTIME_METADATA_HASH in cache key (#4476)
AndWeHaveAPlan May 15, 2024
d237adf
Add IBP bootnodes to `coretime-westend` and `coretime-kusama` and oth…
miloskriz May 15, 2024
289f5bb
XCM Cookbook (#2633)
franciscoaguirre May 16, 2024
717eb2c
[ci] Fix publish-subsystem-benchmarks (#4479)
alvicsam May 16, 2024
76230a1
Deprecate `dmp-queue` pallet (#4475)
ggwpez May 16, 2024
6487ac1
Remove pallet::getter usage from the bounties and child-bounties pall…
PolkadotDom May 16, 2024
4adfa37
[Runtime] Bound XCMP queue (#3952)
ggwpez May 16, 2024
3399bc0
network/discovery: Add to DHT only peers that support genesis-based p…
lexnv May 16, 2024
453bb18
Bridge: drop subscriptions when they are no longer required (#4481)
svyatonik May 16, 2024
8d29397
Demote per-peer validation slots warning to debug (#4480)
dmitry-markin May 16, 2024
04f88f5
Remove pallet::getter usage from the democracy pallet (#4472)
PolkadotDom May 16, 2024
943eb46
Snowbridge - Ethereum Client - Reject finalized updates without a syn…
claravanstaden May 16, 2024
d5fe478
Adds `MaxRank` Config in `pallet-core-fellowship` (#3393)
Doordashcon May 16, 2024
b342eac
remove dandling and dedups; refactors try-state to staking; and other…
gpestana May 16, 2024
9f30963
nit
gpestana May 16, 2024
f86f213
Contracts: remove kitchensink dynamic parameters (#4489)
pgherveou May 17, 2024
2c48b9d
Bridge: fixed relayer version metric value (#4492)
svyatonik May 17, 2024
45439b8
simplifications, improvements
gpestana May 17, 2024
ca0fb0d
pallet_balances: Add `try_state` for checking `Holds` and `Freezes` (…
bkchr May 17, 2024
65c5248
Snowbridge - Ethereum Client - Public storage items (#4501)
claravanstaden May 17, 2024
2e36f57
Allow pool to be destroyed with an extra (erroneous) consumer referen…
Ank4n May 17, 2024
a90d324
Contracts: Remove topics for internal events (#4510)
pgherveou May 17, 2024
247358a
chore: fix typos (#4515)
jimwfs May 19, 2024
e7b6d7d
`remote-externalities`: `rpc_child_get_keys` to use paged scraping (#…
liamaharon May 19, 2024
313fe0f
Remove usage of the pallet::getter macro from pallet-fast-unstake (#4…
PolkadotDom May 20, 2024
278486f
Remove the prospective-parachains subsystem from collators (#4471)
alindima May 21, 2024
b00e168
[xcm]: Use latest `Versioned*` instead of `V4` + bridges doc nits (#4…
bkontur May 21, 2024
d54feeb
Fixed RPC subscriptions leak when subscription stream is finished (#4…
svyatonik May 21, 2024
e0e1f2d
Bridge: added force_set_pallet_state call to pallet-bridge-grandpa (#…
svyatonik May 21, 2024
d05786f
Replace `Multiaddr` & related types with substrate-specific types (#4…
dmitry-markin May 21, 2024
ec46106
chore: bump zombienet version (#4535)
pepoviola May 21, 2024
e86bb91
Update subsystem benchmark baselines (#4532)
AndreiEres May 22, 2024
c7cb1f2
Add Extra Check in Primary Username Setter (#4534)
joepetrowski May 22, 2024
04161b1
Remove `parameterized-consensus-hook` feature (#4380)
s0me0ne-unkn0wn May 22, 2024
b06306c
[Backport] Version bumps and prdocs reordering from 1.12.0 (#4538)
EgorPopelyaev May 22, 2024
ad54bc3
fixed link (#4539)
fasteater May 22, 2024
eda9895
rustls: Disable logging again (#4541)
bkchr May 22, 2024
8dbe4ee
Implement `CheckMetadataHash` extension (#4274)
bkchr May 22, 2024
ae864e6
Update README.md (#4502)
kianenigma May 22, 2024
8949856
Refactor Nomination Pool to support multiple staking strategies (#3905)
Ank4n May 22, 2024
fd16191
Fix README.md Logo URL (#4546)
kianenigma May 23, 2024
a823d18
Fix bridges grandpa benchmarks (#2577) (#4548)
bkontur May 23, 2024
493ba5e
Contracts: Rework host fn benchmarks (#4233)
pgherveou May 23, 2024
03bbc17
Define `OpaqueValue` (#4550)
serban300 May 23, 2024
48d4f65
Mention new XCM docs in sdk docs (#4558)
franciscoaguirre May 23, 2024
700d591
Use polkadot-ckb-merkle-mountain-range dependency (#4562)
serban300 May 24, 2024
ef144b1
Attempt to avoid specifying `BlockHashCount` for different `mocking::…
bkontur May 24, 2024
49bd6a6
Remove litep2p git dependency (#4560)
ggwpez May 24, 2024
1c7a1a5
Polkadot-SDK Umbrella Crate (#3935)
ggwpez May 24, 2024
f469fbf
availability-recovery: bump chunk fetch threshold to 1MB for Polkadot…
sandreim May 24, 2024
e192b76
Avoid using `xcm::v4` and use latest instead for AssetHub benchmarks …
bkontur May 24, 2024
9201f9a
Deprecate XCMv2 (#4131)
franciscoaguirre May 27, 2024
f6cca7e
Bridge: check submit_finality_proof limits before submission (#4549)
svyatonik May 27, 2024
0a752af
Bridge: add subcommand to relay messages delivery confirmation (#4453)
svyatonik May 27, 2024
89b67bc
chore: fix typos (#4590)
omahs May 27, 2024
e0edb06
Add release version to commits and branch names of template synchroni…
rzadp May 27, 2024
2352982
Make markdown lint CI job pass (#4593)
skunert May 27, 2024
ce3e9b7
network: Update litep2p to v0.5.0 (#4570)
lexnv May 27, 2024
0139b15
refactoring and improvements (still failing)
gpestana May 27, 2024
16887b6
chain-spec-builder: help updated (#4597)
michalkucharczyk May 27, 2024
70dd67a
check-weight: Disable total pov size check for mandatory extrinsics (…
skunert May 27, 2024
a709768
[subsystem-benchmarks] Add statement-distribution benchmarks (#3863)
AndreiEres May 27, 2024
2d3a693
`sc-chain-spec`: deprecated code removed (#4410)
michalkucharczyk May 27, 2024
09f07d5
Remove workspace lints from templates (#4598)
rzadp May 28, 2024
523e625
Add availability-recovery from systematic chunks (#1644)
alindima May 28, 2024
3bf283f
[subsytem-bench] Remove redundant banchmark_name param (#4540)
AndreiEres May 28, 2024
bcda9a7
nits
gpestana May 28, 2024
6ed0200
[CI] Deny adding git deps (#4572)
ggwpez May 28, 2024
ea46ad5
Conditional `required` checks (#4544)
AndWeHaveAPlan May 28, 2024
650b124
Improve On_demand_assigner events (#4339)
bolajahmad May 28, 2024
ad22fa6
Add metric to measure the time it takes to gather enough assignments …
alexggh May 28, 2024
2b1c606
parachain-inherent: Make `para_id` more prominent (#4555)
bkchr May 28, 2024
d6cf147
Filter workspace dependencies in the templates (#4599)
rzadp May 28, 2024
5f68c93
Moves runtime macro out of experimental flag (#4249)
codekitz May 29, 2024
89604da
Add omni bencher & chain-spec-builder bins to release (#4557)
EgorPopelyaev May 29, 2024
dfcfa4a
Publish `chain-spec-builder` (#4518)
kianenigma May 29, 2024
aa32faa
Update README.md (#4623)
joshuacheong May 29, 2024
6613c41
removes force chilling in migrations; replaces with for re-nominate
gpestana May 29, 2024
d5053ac
Change `XcmDryRunApi::dry_run_extrinsic` to take a call instead (#4621)
franciscoaguirre May 29, 2024
f4dc8d2
Broker new price adapter (#4521)
eskimor May 29, 2024
4ab078d
pallet-staking: Put tests behind `cfg(debug_assertions)` (#4620)
bkchr May 29, 2024
bcdab07
merge migration phases into 2
gpestana May 30, 2024
153e06f
small ref
gpestana May 30, 2024
bcab07a
Beefy client generic on aduthority Id (#1816)
drskalman May 30, 2024
46a80f1
nits, benchs passing
gpestana May 30, 2024
3bfed97
migration docs; clippy fixes
gpestana May 30, 2024
d539778
Fix broken windows build (#4636)
conr2d May 30, 2024
7fcc09b
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
May 30, 2024
78c24ec
Adds ability to specify chain type in chain-spec-builder (#4542)
codekitz May 31, 2024
71f4f5a
Update `runtime_type` ref doc with the new "Associated Type Bounds" (…
kianenigma May 31, 2024
0ae7219
collator-protocol: remove `elastic-scaling-experimental` feature (#4595)
sandreim May 31, 2024
8d8c0e1
Use Unlicense for templates (#4628)
rzadp May 31, 2024
fc6c318
Implement `XcmPaymentApi` and `DryRunApi` on all system parachains (#…
franciscoaguirre May 31, 2024
b286d3e
benches with lazy voter sorting
gpestana Jun 1, 2024
b50783f
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Jun 1, 2024
f81751e
Better error for missing index in CRV2 (#4643)
codekitz Jun 2, 2024
5779ec5
update amforc westend and its parachain bootnodes (#4641)
tugytur Jun 2, 2024
795bc77
[Pools] Refactors and runtime apis for DelegateStake (#4537)
Ank4n Jun 3, 2024
27a5732
make all storage items in parachain-system public (#4645)
girazoki Jun 3, 2024
63f0cbf
Update Amforc bootnodes for Kusama and Polkadot (#4668)
tugytur Jun 3, 2024
f66e693
Add chain-spec-builder docker image (#4655)
EgorPopelyaev Jun 3, 2024
05c0d0e
nits for voter update mode
gpestana Jun 3, 2024
4962491
Merge branch 'master' into gpestana/stake-tracker_integration
gpestana Jun 3, 2024
5c6a35f
Merge branch 'gpestana/stake-tracker_integration' into gpestana/stake…
gpestana Jun 3, 2024
17705b8
nit fix after merge master
gpestana Jun 3, 2024
80f4c23
removes ext tests (revert once merged into main PR brach)
gpestana Jun 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 59 additions & 2 deletions polkadot/runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1685,8 +1685,7 @@ pub mod migrations {
}

/// Unreleased migrations. Add new ones here:
pub type Unreleased =
(pallet_staking::migrations::single_block::v15::MigrateV14ToV15<Runtime>,);
pub type Unreleased = ();
}

/// Unchecked extrinsic type as expected by this runtime.
Expand Down Expand Up @@ -2682,6 +2681,64 @@ mod remote_tests {
.unwrap();
ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::PreAndPost));
}

#[tokio::test]
Copy link
Contributor Author

@gpestana gpestana May 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: remove these tests before merging in the base branch.

async fn try_stake_tracker_migrate() {
use frame_support::migrations::SteppedMigration;
sp_tracing::try_init_simple();
let transport: Transport = var("WS")
.unwrap_or(
// "wss://kusama-rpc.polkadot.io:443"
"ws://127.0.0.1:9900".to_string(),
)
.into();

let maybe_state_snapshot: Option<SnapshotConfig> = var("SNAP").map(|s| s.into()).ok();

let mut ext = Builder::<Block>::default()
.mode(if let Some(state_snapshot) = maybe_state_snapshot {
Mode::OfflineOrElseOnline(
OfflineConfig { state_snapshot: state_snapshot.clone() },
OnlineConfig {
transport,
state_snapshot: Some(state_snapshot),
pallets: vec!["staking".into(), "stake-tracker".into()],
..Default::default()
},
)
} else {
Mode::Online(OnlineConfig { transport, ..Default::default() })
})
.build()
.await
.unwrap();

ext.execute_with(|| {
//let mut meter = WeightMeter::with_limit(Weight::from_parts(100_779_206_000,
// 10477090));
let mut meter = WeightMeter::new();
let mut cursor = None;
loop {
cursor = pallet_staking::migrations::v13_stake_tracker::MigrationV13::<
Runtime,
weights::pallet_staking::WeightInfo<Runtime>,
>::step(cursor, &mut meter)
.unwrap();

if cursor.is_none() {
// run the try-state at the end.
Staking::do_try_state(frame_system::Pallet::<Runtime>::block_number())
.map_err(|err| {
log::error!(" 🕵️‍♂️ try_state failure: {:?}", err);
err
})
.unwrap();

break;
}
}
});
}
}

mod clean_state_migration {
Expand Down
17 changes: 14 additions & 3 deletions polkadot/runtime/westend/src/weights/pallet_staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,12 +827,23 @@ impl<T: frame_system::Config> pallet_staking::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().writes(4))
}

// TODO: run CI bot benchmarks
fn drop_dangling_nomination() -> Weight {
Weight::default()
// Proof Size summary in bytes:
// Measured: `1973`
// Estimated: `8631`
// Minimum execution time: 101_638_000 picoseconds.
Weight::from_parts(103_488_000, 8631)
.saturating_add(T::DbWeight::get().reads(14_u64))
.saturating_add(T::DbWeight::get().writes(5_u64))
}

fn v13_mmb_step() -> Weight {
Weight::default()
// Proof Size summary in bytes:
// Measured: `70141`
// Estimated: `477090`
// Minimum execution time: 2_703_732_000 picoseconds.
Weight::from_parts(2_779_206_000, 477090)
.saturating_add(T::DbWeight::get().reads(231_u64))
.saturating_add(T::DbWeight::get().writes(183_u64))
}
}
4 changes: 2 additions & 2 deletions substrate/frame/staking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pallet-session = { path = "../session", default-features = false, features = [
"historical",
] }
pallet-authorship = { path = "../authorship", default-features = false }
pallet-stake-tracker = { path = "./stake-tracker", default-features = false }
sp-application-crypto = { path = "../../primitives/application-crypto", default-features = false, features = ["serde"] }
frame-election-provider-support = { path = "../election-provider-support", default-features = false }
log = { workspace = true }
Expand All @@ -45,9 +46,8 @@ sp-tracing = { path = "../../primitives/tracing" }
sp-core = { path = "../../primitives/core" }
sp-npos-elections = { path = "../../primitives/npos-elections" }
pallet-timestamp = { path = "../timestamp" }
pallet-stake-tracker = { path = "./stake-tracker" }
pallet-staking-reward-curve = { path = "reward-curve" }
pallet-bags-list = { path = "../bags-list" }
pallet-bags-list = { path = "../bags-list", default-features = false, features = ["try-runtime"] }
pallet-migrations = { path = "../migrations" }
substrate-test-utils = { path = "../../test-utils" }
frame-benchmarking = { path = "../benchmarking" }
Expand Down
32 changes: 4 additions & 28 deletions substrate/frame/staking/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ mod benchmarks {

assert_eq!(
Staking::<T>::status(&voter),
Ok(StakerStatus::Nominator(vec![dangling_target.clone(), other_target.clone()]))
Ok(StakerStatus::Nominator(vec![other_target.clone(), dangling_target.clone()]))
);

#[extrinsic_call]
Expand Down Expand Up @@ -1228,7 +1228,7 @@ mod tests {

#[test]
fn create_validators_with_nominators_for_era_works() {
ExtBuilder::default().build_and_execute(|| {
ExtBuilder::default().try_state(false).build_and_execute(|| {
let v = 10;
let n = 100;

Expand All @@ -1254,7 +1254,7 @@ mod tests {

#[test]
fn create_validator_with_nominators_works() {
ExtBuilder::default().build_and_execute(|| {
ExtBuilder::default().try_state(false).build_and_execute(|| {
let n = 10;

let (validator_stash, nominators) = create_validator_with_nominators::<Test>(
Expand Down Expand Up @@ -1285,7 +1285,7 @@ mod tests {

#[test]
fn add_slashing_spans_works() {
ExtBuilder::default().build_and_execute(|| {
ExtBuilder::default().try_state(false).build_and_execute(|| {
let n = 10;

let (validator_stash, _nominators) = create_validator_with_nominators::<Test>(
Expand Down Expand Up @@ -1315,28 +1315,4 @@ mod tests {
}
});
}

// TODO: SelectedBenchmark not exposed by v2?
/*
#[test]
fn test_payout_all() {
ExtBuilder::default().build_and_execute(|| {
let v = 10;
let n = 100;

let selected_benchmark = SelectedBenchmark::payout_all;
let c = vec![
(frame_benchmarking::BenchmarkParameter::v, v),
(frame_benchmarking::BenchmarkParameter::n, n),
];

assert_ok!(
<SelectedBenchmark as frame_benchmarking::BenchmarkingSetup<Test>>::unit_test_instance(
&selected_benchmark,
&c,
)
);
});
}
*/
}
Loading
Loading