Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
implement FORWARD_SETCODE protocol feature #6988
Browse files Browse the repository at this point in the history
  • Loading branch information
arhag committed Apr 11, 2019
1 parent bc9e0e5 commit a91d041
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
10 changes: 7 additions & 3 deletions libraries/chain/apply_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,13 @@ void apply_context::exec_one()
(*native)( *this );
}

if( a.code.size() > 0
&& !(act->account == config::system_account_name && act->name == N( setcode ) &&
receiver == config::system_account_name) ) {
if( (a.code.size() > 0) &&
( control.is_builtin_activated( builtin_protocol_feature_t::forward_setcode )
|| !( act->account == config::system_account_name
&& act->name == N( setcode )
&& receiver == config::system_account_name )
)
) {
if( trx_context.enforce_whiteblacklist && control.is_producing_block() ) {
control.check_contract_list( receiver );
control.check_action_list( act->account, act->name );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ enum class builtin_protocol_feature_t : uint32_t {
fix_linkauth_restriction,
disallow_empty_producer_schedule,
restrict_action_to_self,
only_bill_first_authorizer
only_bill_first_authorizer,
forward_setcode
};

struct protocol_feature_subjective_restrictions {
Expand Down
11 changes: 11 additions & 0 deletions libraries/chain/protocol_feature_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ This protocol feature removes that bypass.
Builtin protocol feature: ONLY_BILL_FIRST_AUTHORIZER
Adds CPU and network bandwidth usage to only the first authorizer of a transaction.
*/
{}
} )
( builtin_protocol_feature_t::forward_setcode, builtin_protocol_feature_spec{
"FORWARD_SETCODE",
fc::variant("898082c59f921d0042e581f00a59d5ceb8be6f1d9c7a45b6f07c0e26eaee0222").as<digest_type>(),
// SHA256 hash of the raw message below within the comment delimiters (do not modify message below).
/*
Builtin protocol feature: FORWARD_SETCODE
Forward eosio::setcode actions to the WebAssembly code deployed on the eosio account.
*/
{}
} )
Expand Down

0 comments on commit a91d041

Please sign in to comment.