diff --git a/contracts/contracts/eosio.bios/bin/eosio.bios.abi b/contracts/contracts/eosio.bios/bin/eosio.bios.abi index 3358cda10db..8b73b2e273c 100644 --- a/contracts/contracts/eosio.bios/bin/eosio.bios.abi +++ b/contracts/contracts/eosio.bios/bin/eosio.bios.abi @@ -400,6 +400,16 @@ } ] }, + { + "name": "setpparams", + "base": "", + "fields": [ + { + "name": "bytes", + "type": "bytes" + } + ] + }, { "name": "setpriv", "base": "", @@ -545,6 +555,11 @@ "type": "setparams", "ricardian_contract": "" }, + { + "name": "setpparams", + "type": "setpparams", + "ricardian_contract": "" + }, { "name": "setpriv", "type": "setpriv", diff --git a/contracts/contracts/eosio.bios/bin/eosio.bios.wasm b/contracts/contracts/eosio.bios/bin/eosio.bios.wasm index ee60053ff38..758bef069b8 100755 Binary files a/contracts/contracts/eosio.bios/bin/eosio.bios.wasm and b/contracts/contracts/eosio.bios/bin/eosio.bios.wasm differ diff --git a/contracts/contracts/eosio.bios/include/eosio.bios/eosio.bios.hpp b/contracts/contracts/eosio.bios/include/eosio.bios/eosio.bios.hpp index 83b99e1b144..63b37d3e50a 100644 --- a/contracts/contracts/eosio.bios/include/eosio.bios/eosio.bios.hpp +++ b/contracts/contracts/eosio.bios/include/eosio.bios/eosio.bios.hpp @@ -68,7 +68,7 @@ namespace eosiobios { /** * The `eosio.bios` is the first sample of system contract provided by `block.one` through the EOSIO platform. It is a minimalist system contract because it only supplies the actions that are absolutely critical to bootstrap a chain and nothing more. This allows for a chain agnostic approach to bootstrapping a chain. - * + * * Just like in the `eosio.system` sample contract implementation, there are a few actions which are not implemented at the contract level (`newaccount`, `updateauth`, `deleteauth`, `linkauth`, `unlinkauth`, `canceldelay`, `onerror`, `setabi`, `setcode`), they are just declared in the contract so they will show in the contract's ABI and users will be able to push those actions to the chain via the account holding the `eosio.system` contract, but the implementation is at the EOSIO core level. They are referred to as EOSIO native actions. */ class [[eosio::contract("eosio.bios")]] bios : public eosio::contract { @@ -228,6 +228,14 @@ namespace eosiobios { [[eosio::action]] void setparams( const eosio::blockchain_parameters& params ); + /** + * Set params action, sets the blockchain parameters. By tuning these parameters, various degrees of customization can be achieved. + * + * @param params - New blockchain parameters to set + */ + [[eosio::action]] + void setpparams( const std::vector& bytes); + /** * Set KV params action, sets the KV parameters. By tuning these parameters, various degrees of customization can be achieved. * @@ -283,6 +291,7 @@ namespace eosiobios { using setalimits_action = action_wrapper<"setalimits"_n, &bios::setalimits>; using setprods_action = action_wrapper<"setprods"_n, &bios::setprods>; using setparams_action = action_wrapper<"setparams"_n, &bios::setparams>; + using setpparams_action = action_wrapper<"setpparams"_n, &bios::setpparams>; using setkvparams_action = action_wrapper<"setkvparams"_n, &bios::setkvparams>; using reqauth_action = action_wrapper<"reqauth"_n, &bios::reqauth>; using activate_action = action_wrapper<"activate"_n, &bios::activate>; diff --git a/contracts/contracts/eosio.bios/src/eosio.bios.cpp b/contracts/contracts/eosio.bios/src/eosio.bios.cpp index 7ceebac38a4..a87961d8c89 100644 --- a/contracts/contracts/eosio.bios/src/eosio.bios.cpp +++ b/contracts/contracts/eosio.bios/src/eosio.bios.cpp @@ -2,6 +2,12 @@ namespace eosiobios { +// move this to CDT after this release +extern "C" { + __attribute__((eosio_wasm_import)) + void set_parameters_packed(const char*, std::size_t); +} + void bios::setabi( name account, const std::vector& abi ) { abi_hash_table table(get_self(), get_self().value); auto itr = table.find( account.value ); @@ -41,6 +47,11 @@ void bios::setparams( const eosio::blockchain_parameters& params ) { set_blockchain_parameters( params ); } +void bios::setpparams( const std::vector& params ) { + require_auth( get_self() ); + set_parameters_packed( params.data(), params.size() ); +} + void bios::setkvparams( const eosio::kv_parameters& params ) { require_auth( get_self() ); set_kv_parameters( params );