-
Notifications
You must be signed in to change notification settings - Fork 27
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
[3.2] cleos: add get supported_protocol_features and system activate subcommands #663
Conversation
…ch as: cleos system activate kv_database. don't need using digest.
…ve PREACTIVATE_FEATURE as it cannot be activated via activate action
programs/cleos/main.cpp
Outdated
activate_subcommand(CLI::App* actionRoot) { | ||
auto activate = actionRoot->add_subcommand("activate", localized("Activate protocol feature by name")); | ||
activate->add_option("feature", feature_name_str, localized("The name, one of below (lowercase also works):\n" | ||
"ONLY_LINK_TO_EXISTING_PERMISSION\n" |
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.
Can we have a way of generating these from parsing the protocol_feature_manager.cpp? We have this pattern in quite a few places as is where we have hard-coded the protocol feature names and digests. It ultimately makes it incredibly difficult to add new protocol features as all the places you have to go and fix are not connected and usually won't break certain tests, etc.
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.
This right here please.
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.
Thanks @larryk85 and @spoonincode I will call get_supported_protocol_features
to get a list. This code will never change again when protocol features change.
programs/cleos/main.cpp
Outdated
string action="activate"; | ||
string data; | ||
std::locale loc; | ||
vector<std::string> permissions = {"eosio"}; |
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.
Would be nice to provide an option to override the default permission.
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.
Thanks @heifner . Will add an option to provide more flexibility.
…g get_supported_protocol_features RPC; provide account and permission options
…o contact the chain in the constructor of activate_subcommand which causes problems for cleos problem initialzation when the chain is offline, and a seperate get supported_protocol_features is clearer
…workfoundation/mandel into cleos_activate_subcommand
…ctivated is unknown
…workfoundation/mandel into cleos_activate_subcommand
Backport EOSIO/eos#10036 spiritually. Resolve #462
Add
get supported_protocol_features
andsystem activate
tocleos
such that protocol features can be activated by using their names; no feature digests are needed.The feature was totally rewritten. Hardcodied protocol feature names and digests are removed. User can use
get supported_protocol_features
to find a list of supported feature names. Command description was cleaned up andPREACTIVATE_FEATURE
was removed as it is not possible to activate it usingactivate
action fromeosio.boot
(RPCschedule_protocol_feature_activations
must be used).