Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

disputes pallet: Remove spam slots #6345

Merged
merged 45 commits into from
Jan 7, 2023
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
78134e4
disputes pallet: Filter disputes with votes less than supermajority t…
tdimitrov Nov 21, 2022
ef1823e
Remove `max_spam_slots` usages
tdimitrov Nov 24, 2022
ec7e53c
Remove `SpamSlots`
tdimitrov Nov 23, 2022
2a0a7ee
Remove `SpamSlotChange`
tdimitrov Nov 23, 2022
23fc0cf
Remove `Error<T>::PotentialSpam` and stale comments
tdimitrov Nov 23, 2022
ccfa0b1
`create_disputes_with_no_spam` -> `create_disputes`
tdimitrov Nov 23, 2022
bdd193f
Make tests compile - wip commit
tdimitrov Nov 24, 2022
5a1800a
Rework `test_dispute_timeout`. Rename `update_spam_slots` to `filter_…
tdimitrov Nov 24, 2022
5518563
Remove `dispute_statement_becoming_onesided_due_to_spamslots_is_accep…
tdimitrov Nov 24, 2022
82a62ee
Fix `test_provide_multi_dispute_success_and_other`
tdimitrov Nov 25, 2022
1d3eb05
Remove an old comment
tdimitrov Nov 25, 2022
a0e60de
Remove spam slots from tests - clean todo comments
tdimitrov Nov 25, 2022
e02089d
Remove test - `test_decrement_spam`
tdimitrov Nov 25, 2022
d1a468f
todo comments
tdimitrov Nov 25, 2022
7519851
Update TODO comments
tdimitrov Dec 1, 2022
d4df3d0
Extract `test_unconfirmed_are_ignored` as separate test case
tdimitrov Dec 1, 2022
397a060
Remove dead code
tdimitrov Dec 1, 2022
84cae48
Fix `test_unconfirmed_are_ignored`
tdimitrov Dec 1, 2022
306acd3
Remove dead code in `filter_dispute_data`
tdimitrov Dec 2, 2022
b6661ce
Fix weights (related to commit "Remove `SpamSlots`")
tdimitrov Dec 15, 2022
8c5f10a
Disputes migration - first try
tdimitrov Dec 15, 2022
80fda2e
Remove `dispute_max_spam_slots` + storage migration
tdimitrov Dec 16, 2022
28993af
Fix `HostConfig` migration tests
tdimitrov Dec 16, 2022
f04fc04
Deprecate `SpamSlots`
tdimitrov Dec 16, 2022
d4b8b5b
Code review feedback
tdimitrov Dec 19, 2022
ac7c5c8
Fix weights in disputes migration
tdimitrov Dec 20, 2022
1905b6f
Revert "Deprecate `SpamSlots`"
tdimitrov Dec 21, 2022
746a589
Make mod migration public
tdimitrov Dec 21, 2022
647d409
Remove `SpamSlots` from disputes pallet and use `storage_alias` in th…
tdimitrov Dec 21, 2022
68f956c
Fix call to `clear()` for `SpamSlots` in migration
tdimitrov Dec 21, 2022
df82049
Update migration and add a `try-runtime` test
tdimitrov Dec 24, 2022
535482f
Add `pre_upgrade` `try-runtime` test
tdimitrov Jan 2, 2023
49068a4
Fix some test names in `HostConfiguration` migration
tdimitrov Jan 2, 2023
09ed433
Link spamslots migration in all runtimes
tdimitrov Jan 2, 2023
c33d777
Add `test_unconfirmed_disputes_cause_block_import_error`
tdimitrov Jan 2, 2023
577d4b3
Update guide
tdimitrov Jan 2, 2023
50fdc93
Update runtime/parachains/src/configuration/migration.rs
tdimitrov Jan 4, 2023
0a567eb
Code review feedback - update logs
tdimitrov Jan 4, 2023
ab5933b
Code review feedback: fix weights
tdimitrov Jan 4, 2023
1989026
Update runtime/parachains/src/disputes.rs
tdimitrov Jan 4, 2023
06f53bb
Additional logs in disputes migration
tdimitrov Jan 4, 2023
0cd90da
Merge branch 'master' into tsv-runtime-spamslots
tdimitrov Jan 4, 2023
91075dd
Fix merge conflicts
tdimitrov Jan 4, 2023
8831582
Add version checks in try-runtime tests
tdimitrov Jan 5, 2023
b11ce8b
Fix a compilation warning`
tdimitrov Jan 5, 2023
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
2 changes: 2 additions & 0 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,8 @@ pub type Migrations = (
Runtime,
governance::FellowshipReferendaInstance,
>,
parachains_disputes::migration::v1::MigrateToV1<Runtime>,
parachains_configuration::migration::v4::MigrateToV4<Runtime>,
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down
4 changes: 2 additions & 2 deletions runtime/parachains/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ impl<T: paras_inherent::Config> BenchBuilder<T> {

/// Fill cores `start..last` with dispute statement sets. The statement sets will have 3/4th of
/// votes be valid, and 1/4th of votes be invalid.
fn create_disputes_with_no_spam(
fn create_disputes(
&self,
start: u32,
last: u32,
Expand Down Expand Up @@ -664,7 +664,7 @@ impl<T: paras_inherent::Config> BenchBuilder<T> {
let backed_candidates = builder
.create_backed_candidates(&builder.backed_and_concluding_cores, builder.code_upgrade);

let disputes = builder.create_disputes_with_no_spam(
let disputes = builder.create_disputes(
builder.backed_and_concluding_cores.len() as u32,
used_cores,
builder.dispute_sessions.as_slice(),
Expand Down
16 changes: 0 additions & 16 deletions runtime/parachains/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,6 @@ pub struct HostConfiguration<BlockNumber> {
pub dispute_period: SessionIndex,
/// How long after dispute conclusion to accept statements.
pub dispute_post_conclusion_acceptance_period: BlockNumber,
/// The maximum number of dispute spam slots
pub dispute_max_spam_slots: u32,
tdimitrov marked this conversation as resolved.
Show resolved Hide resolved
/// How long it takes for a dispute to conclude by time-out, if no supermajority is reached.
pub dispute_conclusion_by_time_out_period: BlockNumber,
/// The amount of consensus slots that must pass between submitting an assignment and
Expand Down Expand Up @@ -263,7 +261,6 @@ impl<BlockNumber: Default + From<u32>> Default for HostConfiguration<BlockNumber
max_validators: None,
dispute_period: 6,
dispute_post_conclusion_acceptance_period: 100.into(),
dispute_max_spam_slots: 2,
dispute_conclusion_by_time_out_period: 200.into(),
n_delay_tranches: Default::default(),
zeroth_delay_tranche_width: Default::default(),
Expand Down Expand Up @@ -752,19 +749,6 @@ pub mod pallet {
})
}

/// Set the maximum number of dispute spam slots.
tdimitrov marked this conversation as resolved.
Show resolved Hide resolved
#[pallet::call_index(16)]
#[pallet::weight((
T::WeightInfo::set_config_with_u32(),
DispatchClass::Operational,
))]
pub fn set_dispute_max_spam_slots(origin: OriginFor<T>, new: u32) -> DispatchResult {
ensure_root(origin)?;
Self::schedule_config_update(|config| {
config.dispute_max_spam_slots = new;
})
}

/// Set the dispute conclusion by time out period.
#[pallet::call_index(17)]
#[pallet::weight((
Expand Down
182 changes: 94 additions & 88 deletions runtime/parachains/src/configuration/migration.rs

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions runtime/parachains/src/configuration/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ fn setting_pending_config_members() {
max_validators: None,
dispute_period: 239,
dispute_post_conclusion_acceptance_period: 10,
dispute_max_spam_slots: 2,
dispute_conclusion_by_time_out_period: 512,
no_show_slots: 240,
n_delay_tranches: 241,
Expand Down Expand Up @@ -402,11 +401,6 @@ fn setting_pending_config_members() {
new_config.dispute_post_conclusion_acceptance_period,
)
.unwrap();
Configuration::set_dispute_max_spam_slots(
tdimitrov marked this conversation as resolved.
Show resolved Hide resolved
RuntimeOrigin::root(),
new_config.dispute_max_spam_slots,
)
.unwrap();
Configuration::set_dispute_conclusion_by_time_out_period(
RuntimeOrigin::root(),
new_config.dispute_conclusion_by_time_out_period,
Expand Down
Loading