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-cli] Update framework branch in sui move new template #11614

Merged
merged 1 commit into from
May 2, 2023

Conversation

amnn
Copy link
Contributor

@amnn amnn commented May 2, 2023

Description

Differentiate the branch that node operators build their software off of (e.g. mainnet) from the branch that Move package developers depend on the framework at (e.g. framework/mainnet).

This is to account for the fact that when a protocol version/binary upgrade includes a framework change, there is a period of time between when the tracking branch for node operators (e.g. mainnet) is updated and when the network performs the protocol upgrade where an attempt to publish a package that depends on a system package will fail because of dependency source validation.

This PR also introduces some other minor changes to the new package template:

  • Remove an extraneous space in the addresses output.
  • Don't include the address for sui because it will be inherited from the Sui dependency automatically.

Test Plan

Test output from sui move new

crates/sui$ cargo run -- --path /tmp/example example
crates/sui$ cat /tmp/example/Move.toml
[package]
name = "example"
version = "0.0.1"

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" }

[addresses]
example = "0x0"

Test script that checks compatibility against localnet:

crates/sui$ cargo build
sui$ export SUI=$(git rev-parse --show-toplevel)/target/debug/sui
sui$ $SUI genesis -f && $SUI start

     # In a new terminal session
sui$ export SUI=$(git rev-parse --show-toplevel)/target/debug/sui
sui$ $SUI client switch --env localnet
sui$ ./scripts/check-framework-compat.sh

If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.

Type of Change (Check all that apply)

  • 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 revision that the framework used by $NETWORK is found it is now framework/$NETWORK and not just $NETWORK.

Not Found
@amnn amnn self-assigned this May 2, 2023
@vercel
Copy link

vercel bot commented May 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) May 2, 2023 6:30pm
explorer-storybook ⬜️ Ignored (Inspect) May 2, 2023 6:30pm
sui-wallet-kit ⬜️ Ignored (Inspect) May 2, 2023 6:30pm
wallet-adapter ⬜️ Ignored (Inspect) May 2, 2023 6:30pm

@amnn
Copy link
Contributor Author

amnn commented May 2, 2023

@ebmifa the framework/... branches should now be pushed remotely.

Differentiate the branch that node operators build their software off
of (e.g. `mainnet`) from the branch that Move package developers
depend on the framework at (e.g. `framework/mainnet`).

This is to account for the fact that when a protocol version/binary
upgrade includes a framework change, there is a period of time between
when the tracking branch for node operators (e.g. `mainnet`) is
updated and when the network performs the protocol upgrade where an
attempt to publish a package that depends on a system package will
fail because of dependency source validation.

This PR also introduces some other minor changes to the new package
template:

- Remove an extraneous space in the `addresses` output.
- Don't include the address for `sui` because it will be inherited
  from the `Sui` dependency automatically.

Test Plan:

Test output from `sui move new`

```
crates/sui$ cargo run -- --path /tmp/example example
crates/sui$ cat /tmp/example/Move.toml
[package]
name = "example"
version = "0.0.1"

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" }

[addresses]
example = "0x0"
```

Test script that checks compatibility against localnet:

```
crates/sui$ cargo build
sui$ export SUI=$(git rev-parse --show-toplevel)/target/debug/sui
sui$ $SUI genesis -f && $SUI start

     # In a new terminal session
sui$ export SUI=$(git rev-parse --show-toplevel)/target/debug/sui
sui$ $SUI client switch --env localnet
sui$ ./scripts/check-framework-compat.sh
```
@amnn amnn force-pushed the amnn/framework-branches branch from e5738d4 to 2ba7426 Compare May 2, 2023 18:28
@github-actions github-actions bot added the Type: Documentation Improvements or additions to documentation label May 2, 2023
@amnn amnn merged commit d8535a2 into main May 2, 2023
@amnn amnn deleted the amnn/framework-branches branch May 2, 2023 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants