From 30d3761c5a005b37c9a3040b0009323a3324c8ab Mon Sep 17 00:00:00 2001 From: larryk85 Date: Thu, 3 Dec 2020 12:58:59 -0500 Subject: [PATCH 1/2] update bios to have 'temporary' setpparams action --- .../contracts/eosio.bios/bin/eosio.bios.abi | 15 +++++++++++++++ .../contracts/eosio.bios/bin/eosio.bios.wasm | Bin 53130 -> 53355 bytes .../include/eosio.bios/eosio.bios.hpp | 10 +++++++++- .../contracts/eosio.bios/src/eosio.bios.cpp | 11 +++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) 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 ee60053ff3856ff709ffb529a526b80b15939519..758bef069b81b64812ef0ca912349e6b39b121b4 100755 GIT binary patch delta 4301 zcmdTHdsI|)`hNG`0cHk=i_$!Bklzf*!;$wx0|&SoKEkrLbj$VRl9Dl$5vgUFObO}Y zBjhUtpWqWv3%%qMjm*mRm8rS9o12}r+&yij9rxJboPB)1J3O>Hd-m-9wVX5Ge82Dg z`(D4HW`p!~lhi&Cq`Hty?Jn?vwq85~_Pd@dnKQk-xT5&!k~t+6&k;JKtYoGj<4a-; z&X(6nYhg8741;l)AuHKr2QV7qAkJp84YHXGws@1lB*`XOP6+&&0*FaAB$yI#sUiCp zTfY#@m4eE@f{kD(E-!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THgT;$C&2)b&);wD)fr@|GwoPO+#LsQU`E5j}`76otus@6N>;A`x7H#L!>g_|} zGi)F_a3zz%4)#sX(ZW+Us>MUJY)3L4Xo>3OZuD^}J9@By&X9!)`dWf|^(Nl+ zwfU~ENv{RGHTQ9!_HnkIT$;5r;5W?I-|tx8puSqWv9p9UQ+ExuE(W^B_U_^TzB_XC zjl`=ylCGEZQuvF>de@YABb1cGfg~t&Ak#8a|6?>j_wGO_6Iyv_-Miy?_rrSH{=cf` zsDafirAQ{~C-Hk+u^CR8m$Sn_XMkR4bO7sxCe!78=009%FYhU$5jyrPfSZ`R_ZDo% zw0%kcyWv~=s>yKJ{T$<`Y-)X14txc#>6Re~Vf2LSc3m7&h#f>vgbsa1 oP}KC9^C!=k{uG-(dCv67Gv~4CGoPCJ0=c+}*n+a 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..5e256b106a8 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. * 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 ); From af80ef6f3d8680d9e541af5bb785176d138f6f9a Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Thu, 3 Dec 2020 15:33:20 -0500 Subject: [PATCH 2/2] Almost for the action wrapper --- contracts/contracts/eosio.bios/include/eosio.bios/eosio.bios.hpp | 1 + 1 file changed, 1 insertion(+) 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 5e256b106a8..63b37d3e50a 100644 --- a/contracts/contracts/eosio.bios/include/eosio.bios/eosio.bios.hpp +++ b/contracts/contracts/eosio.bios/include/eosio.bios/eosio.bios.hpp @@ -291,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>;