make max authority check depth configurable by delegates
This commit is contained in:
parent
d065984854
commit
46fae5cbbf
3 changed files with 4 additions and 33 deletions
|
|
@ -472,7 +472,7 @@ processed_transaction database::_apply_transaction(const signed_transaction& trx
|
|||
{
|
||||
auto get_active = [&]( account_id_type id ) { return &id(*this).active; };
|
||||
auto get_owner = [&]( account_id_type id ) { return &id(*this).owner; };
|
||||
trx.verify_authority( get_active, get_owner );
|
||||
trx.verify_authority( get_active, get_owner, get_global_properties().parameters.max_authority_depth );
|
||||
}
|
||||
|
||||
//Skip all manner of expiration and TaPoS checking if we're on block 1; It's impossible that the transaction is
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ namespace graphene { namespace chain {
|
|||
share_type fee_liquidation_threshold = GRAPHENE_DEFAULT_FEE_LIQUIDATION_THRESHOLD; ///< value in CORE at which accumulated fees in blockchain-issued market assets should be liquidated
|
||||
uint16_t accounts_per_fee_scale = GRAPHENE_DEFAULT_ACCOUNTS_PER_FEE_SCALE; ///< number of accounts between fee scalings
|
||||
uint8_t account_fee_scale_bitshifts = GRAPHENE_DEFAULT_ACCOUNT_FEE_SCALE_BITSHIFTS; ///< number of times to left bitshift account registration fee at each scaling
|
||||
uint8_t max_authority_depth = GRAPHENE_MAX_SIG_CHECK_DEPTH;
|
||||
extensions_type extensions;
|
||||
|
||||
void validate()const
|
||||
|
|
@ -127,5 +128,6 @@ FC_REFLECT( graphene::chain::chain_parameters,
|
|||
(fee_liquidation_threshold)
|
||||
(accounts_per_fee_scale)
|
||||
(account_fee_scale_bitshifts)
|
||||
(max_authority_depth)
|
||||
(extensions)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ bool proposal_object::is_authorized_to_execute(database& db) const
|
|||
available_key_approvals,
|
||||
[&]( account_id_type id ){ return &id(db).active; },
|
||||
[&]( account_id_type id ){ return &id(db).owner; },
|
||||
GRAPHENE_MAX_SIG_CHECK_DEPTH, // TODO make chain param
|
||||
db.get_global_properties().parameters.max_authority_depth,
|
||||
true, /* allow committeee */
|
||||
available_active_approvals,
|
||||
available_owner_approvals );
|
||||
|
|
@ -42,37 +42,6 @@ bool proposal_object::is_authorized_to_execute(database& db) const
|
|||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
|
||||
/*
|
||||
dry_run_eval._is_proposed_trx = true;
|
||||
std::transform(available_active_approvals.begin(), available_active_approvals.end(),
|
||||
std::inserter(dry_run_eval.approved_by, dry_run_eval.approved_by.end()), [](object_id_type id) {
|
||||
return make_pair(id, authority::active);
|
||||
});
|
||||
std::transform(available_owner_approvals.begin(), available_owner_approvals.end(),
|
||||
std::inserter(dry_run_eval.approved_by, dry_run_eval.approved_by.end()), [](object_id_type id) {
|
||||
return make_pair(id, authority::owner);
|
||||
});
|
||||
|
||||
signed_transaction tmp;
|
||||
dry_run_eval._trx = &tmp;
|
||||
|
||||
for( auto key_id : available_key_approvals )
|
||||
dry_run_eval._sigs.insert( std::make_pair(key_id,true) );
|
||||
|
||||
//insert into dry_run_eval->_trx.signatures
|
||||
//dry_run_eval.signed_by.insert(available_key_approvals.begin(), available_key_approvals.end());
|
||||
|
||||
// Check all required approvals. If any of them are unsatisfied, return false.
|
||||
for( const auto& id : required_active_approvals )
|
||||
if( !dry_run_eval.check_authority(id(db), authority::active) )
|
||||
return false;
|
||||
for( const auto& id : required_owner_approvals )
|
||||
if( !dry_run_eval.check_authority(id(db), authority::owner) )
|
||||
return false;
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue