diff --git a/libraries/chain/include/graphene/chain/config.hpp b/libraries/chain/include/graphene/chain/config.hpp index 6e56ecbf..33ae226c 100644 --- a/libraries/chain/include/graphene/chain/config.hpp +++ b/libraries/chain/include/graphene/chain/config.hpp @@ -86,7 +86,7 @@ #define GRAPHENE_DEFAULT_MAX_WITNESSES (1001) // SHOULD BE ODD #define GRAPHENE_DEFAULT_MAX_COMMITTEE (1001) // SHOULD BE ODD #define GRAPHENE_DEFAULT_MAX_PROPOSAL_LIFETIME_SEC (60*60*24*7*4) // Four weeks -#define GRAPHENE_DEFAULT_GENESIS_PROPOSAL_REVIEW_PERIOD_SEC (60*60*24*7*2) // Two weeks +#define GRAPHENE_DEFAULT_COMMITTEE_PROPOSAL_REVIEW_PERIOD_SEC (60*60*24*7*2) // Two weeks #define GRAPHENE_DEFAULT_NETWORK_PERCENT_OF_FEE (20*GRAPHENE_1_PERCENT) #define GRAPHENE_DEFAULT_LIFETIME_REFERRER_PERCENT_OF_FEE (30*GRAPHENE_1_PERCENT) #define GRAPHENE_DEFAULT_MAX_BULK_DISCOUNT_PERCENT (50*GRAPHENE_1_PERCENT) @@ -139,7 +139,7 @@ * Reserved Account IDs with special meaning */ ///@{ -/// Represents the current committee members, two-week review period (GRAPHENE_DEFAULT_GENESIS_PROPOSAL_REVIEW_PERIOD_SEC) +/// Represents the current committee members, two-week review period #define GRAPHENE_COMMITTEE_ACCOUNT (graphene::chain::account_id_type(0)) /// Represents the current witnesses #define GRAPHENE_WITNESS_ACCOUNT (graphene::chain::account_id_type(1)) diff --git a/libraries/chain/include/graphene/chain/genesis_state.hpp b/libraries/chain/include/graphene/chain/genesis_state.hpp index 15b4f5e9..16d95d59 100644 --- a/libraries/chain/include/graphene/chain/genesis_state.hpp +++ b/libraries/chain/include/graphene/chain/genesis_state.hpp @@ -85,16 +85,16 @@ struct genesis_state_type { share_type daily_pay; }; - chain_parameters initial_parameters; - vector initial_accounts; - vector initial_assets; - vector initial_balances; - vector initial_vesting_balances; - int initial_active_witnesses = GRAPHENE_DEFAULT_NUM_WITNESSES; - vector initial_witness_candidates; - // These are only candidates; the chain will have no active committee members at genesis - vector initial_committee_candidates; - vector initial_worker_candidates; + time_point_sec initial_timestamp; + chain_parameters initial_parameters; + vector initial_accounts; + vector initial_assets; + vector initial_balances; + vector initial_vesting_balances; + int initial_active_witnesses = GRAPHENE_DEFAULT_NUM_WITNESSES; + vector initial_witness_candidates; + vector initial_committee_candidates; + vector initial_worker_candidates; }; } } // namespace graphene::chain diff --git a/libraries/chain/include/graphene/chain/types.hpp b/libraries/chain/include/graphene/chain/types.hpp index 9c7fcbef..cd9a9d2f 100644 --- a/libraries/chain/include/graphene/chain/types.hpp +++ b/libraries/chain/include/graphene/chain/types.hpp @@ -448,7 +448,7 @@ namespace graphene { namespace chain { fee_schedule_type current_fees; ///< current schedule of fees uint8_t block_interval = GRAPHENE_DEFAULT_BLOCK_INTERVAL; ///< interval in seconds between blocks uint32_t maintenance_interval = GRAPHENE_DEFAULT_MAINTENANCE_INTERVAL; ///< interval in sections between blockchain maintenance events - uint32_t genesis_proposal_review_period = GRAPHENE_DEFAULT_GENESIS_PROPOSAL_REVIEW_PERIOD_SEC; ///< minimum time in seconds that a proposed transaction requiring genesis authority may not be signed, prior to expiration + uint32_t committee_proposal_review_period = GRAPHENE_DEFAULT_COMMITTEE_PROPOSAL_REVIEW_PERIOD_SEC; ///< minimum time in seconds that a proposed transaction requiring committee authority may not be signed, prior to expiration uint32_t maximum_transaction_size = GRAPHENE_DEFAULT_MAX_TRANSACTION_SIZE; ///< maximum allowable size in bytes for a transaction uint32_t maximum_block_size = GRAPHENE_DEFAULT_MAX_BLOCK_SIZE; ///< maximum allowable size in bytes for a block uint32_t maximum_undo_history = GRAPHENE_DEFAULT_MAX_UNDO_HISTORY; ///< maximum number of undo states to keep in RAM @@ -499,8 +499,8 @@ namespace graphene { namespace chain { "Block size limit is too low" ); FC_ASSERT( maximum_time_until_expiration > block_interval, "Maximum transaction expiration time must be greater than a block interval" ); - FC_ASSERT( maximum_proposal_lifetime - genesis_proposal_review_period > block_interval, - "Genesis proposal review period must be less than the maximum proposal lifetime" ); + FC_ASSERT( maximum_proposal_lifetime - committee_proposal_review_period > block_interval, + "Committee proposal review period must be less than the maximum proposal lifetime" ); } }; @@ -615,7 +615,7 @@ FC_REFLECT( graphene::chain::chain_parameters, (current_fees) (block_interval) (maintenance_interval) - (genesis_proposal_review_period) + (committee_proposal_review_period) (maximum_transaction_size) (maximum_block_size) (maximum_undo_history) diff --git a/libraries/chain/operations.cpp b/libraries/chain/operations.cpp index 002f2313..bd9ed86c 100644 --- a/libraries/chain/operations.cpp +++ b/libraries/chain/operations.cpp @@ -457,7 +457,7 @@ proposal_create_operation proposal_create_operation::genesis_proposal(const data auto global_params = db.get_global_properties().parameters; proposal_create_operation op = {account_id_type(), asset(), {}, db.head_block_time() + global_params.maximum_proposal_lifetime, - global_params.genesis_proposal_review_period}; + global_params.committee_proposal_review_period}; op.fee = op.calculate_fee(global_params.current_fees); return op; } @@ -859,11 +859,11 @@ struct required_active_visitor /** for most operations this is just the fee payer */ template - void operator()(const T& o)const - { + void operator()(const T& o)const + { result.insert( o.fee_payer() ); } - void operator()(const account_update_operation& o)const + void operator()(const account_update_operation& o)const { /// if owner authority is required, no active authority is required if( !(o.owner || o.active) ) /// TODO: document why active cannot be updated by active? @@ -906,7 +906,7 @@ struct required_owner_visitor template void operator()(const T& o)const {} - void operator()(const account_update_operation& o)const + void operator()(const account_update_operation& o)const { if( o.owner || o.active ) /// TODO: document why active cannot be updated by active? result.insert( o.account ); diff --git a/libraries/chain/proposal_evaluator.cpp b/libraries/chain/proposal_evaluator.cpp index 535bf354..7ff90a20 100644 --- a/libraries/chain/proposal_evaluator.cpp +++ b/libraries/chain/proposal_evaluator.cpp @@ -42,7 +42,7 @@ void_result proposal_create_evaluator::do_evaluate(const proposal_create_operati } if( auths.find(account_id_type()) != auths.end() ) FC_ASSERT( o.review_period_seconds - && *o.review_period_seconds >= global_parameters.genesis_proposal_review_period ); + && *o.review_period_seconds >= global_parameters.committee_proposal_review_period ); } for( const op_wrapper& op : o.proposed_ops ) diff --git a/tests/intense/block_tests.cpp b/tests/intense/block_tests.cpp index 212267a5..db8209e3 100644 --- a/tests/intense/block_tests.cpp +++ b/tests/intense/block_tests.cpp @@ -72,7 +72,7 @@ BOOST_FIXTURE_TEST_CASE( update_account_keys, database_fixture ) generate_block( skip_flags ); db.modify(db.get_global_properties(), [](global_property_object& p) { - p.parameters.genesis_proposal_review_period = fc::hours(1).to_seconds(); + p.parameters.committee_proposal_review_period = fc::hours(1).to_seconds(); }); transaction tx; diff --git a/tests/tests/authority_tests.cpp b/tests/tests/authority_tests.cpp index d0dc5436..47f9a246 100644 --- a/tests/tests/authority_tests.cpp +++ b/tests/tests/authority_tests.cpp @@ -366,7 +366,7 @@ BOOST_AUTO_TEST_CASE( genesis_authority ) // Signatures are for suckers. db.modify(db.get_global_properties(), [](global_property_object& p) { // Turn the review period WAY down, so it doesn't take long to produce blocks to that point in simulated time. - p.parameters.genesis_proposal_review_period = fc::days(1).to_seconds(); + p.parameters.committee_proposal_review_period = fc::days(1).to_seconds(); }); BOOST_TEST_MESSAGE( "transfering 100000 CORE to nathan, signing with genesis key" ); @@ -378,19 +378,19 @@ BOOST_AUTO_TEST_CASE( genesis_authority ) proposal_create_operation pop; pop.proposed_ops.push_back({trx.operations.front()}); - pop.expiration_time = db.head_block_time() + global_params.genesis_proposal_review_period*2; + pop.expiration_time = db.head_block_time() + global_params.committee_proposal_review_period*2; pop.fee_paying_account = nathan.id; trx.operations = {pop}; sign(); // The review period isn't set yet. Make sure it throws. BOOST_REQUIRE_THROW( PUSH_TX( db, trx ), fc::exception ); - pop.review_period_seconds = global_params.genesis_proposal_review_period / 2; + pop.review_period_seconds = global_params.committee_proposal_review_period / 2; trx.operations.back() = pop; sign(); // The review period is too short. Make sure it throws. BOOST_REQUIRE_THROW( PUSH_TX( db, trx ), fc::exception ); - pop.review_period_seconds = global_params.genesis_proposal_review_period; + pop.review_period_seconds = global_params.committee_proposal_review_period; trx.operations.back() = pop; sign(); proposal_object prop = db.get(PUSH_TX( db, trx ).operation_results.front().get()); @@ -405,7 +405,7 @@ BOOST_AUTO_TEST_CASE( genesis_authority ) generate_block(); BOOST_REQUIRE(db.find_object(prop.id)); BOOST_CHECK_EQUAL(get_balance(nathan, asset_id_type()(db)), 0); - + BOOST_TEST_MESSAGE( "Checking that the proposal is not authorized to execute" ); BOOST_REQUIRE(!db.get(prop.id).is_authorized_to_execute(db)); trx.operations.clear(); @@ -456,7 +456,7 @@ BOOST_FIXTURE_TEST_CASE( fired_delegates, database_fixture ) db.modify(db.get_global_properties(), [](global_property_object& p) { // Turn the review period WAY down, so it doesn't take long to produce blocks to that point in simulated time. - p.parameters.genesis_proposal_review_period = fc::days(1).to_seconds(); + p.parameters.committee_proposal_review_period = fc::days(1).to_seconds(); }); for( int i = 0; i < 15; ++i ) @@ -840,7 +840,7 @@ BOOST_FIXTURE_TEST_CASE( max_authority_membership, database_fixture ) generate_block(); db.modify(db.get_global_properties(), [](global_property_object& p) { - p.parameters.genesis_proposal_review_period = fc::hours(1).to_seconds(); + p.parameters.committee_proposal_review_period = fc::hours(1).to_seconds(); }); transaction tx; diff --git a/tests/tests/block_tests.cpp b/tests/tests/block_tests.cpp index 43a72e89..ce3a5655 100644 --- a/tests/tests/block_tests.cpp +++ b/tests/tests/block_tests.cpp @@ -622,7 +622,7 @@ BOOST_FIXTURE_TEST_CASE( change_block_interval, database_fixture ) generate_block(); db.modify(db.get_global_properties(), [](global_property_object& p) { - p.parameters.genesis_proposal_review_period = fc::hours(1).to_seconds(); + p.parameters.committee_proposal_review_period = fc::hours(1).to_seconds(); }); { @@ -829,7 +829,7 @@ BOOST_FIXTURE_TEST_CASE( pop_block_twice, database_fixture ) generate_block( skip_flags ); db.modify(db.get_global_properties(), [](global_property_object& p) { - p.parameters.genesis_proposal_review_period = fc::hours(1).to_seconds(); + p.parameters.committee_proposal_review_period = fc::hours(1).to_seconds(); }); transaction tx;