aptos-labs / aptos-core

Aptos is a layer 1 blockchain built to support the widespread use of blockchain through better technology and user experience.
https://aptosfoundation.org
Other
5.85k stars 3.54k forks source link

fix bug 13201 by emitting an empty vector constant load as a VecPack instead #13205

Closed brmataptos closed 1 week ago

brmataptos commented 2 weeks ago

Description

Handle empty vector constants by using VecPack instead of LdConst since the run-time vector constant doesn't have a type if it's empty.

Fixes #13201.

Type of Change

Which Components or Systems Does This Change Impact?

How Has This Been Tested?

Added tests showing the original bug, some simplified tests, and re-ran existing tests.

Key Areas to Review

Whatever

Checklist

trunk-io[bot] commented 2 weeks ago
⏱️ 7h 14m total CI duration on this PR | Job | Cumulative Duration | Recent Runs | |---|---|---| | [rust-targeted-unit-tests](https://github.com/aptos-labs/aptos-core/actions/runs/8964311721/job/24615922997) | 1h 8m | [🟥](https://github.com/aptos-labs/aptos-core/actions/runs/8954728500/job/24594704363) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8955537782/job/24596348909) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311721/job/24615922997)  | | [forge-framework-upgrade-test / forge](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24616163840) | 1h 8m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24616163840)  | | [rust-move-tests](https://github.com/aptos-labs/aptos-core/actions/runs/8964311735/job/24615914798) | 44m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8954728504/job/24594700458) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8955537777/job/24596344738) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311735/job/24615914798)  | | [rust-move-unit-coverage](https://github.com/aptos-labs/aptos-core/actions/runs/8955537781/job/24596344735) | 44m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8954728496/job/24594700297) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8955537781/job/24596344735)  | | [rust-smoke-tests](https://github.com/aptos-labs/aptos-core/actions/runs/8964311721/job/24615922432) | 39m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311721/job/24615922432)  | | [windows-build](https://github.com/aptos-labs/aptos-core/actions/runs/8964311725/job/24615914380) | 37m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311725/job/24615914380)  | | [execution-performance / single-node-performance](https://github.com/aptos-labs/aptos-core/actions/runs/8964311727/job/24615934559) | 23m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311727/job/24615934559)  | | [rust-lints](https://github.com/aptos-labs/aptos-core/actions/runs/8964311721/job/24615922248) | 17m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8954728500/job/24594704231) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8955537782/job/24596348799) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311721/job/24615922248)  | | [forge-e2e-test / forge](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24616163747) | 14m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24616163747)  | | [forge-compat-test / forge](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24616163666) | 13m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24616163666)  | | [run-tests-main-branch](https://github.com/aptos-labs/aptos-core/actions/runs/8964311756/job/24615924809) | 13m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8954728513/job/24594705296) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8955537756/job/24596351694) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311756/job/24615924809)  | | [rust-images / rust-all](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24615922682) | 12m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24615922682)  | | [framework-upgrade-determinator](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24615919135) | 10m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24615919135)  | | [rust-build-cached-packages](https://github.com/aptos-labs/aptos-core/actions/runs/8964311721/job/24615923173) | 8m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311721/job/24615923173)  | | [cli-e2e-tests / run-cli-tests](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24616163389) | 6m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24616163389)  | | [general-lints](https://github.com/aptos-labs/aptos-core/actions/runs/8964311721/job/24615922613) | 5m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8954728500/job/24594704272) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8955537782/job/24596348686) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311721/job/24615922613)  | | [check](https://github.com/aptos-labs/aptos-core/actions/runs/8964311745/job/24615914772) | 4m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311745/job/24615914772)  | | [check-dynamic-deps](https://github.com/aptos-labs/aptos-core/actions/runs/8964311719/job/24615914385) | 4m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8954728509/job/24594700070) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8955537780/job/24596344482) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311719/job/24615914385)  | | [semgrep/ci](https://github.com/aptos-labs/aptos-core/actions/runs/8964311739/job/24615914387) | 1m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8954728501/job/24594700006) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8955537786/job/24596344493) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311739/job/24615914387)  | | [node-api-compatibility-tests / node-api-compatibility-tests](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24616163273) | 50s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24616163273)  | | [execution-performance / file_change_determinator](https://github.com/aptos-labs/aptos-core/actions/runs/8964311727/job/24615914688) | 49s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311727/job/24615914688)  | | [file_change_determinator](https://github.com/aptos-labs/aptos-core/actions/runs/8964311721/job/24615914889) | 41s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8954728500/job/24594700401) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8955537782/job/24596344811) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311721/job/24615914889)  | | [file_change_determinator](https://github.com/aptos-labs/aptos-core/actions/runs/8964311756/job/24615918459) | 30s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8954728513/job/24594702515) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8955537756/job/24596346292) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311756/job/24615918459)  | | [file_change_determinator](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24615918852) | 17s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24615918852)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/8964311753/job/24615914560) | 16s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8954728511/job/24594700089) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8955537753/job/24596344409) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311753/job/24615914560)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/8964311756/job/24615914764) | 11s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8954728513/job/24594700399) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8955537756/job/24596344622) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311756/job/24615914764)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/8964311752/job/24615914479) | 9s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8954728512/job/24594700189) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8955537752/job/24596344355) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311752/job/24615914479)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/8964311754/job/24615914674) | 8s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8954728515/job/24594700396) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8955537754/job/24596344461) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311754/job/24615914674)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24615915037) | 4s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24615915037)  | | [determine-docker-build-metadata](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24615919024) | 1s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8964311783/job/24615919024)  |

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

Job Duration vs 7d avg Delta
framework-upgrade-determinator 10m 4m +151%
rust-move-tests 17m 8m +100%
rust-build-cached-packages 8m 5m +75%
rust-targeted-unit-tests 23m 15m +59%

settingsfeedbackdocs ⋅ learn more about trunk.io

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 95.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 57.6%. Comparing base (5422dc1) to head (0d4151e). Report is 4 commits behind head on main.

Files Patch % Lines
...v2/src/file_format_generator/function_generator.rs 94.4% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #13205 +/- ## ======================================= Coverage 57.6% 57.6% ======================================= Files 834 834 Lines 198369 198399 +30 ======================================= + Hits 114306 114334 +28 - Misses 84063 84065 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 1 week ago

Forge is running suite realistic_env_max_load on 0d4151ebe52ceeea579a9a4913e7518cb16d12d3

github-actions[bot] commented 1 week ago

Forge is running suite framework_upgrade on 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0d4151ebe52ceeea579a9a4913e7518cb16d12d3

github-actions[bot] commented 1 week ago

Forge is running suite compat on 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0d4151ebe52ceeea579a9a4913e7518cb16d12d3

github-actions[bot] commented 1 week ago

:white_check_mark: Forge suite compat success on 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0d4151ebe52ceeea579a9a4913e7518cb16d12d3

Compatibility test results for 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0d4151ebe52ceeea579a9a4913e7518cb16d12d3 (PR)
1. Check liveness of validators at old version: 01b24e7e3548382dd25440b39a0438a993387f12
compatibility::simple-validator-upgrade::liveness-check : committed: 6956 txn/s, latency: 4776 ms, (p50: 4800 ms, p90: 7500 ms, p99: 8100 ms), latency samples: 243480
2. Upgrading first Validator to new version: 0d4151ebe52ceeea579a9a4913e7518cb16d12d3
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 1476 txn/s, latency: 20253 ms, (p50: 19200 ms, p90: 29600 ms, p99: 29900 ms), latency samples: 87120
3. Upgrading rest of first batch to new version: 0d4151ebe52ceeea579a9a4913e7518cb16d12d3
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 1771 txn/s, latency: 16316 ms, (p50: 19700 ms, p90: 22700 ms, p99: 23200 ms), latency samples: 88560
4. upgrading second batch to new version: 0d4151ebe52ceeea579a9a4913e7518cb16d12d3
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 3387 txn/s, latency: 8983 ms, (p50: 9800 ms, p90: 12400 ms, p99: 13000 ms), latency samples: 145660
5. check swarm health
Compatibility test for 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0d4151ebe52ceeea579a9a4913e7518cb16d12d3 passed
Test Ok
github-actions[bot] commented 1 week ago

:white_check_mark: Forge suite realistic_env_max_load success on 0d4151ebe52ceeea579a9a4913e7518cb16d12d3

two traffics test: inner traffic : committed: 7926 txn/s, latency: 4947 ms, (p50: 4800 ms, p90: 5700 ms, p99: 10500 ms), latency samples: 3424420
two traffics test : committed: 100 txn/s, latency: 1983 ms, (p50: 1900 ms, p90: 2100 ms, p99: 6000 ms), latency samples: 1760
Latency breakdown for phase 0: ["QsBatchToPos: max: 0.205, avg: 0.202", "QsPosToProposal: max: 0.243, avg: 0.234", "ConsensusProposalToOrdered: max: 0.449, avg: 0.421", "ConsensusOrderedToCommit: max: 0.392, avg: 0.375", "ConsensusProposalToCommit: max: 0.816, avg: 0.796"]
Max round gap was 1 [limit 4] at version 1633692. Max no progress secs was 4.591461 [limit 15] at version 1633692.
Test Ok
github-actions[bot] commented 1 week ago

:white_check_mark: Forge suite framework_upgrade success on 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0d4151ebe52ceeea579a9a4913e7518cb16d12d3

Compatibility test results for 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0d4151ebe52ceeea579a9a4913e7518cb16d12d3 (PR)
Upgrade the nodes to version: 0d4151ebe52ceeea579a9a4913e7518cb16d12d3
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1251 txn/s, submitted: 1253 txn/s, failed submission: 2 txn/s, expired: 2 txn/s, latency: 2473 ms, (p50: 2100 ms, p90: 4300 ms, p99: 5700 ms), latency samples: 111400
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1261 txn/s, submitted: 1264 txn/s, failed submission: 2 txn/s, expired: 2 txn/s, latency: 2479 ms, (p50: 2100 ms, p90: 4200 ms, p99: 6000 ms), latency samples: 114840
5. check swarm health
Compatibility test for 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0d4151ebe52ceeea579a9a4913e7518cb16d12d3 passed
Upgrade the remaining nodes to version: 0d4151ebe52ceeea579a9a4913e7518cb16d12d3
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1261 txn/s, submitted: 1264 txn/s, failed submission: 2 txn/s, expired: 2 txn/s, latency: 2641 ms, (p50: 2100 ms, p90: 4500 ms, p99: 7200 ms), latency samples: 103480
Test Ok