Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code to remove lots of warnings from Rust 1.83 #15593

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

gregnazario
Copy link
Contributor

@gregnazario gregnazario commented Dec 13, 2024

Description

There are a ton of warnings for mostly cosmetic things added to Rust 1.83. For anything that was complex, or required renaming, I added an allow.

Otherwise main things changed:

  1. Features are required, so all names missing were added. Not much was looked into why the features existed.
  2. Lifetimes are now elided '_ or sometimes named specifically 'a, each are approached correctly.
  3. Now Rust checks ceil_div implementations and adds them accordingly
  4. Lots of code was "unused", so dead_code annotation is added
  5. Lots of unwrap_or, or other improvements about code that's unnecessary
  6. Documentation is for some reason really aggressively formatted now. So, this fixes most of them. May be slightly off, but it should be good enough.
  7. There are some checks with macros, those have been updated accordingly or ignored in the case of poem and the MoveVM cc @banool @georgemitenkov

How Has This Been Tested?

We're running the full testsuite on this PR to ensure it works.

Key Areas to Review

For each area, please review and ensure there is no behavior change. For the Move compiler, and storage, most of the changes are just removing <'a> and moving to '_ as per the compiler.

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Move Compiler
  • Other (specify)

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Copy link

trunk-io bot commented Dec 13, 2024

⏱️ 5h 31m total CI duration on this PR
Slowest 15 Jobs Cumulative Duration Recent Runs
execution-performance / single-node-performance 1h 13m 🟥🟥🟥🟥🟥
execution-performance / test-target-determinator 42m 🟩🟩🟩🟩🟥 (+1 more)
rust-unit-tests 24m 🟥
rust-unit-tests 24m 🟥
rust-unit-tests 23m 🟥
test-target-determinator 23m 🟩🟩🟩🟥
check 14m 🟩🟩🟩🟩
rust-move-tests 13m 🟩
rust-move-tests 13m 🟩
rust-move-tests 13m 🟩
rust-move-tests 13m 🟩
check-dynamic-deps 11m 🟩🟩🟩🟩🟩 (+3 more)
rust-cargo-deny 9m 🟥🟥🟥🟥🟥 (+1 more)
fetch-last-released-docker-image-tag 6m 🟩🟩🟩🟩
rust-doc-tests 6m 🟩

🚨 3 jobs on the last run were significantly faster/slower than expected

Job Duration vs 7d avg Delta
test-target-determinator 7m 4m +71%
execution-performance / test-target-determinator 7m 4m +68%
execution-performance / single-node-performance 24m 18m +34%

settingsfeedbackdocs ⋅ learn more about trunk.io

@rustielin rustielin added CICD:build-images when this label is present github actions will start build+push rust images from the PR. CICD:run-e2e-tests when this label is present github actions will run all land-blocking e2e tests from the PR CICD:run-all-unit-tests Runs all unit tests labels Dec 13, 2024
Copy link
Contributor

@banool banool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the stuff I'm familiar with (faucet, CLI, indexer) pretty closely and skimmed the rest, looks good.

@@ -305,6 +305,7 @@ impl CheckerTrait for RedisRatelimitChecker {

/// All we have to do here is decrement the counter if the request was a failure due
/// to something wrong on our end.
#[allow(dependency_on_unit_never_type_fallback)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allowing this seems fine to me for now, the proper never type (!) isn't even stable yet, we'll revisit it later when it is.

} else {
num_tasks
}
num_tasks.clamp(1, MAX_FETCH_TASKS_PER_REQUEST)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat

This comment has been minimized.

@gregnazario gregnazario force-pushed the update-to-latest-rust branch from 5df4772 to ed657e0 Compare December 13, 2024 20:45

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

✅ Forge suite realistic_env_max_load success on ed657e0fdde1276de0c58c77e895a05d8d119fcb

two traffics test: inner traffic : committed: 14883.87 txn/s, latency: 2667.78 ms, (p50: 2700 ms, p70: 2700, p90: 3000 ms, p99: 3300 ms), latency samples: 5659220
two traffics test : committed: 100.10 txn/s, latency: 1410.53 ms, (p50: 1400 ms, p70: 1400, p90: 1500 ms, p99: 1600 ms), latency samples: 1740
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 1.510, avg: 1.466", "ConsensusProposalToOrdered: max: 0.315, avg: 0.288", "ConsensusOrderedToCommit: max: 0.374, avg: 0.363", "ConsensusProposalToCommit: max: 0.659, avg: 0.651"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.55s no progress at version 31820 (avg 0.20s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.64s no progress at version 2177354 (avg 0.59s) [limit 16].
Test Ok

Copy link
Contributor

✅ Forge suite compat success on 3c6e693a27339e73520f41030dce8fc9cd504967 ==> ed657e0fdde1276de0c58c77e895a05d8d119fcb

Compatibility test results for 3c6e693a27339e73520f41030dce8fc9cd504967 ==> ed657e0fdde1276de0c58c77e895a05d8d119fcb (PR)
1. Check liveness of validators at old version: 3c6e693a27339e73520f41030dce8fc9cd504967
compatibility::simple-validator-upgrade::liveness-check : committed: 15901.68 txn/s, latency: 2140.25 ms, (p50: 1800 ms, p70: 2000, p90: 2600 ms, p99: 12700 ms), latency samples: 548940
2. Upgrading first Validator to new version: ed657e0fdde1276de0c58c77e895a05d8d119fcb
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 7451.05 txn/s, latency: 3846.94 ms, (p50: 4200 ms, p70: 4500, p90: 4600 ms, p99: 4800 ms), latency samples: 140480
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 7448.16 txn/s, latency: 4329.97 ms, (p50: 4600 ms, p70: 4700, p90: 4700 ms, p99: 4800 ms), latency samples: 254260
3. Upgrading rest of first batch to new version: ed657e0fdde1276de0c58c77e895a05d8d119fcb
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 6633.76 txn/s, latency: 4350.21 ms, (p50: 4700 ms, p70: 4900, p90: 5200 ms, p99: 5400 ms), latency samples: 132760
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 7307.32 txn/s, latency: 4450.47 ms, (p50: 4800 ms, p70: 4900, p90: 5000 ms, p99: 5400 ms), latency samples: 247720
4. upgrading second batch to new version: ed657e0fdde1276de0c58c77e895a05d8d119fcb
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 11641.43 txn/s, latency: 2372.28 ms, (p50: 2600 ms, p70: 2700, p90: 2800 ms, p99: 3000 ms), latency samples: 204920
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 12091.04 txn/s, latency: 2640.05 ms, (p50: 2700 ms, p70: 2800, p90: 2900 ms, p99: 3000 ms), latency samples: 392800
5. check swarm health
Compatibility test for 3c6e693a27339e73520f41030dce8fc9cd504967 ==> ed657e0fdde1276de0c58c77e895a05d8d119fcb passed
Test Ok

Copy link
Contributor

@georgemitenkov georgemitenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VM side is ok, interesting that same attributes with different arguments are considered the same by linter now.

@vineethk vineethk self-requested a review December 16, 2024 19:52
Copy link
Contributor

@vineethk vineethk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed the move compilers, linter etc under third-party.

@@ -11,7 +11,7 @@ use move_core_types::metadata::Metadata;
use move_ethereum_abi::abi_move_type::{ABIMoveSignature, ABI_ETHER_MOVE_KEY};
use std::{collections::BTreeMap, str};

/// Generate Metadata for move signature
// Generate Metadata for move signature
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should keep the /// comment, but remove the empty lin below?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CICD:build-images when this label is present github actions will start build+push rust images from the PR. CICD:run-all-unit-tests Runs all unit tests CICD:run-e2e-tests when this label is present github actions will run all land-blocking e2e tests from the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants