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

[move-vm] allow multi-module publication #8555

Merged
merged 2 commits into from
Jul 17, 2021
Merged

Commits on Jul 17, 2021

  1. [move-vm] allow multi-module publication

    This commit allows the Move VM to take a vector of modules (for lacking
    of a better name, this vector of modules is called a bundle for now) and
    publish them together.
    
    Modules in the bundle vector must follow a topological order, i.e., if
    there is a dependency relation (usage or friend) between two modules
    A and B, via either 1) B uses A or 2) A declares B as a friend. Then,
    A must appear before B in the bundle vector in order to be published
    together. Putting B in front of A in this case will lead to a
    MISSING_DEPENDENCY error or other linker errors.
    
    All modules in the bundle will have to pass the bytecode verifier and
    will be linker-checked with existing modules and all other modules in
    the same bundle. Either all modules in the bundle are published/updated
    or none is published/updated. Publication of the whole bundle fails as
    long as one module in the bundle fail the bytecode verifier or the
    linker checks (i.e., dependency and cyclic dependency check).
    meng-xu-cs authored and bors-libra committed Jul 17, 2021
    Configuration menu
    Copy the full SHA
    cabfd25 View commit details
    Browse the repository at this point in the history
  2. [move-cli] test out multi-module publishing via Move CLI first

    The `move-cli sandbox publish` command now accepts a new optional
    command line argument -m/--override-ordering that allows manual
    specification of which compiled modules to be published and in what
    order.
    
    Specifying any of the `-m/--override-ordering` flag will invoke the
    multi-module publishing flow in the Move VM (compared with the
    traditional one-module-at-a-time flow).
    
    For example: `sandbox publish -m A -m B` will prepare a module vector
    [A, B] to be sent for publication while `-m B -m A` will create a vector
    [B, A]. And depending on the relationship betweem module A and B, it is
    possible that only one particular ordering can be allowed. For more
    detailed use cases, see the test case `multi_module_publish`.
    
    It is possible to specify less compiles than what gets compiled. For
    example, if three modules A, B, C are compiled and only `-m A -m B` is
    specified, then only A and B will be sent to Move VM for publication.
    
    It is also possiible to specify one module multiple times, e.g.,
    `-m A -m A`. The Move CLI will not complain about it but the Move VM
    will as it checks for no duplication in the vector of modules.
    
    It is, however, not possible to specify a non-compiled module (e.g.,
    module D which is not compiled) for publication. An error will be raised
    in this case.
    
    Closes: diem#8555
    meng-xu-cs authored and bors-libra committed Jul 17, 2021
    Configuration menu
    Copy the full SHA
    e110a4d View commit details
    Browse the repository at this point in the history