style: Migrate to stable-only rustfmt configuration
- Remove nightly-only features from .rustfmt.toml and vendor/ss58-registry/rustfmt.toml - Removed features: imports_granularity, wrap_comments, comment_width, reorder_impl_items, spaces_around_ranges, binop_separator, match_arm_blocks, trailing_semicolon, trailing_comma - Format all 898 affected files with stable rustfmt - Ensures long-term reliability without nightly toolchain dependency
This commit is contained in:
@@ -332,8 +332,8 @@ fn concluded_onchain(onchain_state: &DisputeState) -> bool {
|
||||
// Check if there are enough onchain votes for or against to conclude the dispute
|
||||
let supermajority = supermajority_threshold(onchain_state.validators_for.len());
|
||||
|
||||
onchain_state.validators_for.count_ones() >= supermajority ||
|
||||
onchain_state.validators_against.count_ones() >= supermajority
|
||||
onchain_state.validators_for.count_ones() >= supermajority
|
||||
|| onchain_state.validators_against.count_ones() >= supermajority
|
||||
}
|
||||
|
||||
fn partition_recent_disputes(
|
||||
@@ -347,7 +347,7 @@ fn partition_recent_disputes(
|
||||
let key = (session_index, candidate_hash);
|
||||
if dispute_is_inactive(&dispute_state, time_now) {
|
||||
match onchain.get(&key) {
|
||||
Some(onchain_state) =>
|
||||
Some(onchain_state) => {
|
||||
if concluded_onchain(onchain_state) {
|
||||
partitioned
|
||||
.inactive_concluded_onchain
|
||||
@@ -356,16 +356,19 @@ fn partition_recent_disputes(
|
||||
partitioned
|
||||
.inactive_unconcluded_onchain
|
||||
.push((session_index, candidate_hash));
|
||||
},
|
||||
}
|
||||
},
|
||||
None => partitioned.inactive_unknown_onchain.push((session_index, candidate_hash)),
|
||||
}
|
||||
} else {
|
||||
match onchain.get(&(session_index, candidate_hash)) {
|
||||
Some(d) => match concluded_onchain(d) {
|
||||
true =>
|
||||
partitioned.active_concluded_onchain.push((session_index, candidate_hash)),
|
||||
false =>
|
||||
partitioned.active_unconcluded_onchain.push((session_index, candidate_hash)),
|
||||
true => {
|
||||
partitioned.active_concluded_onchain.push((session_index, candidate_hash))
|
||||
},
|
||||
false => {
|
||||
partitioned.active_unconcluded_onchain.push((session_index, candidate_hash))
|
||||
},
|
||||
},
|
||||
None => partitioned.active_unknown_onchain.push((session_index, candidate_hash)),
|
||||
}
|
||||
@@ -389,8 +392,8 @@ fn is_vote_worth_to_keep(
|
||||
// punished when misbehaving.
|
||||
if let Some(kind) = valid_kind {
|
||||
match kind {
|
||||
ValidDisputeStatementKind::BackingValid(_) |
|
||||
ValidDisputeStatementKind::BackingSeconded(_) => return true,
|
||||
ValidDisputeStatementKind::BackingValid(_)
|
||||
| ValidDisputeStatementKind::BackingSeconded(_) => return true,
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
@@ -491,10 +494,12 @@ where
|
||||
.map_err(|_| GetOnchainDisputesError::Channel)
|
||||
.and_then(|res| {
|
||||
res.map_err(|e| match e {
|
||||
RuntimeApiError::Execution { .. } =>
|
||||
GetOnchainDisputesError::Execution(e, relay_parent),
|
||||
RuntimeApiError::NotSupported { .. } =>
|
||||
GetOnchainDisputesError::NotSupported(e, relay_parent),
|
||||
RuntimeApiError::Execution { .. } => {
|
||||
GetOnchainDisputesError::Execution(e, relay_parent)
|
||||
},
|
||||
RuntimeApiError::NotSupported { .. } => {
|
||||
GetOnchainDisputesError::NotSupported(e, relay_parent)
|
||||
},
|
||||
})
|
||||
})
|
||||
.map(|v| v.into_iter().map(|e| ((e.0, e.1), e.2)).collect())
|
||||
|
||||
@@ -666,8 +666,8 @@ fn many_batches() {
|
||||
let vote_count = result.iter().map(|d| d.statements.len()).fold(0, |acc, v| acc + v);
|
||||
|
||||
assert!(
|
||||
MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME - VALIDATOR_COUNT <= vote_count &&
|
||||
vote_count <= MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME,
|
||||
MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME - VALIDATOR_COUNT <= vote_count
|
||||
&& vote_count <= MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME,
|
||||
"vote_count: {}",
|
||||
vote_count
|
||||
);
|
||||
@@ -720,8 +720,8 @@ fn votes_above_limit() {
|
||||
let vote_count = result.iter().map(|d| d.statements.len()).fold(0, |acc, v| acc + v);
|
||||
|
||||
assert!(
|
||||
MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME - VALIDATOR_COUNT <= vote_count &&
|
||||
vote_count <= MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME,
|
||||
MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME - VALIDATOR_COUNT <= vote_count
|
||||
&& vote_count <= MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME,
|
||||
"vote_count: {}",
|
||||
vote_count
|
||||
);
|
||||
|
||||
@@ -396,8 +396,9 @@ fn note_provisionable_data(
|
||||
provisionable_data: ProvisionableData,
|
||||
) {
|
||||
match provisionable_data {
|
||||
ProvisionableData::Bitfield(_, signed_bitfield) =>
|
||||
per_relay_parent.signed_bitfields.push(signed_bitfield),
|
||||
ProvisionableData::Bitfield(_, signed_bitfield) => {
|
||||
per_relay_parent.signed_bitfields.push(signed_bitfield)
|
||||
},
|
||||
// We choose not to punish these forms of misbehavior for the time being.
|
||||
// Risks from misbehavior are sufficiently mitigated at the protocol level
|
||||
// via reputation changes. Punitive actions here may become desirable
|
||||
|
||||
@@ -572,8 +572,9 @@ mod select_candidates {
|
||||
_parent_hash,
|
||||
PersistedValidationDataReq(_para_id, _assumption, tx),
|
||||
)) => tx.send(Ok(Some(Default::default()))).unwrap(),
|
||||
AllMessages::RuntimeApi(Request(_parent_hash, AvailabilityCores(tx))) =>
|
||||
tx.send(Ok(mock_availability_cores.clone())).unwrap(),
|
||||
AllMessages::RuntimeApi(Request(_parent_hash, AvailabilityCores(tx))) => {
|
||||
tx.send(Ok(mock_availability_cores.clone())).unwrap()
|
||||
},
|
||||
AllMessages::CandidateBacking(CandidateBackingMessage::GetBackableCandidates(
|
||||
hashes,
|
||||
sender,
|
||||
|
||||
Reference in New Issue
Block a user