assert_evaluator.cpp: Remove skip_unknown_predicate flag, add max_predicate_opcode check
This commit is contained in:
parent
548c760e46
commit
c43c71372d
2 changed files with 13 additions and 12 deletions
|
|
@ -45,6 +45,7 @@ void_result assert_evaluator::do_evaluate( const assert_operation& o )
|
||||||
{
|
{
|
||||||
const database& _db = db();
|
const database& _db = db();
|
||||||
uint32_t skip = _db.get_node_properties().skip_flags;
|
uint32_t skip = _db.get_node_properties().skip_flags;
|
||||||
|
auto max_predicate_opcode = _db.get_global_properties().parameters.max_predicate_opcode;
|
||||||
|
|
||||||
if( skip & database::skip_assert_evaluation )
|
if( skip & database::skip_assert_evaluation )
|
||||||
return void_result();
|
return void_result();
|
||||||
|
|
@ -53,14 +54,15 @@ void_result assert_evaluator::do_evaluate( const assert_operation& o )
|
||||||
{
|
{
|
||||||
fc::datastream<const char*> ds( pdata.data(), pdata.size() );
|
fc::datastream<const char*> ds( pdata.data(), pdata.size() );
|
||||||
predicate p;
|
predicate p;
|
||||||
try {
|
//
|
||||||
|
// FC_ASSERT deep in the bowels of static_variant implementation
|
||||||
|
// will trip if we get a predicate which isn't in our code's
|
||||||
|
// static_variant. This is desired behavior.
|
||||||
|
//
|
||||||
fc::raw::unpack( ds, p );
|
fc::raw::unpack( ds, p );
|
||||||
} catch ( const fc::exception& e )
|
|
||||||
{
|
FC_ASSERT( p.which() >= 0 );
|
||||||
if( skip & database::skip_unknown_predicate )
|
FC_ASSERT( unsigned(p.which()) < max_predicate_opcode );
|
||||||
continue;
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
FC_ASSERT( p.visit( predicate_visitor( _db ) ) );
|
FC_ASSERT( p.visit( predicate_visitor( _db ) ) );
|
||||||
}
|
}
|
||||||
return void_result();
|
return void_result();
|
||||||
|
|
|
||||||
|
|
@ -118,8 +118,7 @@ namespace graphene { namespace chain {
|
||||||
skip_tapos_check = 0x80, ///< used while reindexing -- note this skips expiration check as well
|
skip_tapos_check = 0x80, ///< used while reindexing -- note this skips expiration check as well
|
||||||
skip_authority_check = 0x100, ///< used while reindexing -- disables any checking of authority on transactions
|
skip_authority_check = 0x100, ///< used while reindexing -- disables any checking of authority on transactions
|
||||||
skip_merkle_check = 0x200, ///< used while reindexing
|
skip_merkle_check = 0x200, ///< used while reindexing
|
||||||
skip_assert_evaluation = 0x400, ///< used while reindexing
|
skip_assert_evaluation = 0x400 ///< used while reindexing
|
||||||
skip_unknown_predicate = 0x800 ///< used by non-witness nodes to allow unknown predicates
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void open(const fc::path& data_dir, const genesis_state_type& initial_allocation = genesis_state_type());
|
void open(const fc::path& data_dir, const genesis_state_type& initial_allocation = genesis_state_type());
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue