Remove unscheduled hardfork CORE 210

This commit is contained in:
serkixenos 2022-06-15 05:31:41 +02:00
parent f03cc7ee90
commit 092a46ae61
8 changed files with 15 additions and 33 deletions

View file

@ -82,8 +82,10 @@ build-testnet:
- build/tests/ - build/tests/
tags: tags:
- builder - builder
when: manual when:
timeout: 3h manual
timeout:
3h
test-testnet: test-testnet:
stage: test stage: test

View file

@ -811,7 +811,7 @@ processed_transaction database::_apply_transaction(const signed_transaction& trx
return get_account_custom_authorities(id, op); return get_account_custom_authorities(id, op);
}; };
trx.verify_authority( chain_id, get_active, get_owner, get_custom, trx.verify_authority( chain_id, get_active, get_owner, get_custom,
MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(head_block_time()), true,
get_global_properties().parameters.max_authority_depth ); get_global_properties().parameters.max_authority_depth );
} }

View file

@ -625,7 +625,6 @@ void database::notify_changed_objects()
if( _undo_db.enabled() ) if( _undo_db.enabled() )
{ {
const auto& head_undo = _undo_db.head(); const auto& head_undo = _undo_db.head();
auto chain_time = head_block_time();
// New // New
if( !new_objects.empty() ) if( !new_objects.empty() )
@ -637,8 +636,7 @@ void database::notify_changed_objects()
new_ids.push_back(item); new_ids.push_back(item);
auto obj = find_object(item); auto obj = find_object(item);
if(obj != nullptr) if(obj != nullptr)
get_relevant_accounts(obj, new_accounts_impacted, get_relevant_accounts(obj, new_accounts_impacted, true);
MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time));
} }
GRAPHENE_TRY_NOTIFY( new_objects, new_ids, new_accounts_impacted) GRAPHENE_TRY_NOTIFY( new_objects, new_ids, new_accounts_impacted)
@ -652,8 +650,7 @@ void database::notify_changed_objects()
for( const auto& item : head_undo.old_values ) for( const auto& item : head_undo.old_values )
{ {
changed_ids.push_back(item.first); changed_ids.push_back(item.first);
get_relevant_accounts(item.second.get(), changed_accounts_impacted, get_relevant_accounts(item.second.get(), changed_accounts_impacted, true);
MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time));
} }
GRAPHENE_TRY_NOTIFY( changed_objects, changed_ids, changed_accounts_impacted) GRAPHENE_TRY_NOTIFY( changed_objects, changed_ids, changed_accounts_impacted)
@ -670,8 +667,7 @@ void database::notify_changed_objects()
removed_ids.emplace_back( item.first ); removed_ids.emplace_back( item.first );
auto obj = item.second.get(); auto obj = item.second.get();
removed.emplace_back( obj ); removed.emplace_back( obj );
get_relevant_accounts(obj, removed_accounts_impacted, get_relevant_accounts(obj, removed_accounts_impacted, true);
MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time));
} }
GRAPHENE_TRY_NOTIFY( removed_objects, removed_ids, removed, removed_accounts_impacted) GRAPHENE_TRY_NOTIFY( removed_objects, removed_ids, removed, removed_accounts_impacted)

View file

@ -1,10 +0,0 @@
// #210 Check authorities on custom_operation
#ifndef HARDFORK_CORE_210_TIME
#ifdef BUILD_PEERPLAYS_TESTNET
#define HARDFORK_CORE_210_TIME (fc::time_point_sec::from_iso_string("2030-01-01T00:00:00")) // (Not yet scheduled)
#else
#define HARDFORK_CORE_210_TIME (fc::time_point_sec::from_iso_string("2030-01-01T00:00:00")) // (Not yet scheduled)
#endif
// Bugfix: pre-HF 210, custom_operation's required_auths field was ignored.
#define MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time) (chain_time <= HARDFORK_CORE_210_TIME)
#endif

View file

@ -302,8 +302,7 @@ void_result proposal_create_evaluator::do_evaluate( const proposal_create_operat
vector<authority> other; vector<authority> other;
for( auto& op : o.proposed_ops ) for( auto& op : o.proposed_ops )
{ {
operation_get_required_authorities( op.op, auths, auths, other, operation_get_required_authorities( op.op, auths, auths, other, true );
MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(block_time) );
} }
FC_ASSERT( other.size() == 0 ); // TODO: what about other??? FC_ASSERT( other.size() == 0 ); // TODO: what about other???
@ -352,8 +351,7 @@ object_id_type proposal_create_evaluator::do_apply( const proposal_create_operat
// TODO: consider caching values from evaluate? // TODO: consider caching values from evaluate?
for( auto& op : _proposed_trx.operations ) for( auto& op : _proposed_trx.operations )
operation_get_required_authorities( op, required_active, proposal.required_owner_approvals, other, operation_get_required_authorities( op, required_active, proposal.required_owner_approvals, other, true);
MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time) );
//All accounts which must provide both owner and active authority should be omitted from the active authority set; //All accounts which must provide both owner and active authority should be omitted from the active authority set;
//owner authority approval implies active authority approval. //owner authority approval implies active authority approval.

View file

@ -39,7 +39,7 @@ bool proposal_object::is_authorized_to_execute( database& db ) const
[&]( account_id_type id ){ return &id(db).owner; }, [&]( account_id_type id ){ return &id(db).owner; },
[&]( account_id_type id, const operation& op ){ [&]( account_id_type id, const operation& op ){
return db.get_account_custom_authorities(id, op); }, return db.get_account_custom_authorities(id, op); },
MUST_IGNORE_CUSTOM_OP_REQD_AUTHS( db.head_block_time() ), true,
db.get_global_properties().parameters.max_authority_depth, db.get_global_properties().parameters.max_authority_depth,
true, /* allow committee */ true, /* allow committee */
available_active_approvals, available_active_approvals,

View file

@ -126,14 +126,12 @@ void account_history_plugin_impl::update_account_histories( const signed_block&
flat_set<account_id_type> impacted; flat_set<account_id_type> impacted;
vector<authority> other; vector<authority> other;
// fee payer is added here // fee payer is added here
operation_get_required_authorities( op.op, impacted, impacted, other, operation_get_required_authorities( op.op, impacted, impacted, other, true );
MUST_IGNORE_CUSTOM_OP_REQD_AUTHS( db.head_block_time() ) );
if( op.op.which() == operation::tag< account_create_operation >::value ) if( op.op.which() == operation::tag< account_create_operation >::value )
impacted.insert( op.result.get<object_id_type>() ); impacted.insert( op.result.get<object_id_type>() );
else else
graphene::chain::operation_get_impacted_accounts( op.op, impacted, graphene::chain::operation_get_impacted_accounts( op.op, impacted, true );
MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(db.head_block_time()) );
if( op.op.which() == operation::tag< lottery_end_operation >::value ) if( op.op.which() == operation::tag< lottery_end_operation >::value )
{ {
auto lop = op.op.get< lottery_end_operation >(); auto lop = op.op.get< lottery_end_operation >();

View file

@ -173,14 +173,12 @@ bool elasticsearch_plugin_impl::update_account_histories( const signed_block& b
flat_set<account_id_type> impacted; flat_set<account_id_type> impacted;
vector<authority> other; vector<authority> other;
// fee_payer is added here // fee_payer is added here
operation_get_required_authorities( op.op, impacted, impacted, other, operation_get_required_authorities( op.op, impacted, impacted, other, true );
MUST_IGNORE_CUSTOM_OP_REQD_AUTHS( db.head_block_time() ) );
if( op.op.which() == operation::tag< account_create_operation >::value ) if( op.op.which() == operation::tag< account_create_operation >::value )
impacted.insert( op.result.get<object_id_type>() ); impacted.insert( op.result.get<object_id_type>() );
else else
operation_get_impacted_accounts( op.op, impacted, operation_get_impacted_accounts( op.op, impacted, true );
MUST_IGNORE_CUSTOM_OP_REQD_AUTHS( db.head_block_time() ) );
for( auto& a : other ) for( auto& a : other )
for( auto& item : a.account_auths ) for( auto& item : a.account_auths )