Prepare for rust 1.62.1 (#11903)

* Update UI test output for rust 1.62.1

* switch ci to staging image to check that everything works

* fix artifacts node-bench-regression-guard

* Imeplement `scale_info::TypeInfo` manually to silence aggressive rust warning

* Fix more clippy lints

* Make clippy happy by relying on auto-deref were possible

* Add tracking issue to the comments

* pin ci image

Co-authored-by: alvicsam <alvicsam@gmail.com>
This commit is contained in:
Sebastian Kunert
2022-07-26 14:37:05 +02:00
committed by GitHub
parent 151c5d3fd9
commit 9f409dc0b8
45 changed files with 365 additions and 84 deletions
+7 -7
View File
@@ -467,7 +467,7 @@ fn finalize_block_and_wait_for_beefy(
finalize_targets: &[u64],
expected_beefy: &[u64],
) {
let (best_blocks, signed_commitments) = get_beefy_streams(&mut *net.lock(), peers);
let (best_blocks, signed_commitments) = get_beefy_streams(&mut net.lock(), peers);
for block in finalize_targets {
let finalize = BlockId::number(*block);
@@ -555,7 +555,7 @@ fn lagging_validators() {
// Alice finalizes #25, Bob lags behind
let finalize = BlockId::number(25);
let (best_blocks, signed_commitments) = get_beefy_streams(&mut *net.lock(), peers);
let (best_blocks, signed_commitments) = get_beefy_streams(&mut net.lock(), peers);
net.lock().peer(0).client().as_client().finalize_block(finalize, None).unwrap();
// verify nothing gets finalized by BEEFY
let timeout = Some(Duration::from_millis(250));
@@ -563,7 +563,7 @@ fn lagging_validators() {
streams_empty_after_timeout(signed_commitments, &net, &mut runtime, None);
// Bob catches up and also finalizes #25
let (best_blocks, signed_commitments) = get_beefy_streams(&mut *net.lock(), peers);
let (best_blocks, signed_commitments) = get_beefy_streams(&mut net.lock(), peers);
net.lock().peer(1).client().as_client().finalize_block(finalize, None).unwrap();
// expected beefy finalizes block #17 from diff-power-of-two
wait_for_best_beefy_blocks(best_blocks, &net, &mut runtime, &[23, 24, 25]);
@@ -577,7 +577,7 @@ fn lagging_validators() {
// validator set).
// Alice finalizes session-boundary mandatory block #60, Bob lags behind
let (best_blocks, signed_commitments) = get_beefy_streams(&mut *net.lock(), peers);
let (best_blocks, signed_commitments) = get_beefy_streams(&mut net.lock(), peers);
let finalize = BlockId::number(60);
net.lock().peer(0).client().as_client().finalize_block(finalize, None).unwrap();
// verify nothing gets finalized by BEEFY
@@ -586,7 +586,7 @@ fn lagging_validators() {
streams_empty_after_timeout(signed_commitments, &net, &mut runtime, None);
// Bob catches up and also finalizes #60 (and should have buffered Alice's vote on #60)
let (best_blocks, signed_commitments) = get_beefy_streams(&mut *net.lock(), peers);
let (best_blocks, signed_commitments) = get_beefy_streams(&mut net.lock(), peers);
net.lock().peer(1).client().as_client().finalize_block(finalize, None).unwrap();
// verify beefy skips intermediary votes, and successfully finalizes mandatory block #40
wait_for_best_beefy_blocks(best_blocks, &net, &mut runtime, &[60]);
@@ -629,7 +629,7 @@ fn correct_beefy_payload() {
finalize_block_and_wait_for_beefy(&net, peers, &mut runtime, &[10], &[1, 9]);
let (best_blocks, signed_commitments) =
get_beefy_streams(&mut *net.lock(), &[BeefyKeyring::Alice]);
get_beefy_streams(&mut net.lock(), &[BeefyKeyring::Alice]);
// now 2 good validators and 1 bad one are voting
net.lock()
@@ -658,7 +658,7 @@ fn correct_beefy_payload() {
// 3rd good validator catches up and votes as well
let (best_blocks, signed_commitments) =
get_beefy_streams(&mut *net.lock(), &[BeefyKeyring::Alice]);
get_beefy_streams(&mut net.lock(), &[BeefyKeyring::Alice]);
net.lock()
.peer(2)
.client()
+2 -2
View File
@@ -439,7 +439,7 @@ where
let commitment = Commitment { payload, block_number: target_number, validator_set_id };
let encoded_commitment = commitment.encode();
let signature = match self.key_store.sign(&authority_id, &*encoded_commitment) {
let signature = match self.key_store.sign(&authority_id, &encoded_commitment) {
Ok(sig) => sig,
Err(err) => {
warn!(target: "beefy", "🥩 Error signing commitment: {:?}", err);
@@ -451,7 +451,7 @@ where
target: "beefy",
"🥩 Produced signature using {:?}, is_valid: {:?}",
authority_id,
BeefyKeystore::verify(&authority_id, &signature, &*encoded_commitment)
BeefyKeystore::verify(&authority_id, &signature, &encoded_commitment)
);
let message = VoteMessage { commitment, id: authority_id, signature };
+1 -1
View File
@@ -556,7 +556,7 @@ impl std::error::Error for TelemetryParsingError {}
impl std::fmt::Display for TelemetryParsingError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &*self {
match self {
TelemetryParsingError::MissingVerbosity => write!(f, "Verbosity level missing"),
TelemetryParsingError::VerbosityParsingError(e) => write!(f, "{}", e),
}
@@ -433,10 +433,10 @@ impl<B: BlockT> JustificationSyncLink<B> for () {
impl<B: BlockT, L: JustificationSyncLink<B>> JustificationSyncLink<B> for Arc<L> {
fn request_justification(&self, hash: &B::Hash, number: NumberFor<B>) {
L::request_justification(&*self, hash, number);
L::request_justification(self, hash, number);
}
fn clear_justification_requests(&self) {
L::clear_justification_requests(&*self);
L::clear_justification_requests(self);
}
}
+1 -1
View File
@@ -2292,7 +2292,7 @@ impl<Block: BlockT> sc_client_api::backend::Backend<Block> for Backend<Block> {
}
fn get_import_lock(&self) -> &RwLock<()> {
&*self.import_lock
&self.import_lock
}
fn requires_full_sync(&self) -> bool {
@@ -320,7 +320,7 @@ impl<B: BlockT, N: Network<B>> NetworkBridge<B, N> {
voters: Arc<VoterSet<AuthorityId>>,
has_voted: HasVoted<B>,
) -> (impl Stream<Item = SignedMessage<B>> + Unpin, OutgoingMessages<B>) {
self.note_round(round, set_id, &*voters);
self.note_round(round, set_id, &voters);
let keystore = keystore.and_then(|ks| {
let id = ks.local_id();
@@ -637,9 +637,9 @@ fn incoming_global<B: BlockT>(
.filter_map(move |(notification, msg)| {
future::ready(match msg {
GossipMessage::Commit(msg) =>
process_commit(msg, notification, &gossip_engine, &gossip_validator, &*voters),
process_commit(msg, notification, &gossip_engine, &gossip_validator, &voters),
GossipMessage::CatchUp(msg) =>
process_catch_up(msg, notification, &gossip_engine, &gossip_validator, &*voters),
process_catch_up(msg, notification, &gossip_engine, &gossip_validator, &voters),
_ => {
debug!(target: "afg", "Skipping unknown message type");
None
@@ -284,7 +284,7 @@ where
impl<'a, H, N> InnerGuard<'a, H, N> {
fn as_mut(&mut self) -> &mut AuthoritySet<H, N> {
&mut **self.guard.as_mut().expect("only taken on deconstruction; qed")
self.guard.as_mut().expect("only taken on deconstruction; qed")
}
fn set_old(&mut self, old: AuthoritySet<H, N>) {
@@ -289,7 +289,7 @@ where
network.note_round(
crate::communication::Round(round),
crate::communication::SetId(set_id),
&*voters,
&voters,
)
}
};
+2 -2
View File
@@ -57,7 +57,7 @@ impl<T: OffchainStorage + 'static> OffchainApiServer for Offchain<T> {
StorageKind::PERSISTENT => sp_offchain::STORAGE_PREFIX,
StorageKind::LOCAL => return Err(JsonRpseeError::from(Error::UnavailableStorageKind)),
};
self.storage.write().set(prefix, &*key, &*value);
self.storage.write().set(prefix, &key, &value);
Ok(())
}
@@ -69,6 +69,6 @@ impl<T: OffchainStorage + 'static> OffchainApiServer for Offchain<T> {
StorageKind::LOCAL => return Err(JsonRpseeError::from(Error::UnavailableStorageKind)),
};
Ok(self.storage.read().get(prefix, &*key).map(Into::into))
Ok(self.storage.read().get(prefix, &key).map(Into::into))
}
}
+1 -1
View File
@@ -199,7 +199,7 @@ where
.call(
&BlockId::Hash(block),
&method,
&*call_data,
&call_data,
self.client.execution_extensions().strategies().other,
None,
)
@@ -1614,11 +1614,11 @@ where
RA: Send + Sync,
{
fn header(&self, id: BlockId<Block>) -> sp_blockchain::Result<Option<Block::Header>> {
(**self).backend.blockchain().header(id)
self.backend.blockchain().header(id)
}
fn info(&self) -> blockchain::Info<Block> {
(**self).backend.blockchain().info()
self.backend.blockchain().info()
}
fn status(&self, id: BlockId<Block>) -> sp_blockchain::Result<blockchain::BlockStatus> {
@@ -89,7 +89,7 @@ fn flush_logs(mut buffer: parking_lot::lock_api::MutexGuard<parking_lot::RawMute
let stderr = std::io::stderr();
let mut stderr_lock = stderr.lock();
let _ = stderr_lock.write_all(&*spare_buffer);
let _ = stderr_lock.write_all(&spare_buffer);
std::mem::drop(stderr_lock);
spare_buffer.clear();
@@ -254,7 +254,7 @@ fn should_resubmit_from_retracted_during_maintenance() {
let header = api.push_block(1, vec![], true);
let fork_header = api.push_block(1, vec![], false);
let event = block_event_with_retracted(header, fork_header.hash(), &*pool.api());
let event = block_event_with_retracted(header, fork_header.hash(), pool.api());
block_on(pool.maintain(event));
assert_eq!(pool.status().ready, 1);
@@ -272,7 +272,7 @@ fn should_not_resubmit_from_retracted_during_maintenance_if_tx_is_also_in_enacte
let header = api.push_block(1, vec![xt.clone()], true);
let fork_header = api.push_block(1, vec![xt], false);
let event = block_event_with_retracted(header, fork_header.hash(), &*pool.api());
let event = block_event_with_retracted(header, fork_header.hash(), pool.api());
block_on(pool.maintain(event));
assert_eq!(pool.status().ready, 0);
@@ -292,7 +292,7 @@ fn should_not_retain_invalid_hashes_from_retracted() {
let fork_header = api.push_block(1, vec![xt.clone()], false);
api.add_invalid(&xt);
let event = block_event_with_retracted(header, fork_header.hash(), &*pool.api());
let event = block_event_with_retracted(header, fork_header.hash(), pool.api());
block_on(pool.maintain(event));
assert_eq!(
@@ -533,7 +533,7 @@ fn fork_aware_finalization() {
let header = pool.api().push_block(3, vec![from_charlie.clone()], true);
canon_watchers.push((watcher, header.hash()));
let event = block_event_with_retracted(header.clone(), d2, &*pool.api());
let event = block_event_with_retracted(header.clone(), d2, pool.api());
block_on(pool.maintain(event));
assert_eq!(pool.status().ready, 2);
@@ -633,7 +633,7 @@ fn prune_and_retract_tx_at_same_time() {
let header = pool.api().push_block(2, vec![from_alice.clone()], false);
assert_eq!(pool.status().ready, 0);
let event = block_event_with_retracted(header.clone(), b1, &*pool.api());
let event = block_event_with_retracted(header.clone(), b1, pool.api());
block_on(pool.maintain(event));
assert_eq!(pool.status().ready, 0);
@@ -708,7 +708,7 @@ fn resubmit_tx_of_fork_that_is_not_part_of_retracted() {
// Block D2
{
let header = pool.api().push_block(2, vec![], false);
let event = block_event_with_retracted(header, d0, &*pool.api());
let event = block_event_with_retracted(header, d0, pool.api());
block_on(pool.maintain(event));
assert_eq!(pool.status().ready, 2);
}
@@ -801,7 +801,7 @@ fn resubmit_from_retracted_fork() {
let expected_ready = vec![tx3, tx4, tx5].iter().map(Encode::encode).collect::<BTreeSet<_>>();
assert_eq!(expected_ready, ready);
let event = block_event_with_retracted(f1_header, f0, &*pool.api());
let event = block_event_with_retracted(f1_header, f0, pool.api());
block_on(pool.maintain(event));
assert_eq!(pool.status().ready, 3);