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
6.17k stars 3.64k forks source link

[Bug][Prover][Compiler-v2] V2 bytecode does not work with the prover when the code contains constants #11673

Closed rahxephon89 closed 7 months ago

rahxephon89 commented 9 months ago

🐛 Bug

When the Move code contains constants such as const MAX_FRACTIONAL_PART: u128 = 0xFFFFFFFFFFFFFFFF;, constant_map is only generated V1, not V2. So when the prover tries to use the bytecode generated by V2, panic will happen because of the code here.

brmataptos commented 7 months ago

Do we have a script/process to follow to exhibit the original bug?

rahxephon89 commented 7 months ago

Do we have a script/process to follow to exhibit the original bug?

run ENV_TEST_FEATURE=v2 cargo test test_bitvector in third_party/move/move-prover.

rahxephon89 commented 7 months ago

Confirmed that the constant map can be accessed when running the prover in V2 mode.