move toolchain: fix multiple issues with bytecode dependencies
Description
This PR fixes multiple issues caused by bytecode dependencies not being included in CompiledPackage:
- multiple functionalities failing due to topo sort in
Modulespanicking on missing dependencies - running
move teston packages with bytecode deps failing due to them not being included in VM storage - source verification failing because bytecode deps aren't handled
- commands such as publish and upgrade failing due to bytecode deps not being referenced in the construction of transaction blocks
Summary of changes:
- removed
move_bytecode_utils::dependency_graphmodule and instead added acompute_topological_ordermethod toModules. Replaced all calls tocompute_dependency_graphwith a direct call tocompute_topological_order(2 in total) - added bytecode deps to VM storage for test runs by loading them from
ResolvedGraph - include bytecode deps in
sui_move_build::CompiledPackageand fix various module fetching methods to return modules from bytecode deps also - include bytecode deps in
local_modulesfunction to fixLocalDependencyNotFounderrors in source verification
This is part of the work to enable compiling against on-chain dependencies https://github.com/MystenLabs/sui/pull/14178.
cc @rvantonder @amnn
Test Plan
Added unit tests for move test and source verification.
If your changes are not user-facing and do not break anything, you can skip the following section. Otherwise, please briefly describe what has changed under the Release Notes section.
Type of Change (Check all that apply)
- [ ] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration
Release notes
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| sui-core | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 11, 2024 0:56am |
| sui-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 11, 2024 0:56am |
3 Skipped Deployments
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| multisig-toolkit | ⬜️ Ignored (Inspect) | Visit Preview | Sep 11, 2024 0:56am | |
| sui-kiosk | ⬜️ Ignored (Inspect) | Visit Preview | Sep 11, 2024 0:56am | |
| sui-typescript-docs | ⬜️ Ignored (Inspect) | Visit Preview | Sep 11, 2024 0:56am |
Thanks @kklas! Kicking off CI so long, review to follow!
@tnowacki agree with everything. I'm waiting for other comments to do round 2 here.
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.
I apologize for this unreasonably long delay. I have restarted the work on this:
- rebase
- move
bytecode_deps_modulesinsideTestRunner - use
IndexMapincompute_topological_order
@amnn @rvantonder @tnowacki I would appreciate another look
@kklas, my hand is hovering over "Squash and Merge" but let me know if you want to do a final rebase, etc before I send it.
@amnn rebase done, all good to go!
It's in, 🚀 , thanks very much @kklas!