Skip to content

Commit 59928bf

Browse files
authored
Revert "No disputes and no CandidateReceiptV2 on Kusama (#8483)"
This reverts commit 98a3813.
1 parent f3226bb commit 59928bf

File tree

16 files changed

+4523
-42
lines changed

16 files changed

+4523
-42
lines changed

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

polkadot/cli/src/command.rs

-5
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,6 @@ where
190190

191191
set_default_ss58_version(chain_spec);
192192

193-
if chain_spec.is_polkadot() {
194-
info!("This binary is meant to be used on Kusama only!");
195-
return Err(Error::Other("This binary is meant to be used on Kusama only!".into()))
196-
}
197-
198193
if chain_spec.is_kusama() {
199194
info!("----------------------------");
200195
info!("This chain is not in any way");

polkadot/node/collation-generation/src/lib.rs

+17-3
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ use polkadot_node_subsystem::{
4444
SubsystemContext, SubsystemError, SubsystemResult, SubsystemSender,
4545
};
4646
use polkadot_node_subsystem_util::{
47-
request_claim_queue, request_persisted_validation_data, request_session_index_for_child,
48-
request_validation_code_hash, request_validators, runtime::ClaimQueueSnapshot,
47+
request_claim_queue, request_node_features, request_persisted_validation_data,
48+
request_session_index_for_child, request_validation_code_hash, request_validators,
49+
runtime::ClaimQueueSnapshot,
4950
};
5051
use polkadot_primitives::{
5152
collator_signature_payload,
53+
node_features::FeatureIndex,
5254
vstaging::{
5355
transpose_claim_queue, CandidateDescriptorV2, CandidateReceiptV2 as CandidateReceipt,
5456
ClaimQueueOffset, CommittedCandidateReceiptV2, TransposedClaimQueue,
@@ -62,6 +64,9 @@ use std::{collections::HashSet, sync::Arc};
6264

6365
mod error;
6466

67+
#[cfg(test)]
68+
mod tests;
69+
6570
mod metrics;
6671
use self::metrics::Metrics;
6772

@@ -504,7 +509,16 @@ impl SessionInfoCache {
504509
let n_validators =
505510
request_validators(relay_parent, &mut sender.clone()).await.await??.len();
506511

507-
let info = PerSessionInfo { v2_receipts: false, n_validators };
512+
let node_features =
513+
request_node_features(relay_parent, session_index, sender).await.await??;
514+
515+
let info = PerSessionInfo {
516+
v2_receipts: node_features
517+
.get(FeatureIndex::CandidateReceiptV2 as usize)
518+
.map(|b| *b)
519+
.unwrap_or(false),
520+
n_validators,
521+
};
508522
self.0.insert(session_index, info);
509523
Ok(self.0.get(&session_index).expect("Just inserted").clone())
510524
}

polkadot/node/core/dispute-coordinator/src/initialized.rs

-17
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ pub(crate) struct Initialized {
120120
chain_import_backlog: VecDeque<ScrapedOnChainVotes>,
121121
metrics: Metrics,
122122
approval_voting_parallel_enabled: bool,
123-
emergency_no_disputes_mode: bool,
124123
}
125124

126125
#[overseer::contextbounds(DisputeCoordinator, prefix = self::overseer)]
@@ -159,7 +158,6 @@ impl Initialized {
159158
chain_import_backlog: VecDeque::new(),
160159
metrics,
161160
approval_voting_parallel_enabled,
162-
emergency_no_disputes_mode: true,
163161
}
164162
}
165163

@@ -283,11 +281,6 @@ impl Initialized {
283281
},
284282
FromOrchestra::Signal(OverseerSignal::BlockFinalized(_, n)) => {
285283
gum::trace!(target: LOG_TARGET, "OverseerSignal::BlockFinalized");
286-
287-
if n >= 28_486_744 {
288-
self.emergency_no_disputes_mode = false;
289-
}
290-
291284
self.scraper.process_finalized_block(&n);
292285
default_confirm
293286
},
@@ -956,11 +949,6 @@ impl Initialized {
956949
statements: Vec<(SignedDisputeStatement, ValidatorIndex)>,
957950
now: Timestamp,
958951
) -> FatalResult<ImportStatementsResult> {
959-
if self.emergency_no_disputes_mode {
960-
gum::debug!(target: LOG_TARGET, "Dispute import skipped due to emergency mode");
961-
return Ok(ImportStatementsResult::ValidImport)
962-
}
963-
964952
gum::trace!(target: LOG_TARGET, ?statements, "In handle import statements");
965953
if self.session_is_ancient(session) {
966954
// It is not valid to participate in an ancient dispute (spam?) or too new.
@@ -1449,11 +1437,6 @@ impl Initialized {
14491437
valid: bool,
14501438
now: Timestamp,
14511439
) -> Result<()> {
1452-
if self.emergency_no_disputes_mode {
1453-
gum::debug!(target: LOG_TARGET, "issue_local_statement skipped due to emergency mode");
1454-
return Ok(());
1455-
}
1456-
14571440
gum::trace!(
14581441
target: LOG_TARGET,
14591442
?candidate_hash,

polkadot/node/core/dispute-coordinator/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ mod status;
111111

112112
use crate::status::Clock;
113113

114+
#[cfg(test)]
115+
mod tests;
116+
114117
pub(crate) const LOG_TARGET: &str = "parachain::dispute-coordinator";
115118

116119
/// An implementation of the dispute coordinator subsystem.

polkadot/node/core/dispute-coordinator/src/participation/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
1616

17-
#![allow(warnings)]
18-
1917
use std::collections::HashSet;
2018
#[cfg(test)]
2119
use std::time::Duration;

0 commit comments

Comments
 (0)