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

Resolve compiler warning by removing unused line #15381

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

Levi0804
Copy link
Contributor

@Levi0804 Levi0804 commented Nov 23, 2024

Description

This PR removes an unused line from the unit test test_events in the account module (aptos-move/framework/aptos-framework/sources/account.move):
let eventhandle = &borrow_global<Account>(addr).coin_register_events;

How to generate the warning?

To generate the warning, create a module and bring the account module into scope. For example:

module 0x9000::test {
    use aptos_framework::account;
}

now use aptos move test, the following warning could be seen:

warning[W09003]: unused assignment
     ┌─ /home/levi0804/.move/https___github_com_aptos-labs_aptos-core_git_mainnet/aptos-move/framework/aptos-framework/sources/account.move:1538:13
     │
1538 │         let eventhandle = &borrow_global<Account>(addr).coin_register_events;
     │             ^^^^^^^^^^^ Unused assignment or binding for local 'eventhandle'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_eventhandle')

How Has This Been Tested?

I removed the mentioned line locally from the unit test in the account module and ran aptos move test --skip-fetch-latest-git-deps on a module similar to the one above (0x9000::test), which resolved the compiler warning

Type of Change

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

@Levi0804 Levi0804 requested a review from alinush as a code owner November 23, 2024 21:30
Copy link

trunk-io bot commented Nov 23, 2024

⏱️ 17m total CI duration on this PR
Job Cumulative Duration Recent Runs
rust-move-tests 12m 🟩
rust-cargo-deny 2m 🟩
check-dynamic-deps 1m 🟩
semgrep/ci 29s 🟩
general-lints 25s 🟩
file_change_determinator 12s 🟩
permission-check 6s 🟥🟩
permission-check 5s 🟥🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

Copy link
Contributor

@gregnazario gregnazario left a comment

Choose a reason for hiding this comment

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

Doing the real work that kept bothering me :)

@Levi0804
Copy link
Contributor Author

Doing the real work that kept bothering me :)

Happy to contribute! :D

@alinush alinush enabled auto-merge (squash) December 2, 2024 19:52
@alinush alinush force-pushed the resolve-compiler-warning branch from 102f186 to d215c12 Compare December 2, 2024 19:52

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Dec 2, 2024

✅ Forge suite realistic_env_max_load success on d215c123aade44a9996ead4168ee0bf15ee5e951

two traffics test: inner traffic : committed: 13894.55 txn/s, latency: 2862.76 ms, (p50: 2700 ms, p70: 2700, p90: 3000 ms, p99: 3900 ms), latency samples: 5283060
two traffics test : committed: 100.06 txn/s, latency: 2199.36 ms, (p50: 2000 ms, p70: 2200, p90: 2500 ms, p99: 10400 ms), latency samples: 1780
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 2.045, avg: 1.194", "ConsensusProposalToOrdered: max: 0.321, avg: 0.297", "ConsensusOrderedToCommit: max: 0.386, avg: 0.369", "ConsensusProposalToCommit: max: 0.681, avg: 0.666"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.76s no progress at version 1923226 (avg 0.20s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 15.47s no progress at version 1923222 (avg 14.95s) [limit 16].
Test Ok

Copy link
Contributor

github-actions bot commented Dec 2, 2024

✅ Forge suite compat success on 010570d3b7aa20889fb5ad0e5b23800aa33f5634 ==> d215c123aade44a9996ead4168ee0bf15ee5e951

Compatibility test results for 010570d3b7aa20889fb5ad0e5b23800aa33f5634 ==> d215c123aade44a9996ead4168ee0bf15ee5e951 (PR)
1. Check liveness of validators at old version: 010570d3b7aa20889fb5ad0e5b23800aa33f5634
compatibility::simple-validator-upgrade::liveness-check : committed: 14839.28 txn/s, latency: 2257.63 ms, (p50: 2100 ms, p70: 2100, p90: 2200 ms, p99: 7500 ms), latency samples: 556640
2. Upgrading first Validator to new version: d215c123aade44a9996ead4168ee0bf15ee5e951
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 6810.42 txn/s, latency: 4166.41 ms, (p50: 4700 ms, p70: 4900, p90: 5400 ms, p99: 5700 ms), latency samples: 125880
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 6740.55 txn/s, latency: 4793.91 ms, (p50: 5100 ms, p70: 5200, p90: 6600 ms, p99: 7000 ms), latency samples: 226540
3. Upgrading rest of first batch to new version: d215c123aade44a9996ead4168ee0bf15ee5e951
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 7047.51 txn/s, latency: 3972.10 ms, (p50: 4500 ms, p70: 4700, p90: 4900 ms, p99: 5100 ms), latency samples: 129780
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 7017.45 txn/s, latency: 4544.92 ms, (p50: 4800 ms, p70: 5000, p90: 6300 ms, p99: 6500 ms), latency samples: 236840
4. upgrading second batch to new version: d215c123aade44a9996ead4168ee0bf15ee5e951
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 11830.86 txn/s, latency: 2365.78 ms, (p50: 2600 ms, p70: 2700, p90: 2800 ms, p99: 3000 ms), latency samples: 204820
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 10307.59 txn/s, latency: 3035.44 ms, (p50: 2700 ms, p70: 2800, p90: 6100 ms, p99: 7100 ms), latency samples: 334480
5. check swarm health
Compatibility test for 010570d3b7aa20889fb5ad0e5b23800aa33f5634 ==> d215c123aade44a9996ead4168ee0bf15ee5e951 passed
Test Ok

Copy link
Contributor

github-actions bot commented Dec 2, 2024

✅ Forge suite framework_upgrade success on 010570d3b7aa20889fb5ad0e5b23800aa33f5634 ==> d215c123aade44a9996ead4168ee0bf15ee5e951

Compatibility test results for 010570d3b7aa20889fb5ad0e5b23800aa33f5634 ==> d215c123aade44a9996ead4168ee0bf15ee5e951 (PR)
Upgrade the nodes to version: d215c123aade44a9996ead4168ee0bf15ee5e951
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1392.42 txn/s, submitted: 1393.77 txn/s, failed submission: 1.35 txn/s, expired: 1.35 txn/s, latency: 2317.12 ms, (p50: 1800 ms, p70: 2400, p90: 4200 ms, p99: 5700 ms), latency samples: 123600
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1457.34 txn/s, submitted: 1460.46 txn/s, failed submission: 3.12 txn/s, expired: 3.12 txn/s, latency: 2037.76 ms, (p50: 1800 ms, p70: 2100, p90: 3000 ms, p99: 4600 ms), latency samples: 130980
5. check swarm health
Compatibility test for 010570d3b7aa20889fb5ad0e5b23800aa33f5634 ==> d215c123aade44a9996ead4168ee0bf15ee5e951 passed
Upgrade the remaining nodes to version: d215c123aade44a9996ead4168ee0bf15ee5e951
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1196.28 txn/s, submitted: 1199.38 txn/s, failed submission: 3.09 txn/s, expired: 3.09 txn/s, latency: 2533.43 ms, (p50: 2400 ms, p70: 2700, p90: 3600 ms, p99: 5300 ms), latency samples: 108240
Test Ok

@alinush alinush merged commit fda6770 into aptos-labs:main Dec 2, 2024
48 checks passed
@Levi0804 Levi0804 deleted the resolve-compiler-warning branch December 2, 2024 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants