-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[CLI] Add a warning if the CLI falls behind more than 2 protocol versions #20426
[CLI] Add a warning if the CLI falls behind more than 2 protocol versions #20426
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
crates/sui/src/sui_commands.rs
Outdated
let on_chain_protocol_version = protocol_cfg.protocol_version.as_u64(); | ||
let cli_protocol_version = ProtocolConfig::get_for_max_version_UNSAFE() | ||
.version | ||
.as_u64(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could just be ProtocolVersion::MAX
. Otherwise LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, from what I can tell we can only call max()
on ProtocolConfig
if we have the actual object/reference to it, which we don't. If you know a way how to avoid the get_for_max_version_UNSAFE()
, happy to learn!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could just be
ProtocolVersion::MAX
. Otherwise LGTM
You were right, this is the right way! Thanks for the suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next time I'll have to put the diff I wasn't sure what you meant yesterday but figured it was caused by me not being clear enough 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not at all, I misread it: instead of ProtocolVersion
I read it ProtocolConfig
so things did not click :D
7e5b1c6
to
b779fc5
Compare
Description
This change adds a warning when the CLI falls behind more than 2 protocol versions against the current active network on which the command will be executing against.
Test plan
Locally.
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.