Skip to content

Commit 9428b0e

Browse files
skunertalvicsam
andauthored
Prepare for rust 1.62.1 (paritytech#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>
1 parent 531d7c3 commit 9428b0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+365
-84
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ variables: &default-vars
4747
CARGO_INCREMENTAL: 0
4848
DOCKER_OS: "debian:stretch"
4949
ARCH: "x86_64"
50-
CI_IMAGE: "paritytech/ci-linux:production"
50+
# change to production when this image is published
51+
CI_IMAGE: "paritytech/ci-linux:staging@sha256:2c90b67f1452ed2d7236c2cd13f6224053a833d521b3630650b679f00874e0a9"
5152
RUSTY_CACHIER_SINGLE_BRANCH: master
5253
RUSTY_CACHIER_DONT_OPERATE_ON_MAIN_BRANCH: "true"
5354

bin/node/bench/src/simple_trie.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub struct SimpleTrie<'a> {
3333

3434
impl<'a> AsHashDB<Hasher, DBValue> for SimpleTrie<'a> {
3535
fn as_hash_db(&self) -> &dyn hash_db::HashDB<Hasher, DBValue> {
36-
&*self
36+
self
3737
}
3838

3939
fn as_hash_db_mut<'b>(&'b mut self) -> &'b mut (dyn HashDB<Hasher, DBValue> + 'b) {

bin/node/cli/benches/transaction_pool.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,25 +243,25 @@ fn transaction_pool_benchmarks(c: &mut Criterion) {
243243
move |b| {
244244
b.iter_batched(
245245
|| {
246-
let prepare_extrinsics = create_account_extrinsics(&*node.client, &accounts);
246+
let prepare_extrinsics = create_account_extrinsics(&node.client, &accounts);
247247

248248
runtime.block_on(future::join_all(prepare_extrinsics.into_iter().map(|tx| {
249249
submit_tx_and_wait_for_inclusion(
250250
&node.transaction_pool,
251251
tx,
252-
&*node.client,
252+
&node.client,
253253
true,
254254
)
255255
})));
256256

257-
create_benchmark_extrinsics(&*node.client, &accounts, extrinsics_per_account)
257+
create_benchmark_extrinsics(&node.client, &accounts, extrinsics_per_account)
258258
},
259259
|extrinsics| {
260260
runtime.block_on(future::join_all(extrinsics.into_iter().map(|tx| {
261261
submit_tx_and_wait_for_inclusion(
262262
&node.transaction_pool,
263263
tx,
264-
&*node.client,
264+
&node.client,
265265
false,
266266
)
267267
})));

client/beefy/src/tests.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ fn finalize_block_and_wait_for_beefy(
467467
finalize_targets: &[u64],
468468
expected_beefy: &[u64],
469469
) {
470-
let (best_blocks, signed_commitments) = get_beefy_streams(&mut *net.lock(), peers);
470+
let (best_blocks, signed_commitments) = get_beefy_streams(&mut net.lock(), peers);
471471

472472
for block in finalize_targets {
473473
let finalize = BlockId::number(*block);
@@ -555,15 +555,15 @@ fn lagging_validators() {
555555

556556
// Alice finalizes #25, Bob lags behind
557557
let finalize = BlockId::number(25);
558-
let (best_blocks, signed_commitments) = get_beefy_streams(&mut *net.lock(), peers);
558+
let (best_blocks, signed_commitments) = get_beefy_streams(&mut net.lock(), peers);
559559
net.lock().peer(0).client().as_client().finalize_block(finalize, None).unwrap();
560560
// verify nothing gets finalized by BEEFY
561561
let timeout = Some(Duration::from_millis(250));
562562
streams_empty_after_timeout(best_blocks, &net, &mut runtime, timeout);
563563
streams_empty_after_timeout(signed_commitments, &net, &mut runtime, None);
564564

565565
// Bob catches up and also finalizes #25
566-
let (best_blocks, signed_commitments) = get_beefy_streams(&mut *net.lock(), peers);
566+
let (best_blocks, signed_commitments) = get_beefy_streams(&mut net.lock(), peers);
567567
net.lock().peer(1).client().as_client().finalize_block(finalize, None).unwrap();
568568
// expected beefy finalizes block #17 from diff-power-of-two
569569
wait_for_best_beefy_blocks(best_blocks, &net, &mut runtime, &[23, 24, 25]);
@@ -577,7 +577,7 @@ fn lagging_validators() {
577577
// validator set).
578578

579579
// Alice finalizes session-boundary mandatory block #60, Bob lags behind
580-
let (best_blocks, signed_commitments) = get_beefy_streams(&mut *net.lock(), peers);
580+
let (best_blocks, signed_commitments) = get_beefy_streams(&mut net.lock(), peers);
581581
let finalize = BlockId::number(60);
582582
net.lock().peer(0).client().as_client().finalize_block(finalize, None).unwrap();
583583
// verify nothing gets finalized by BEEFY
@@ -586,7 +586,7 @@ fn lagging_validators() {
586586
streams_empty_after_timeout(signed_commitments, &net, &mut runtime, None);
587587

588588
// Bob catches up and also finalizes #60 (and should have buffered Alice's vote on #60)
589-
let (best_blocks, signed_commitments) = get_beefy_streams(&mut *net.lock(), peers);
589+
let (best_blocks, signed_commitments) = get_beefy_streams(&mut net.lock(), peers);
590590
net.lock().peer(1).client().as_client().finalize_block(finalize, None).unwrap();
591591
// verify beefy skips intermediary votes, and successfully finalizes mandatory block #40
592592
wait_for_best_beefy_blocks(best_blocks, &net, &mut runtime, &[60]);
@@ -629,7 +629,7 @@ fn correct_beefy_payload() {
629629
finalize_block_and_wait_for_beefy(&net, peers, &mut runtime, &[10], &[1, 9]);
630630

631631
let (best_blocks, signed_commitments) =
632-
get_beefy_streams(&mut *net.lock(), &[BeefyKeyring::Alice]);
632+
get_beefy_streams(&mut net.lock(), &[BeefyKeyring::Alice]);
633633

634634
// now 2 good validators and 1 bad one are voting
635635
net.lock()
@@ -658,7 +658,7 @@ fn correct_beefy_payload() {
658658

659659
// 3rd good validator catches up and votes as well
660660
let (best_blocks, signed_commitments) =
661-
get_beefy_streams(&mut *net.lock(), &[BeefyKeyring::Alice]);
661+
get_beefy_streams(&mut net.lock(), &[BeefyKeyring::Alice]);
662662
net.lock()
663663
.peer(2)
664664
.client()

client/beefy/src/worker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ where
439439
let commitment = Commitment { payload, block_number: target_number, validator_set_id };
440440
let encoded_commitment = commitment.encode();
441441

442-
let signature = match self.key_store.sign(&authority_id, &*encoded_commitment) {
442+
let signature = match self.key_store.sign(&authority_id, &encoded_commitment) {
443443
Ok(sig) => sig,
444444
Err(err) => {
445445
warn!(target: "beefy", "🥩 Error signing commitment: {:?}", err);
@@ -451,7 +451,7 @@ where
451451
target: "beefy",
452452
"🥩 Produced signature using {:?}, is_valid: {:?}",
453453
authority_id,
454-
BeefyKeystore::verify(&authority_id, &signature, &*encoded_commitment)
454+
BeefyKeystore::verify(&authority_id, &signature, &encoded_commitment)
455455
);
456456

457457
let message = VoteMessage { commitment, id: authority_id, signature };

client/cli/src/commands/run_cmd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ impl std::error::Error for TelemetryParsingError {}
556556

557557
impl std::fmt::Display for TelemetryParsingError {
558558
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
559-
match &*self {
559+
match self {
560560
TelemetryParsingError::MissingVerbosity => write!(f, "Verbosity level missing"),
561561
TelemetryParsingError::VerbosityParsingError(e) => write!(f, "{}", e),
562562
}

client/consensus/common/src/block_import.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,10 @@ impl<B: BlockT> JustificationSyncLink<B> for () {
433433

434434
impl<B: BlockT, L: JustificationSyncLink<B>> JustificationSyncLink<B> for Arc<L> {
435435
fn request_justification(&self, hash: &B::Hash, number: NumberFor<B>) {
436-
L::request_justification(&*self, hash, number);
436+
L::request_justification(self, hash, number);
437437
}
438438

439439
fn clear_justification_requests(&self) {
440-
L::clear_justification_requests(&*self);
440+
L::clear_justification_requests(self);
441441
}
442442
}

client/db/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2292,7 +2292,7 @@ impl<Block: BlockT> sc_client_api::backend::Backend<Block> for Backend<Block> {
22922292
}
22932293

22942294
fn get_import_lock(&self) -> &RwLock<()> {
2295-
&*self.import_lock
2295+
&self.import_lock
22962296
}
22972297

22982298
fn requires_full_sync(&self) -> bool {

client/finality-grandpa/src/communication/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl<B: BlockT, N: Network<B>> NetworkBridge<B, N> {
320320
voters: Arc<VoterSet<AuthorityId>>,
321321
has_voted: HasVoted<B>,
322322
) -> (impl Stream<Item = SignedMessage<B>> + Unpin, OutgoingMessages<B>) {
323-
self.note_round(round, set_id, &*voters);
323+
self.note_round(round, set_id, &voters);
324324

325325
let keystore = keystore.and_then(|ks| {
326326
let id = ks.local_id();
@@ -637,9 +637,9 @@ fn incoming_global<B: BlockT>(
637637
.filter_map(move |(notification, msg)| {
638638
future::ready(match msg {
639639
GossipMessage::Commit(msg) =>
640-
process_commit(msg, notification, &gossip_engine, &gossip_validator, &*voters),
640+
process_commit(msg, notification, &gossip_engine, &gossip_validator, &voters),
641641
GossipMessage::CatchUp(msg) =>
642-
process_catch_up(msg, notification, &gossip_engine, &gossip_validator, &*voters),
642+
process_catch_up(msg, notification, &gossip_engine, &gossip_validator, &voters),
643643
_ => {
644644
debug!(target: "afg", "Skipping unknown message type");
645645
None

client/finality-grandpa/src/import.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ where
284284

285285
impl<'a, H, N> InnerGuard<'a, H, N> {
286286
fn as_mut(&mut self) -> &mut AuthoritySet<H, N> {
287-
&mut **self.guard.as_mut().expect("only taken on deconstruction; qed")
287+
self.guard.as_mut().expect("only taken on deconstruction; qed")
288288
}
289289

290290
fn set_old(&mut self, old: AuthoritySet<H, N>) {

0 commit comments

Comments
 (0)