Remove secret hashes from witnesses

This commit is contained in:
theoreticalbts 2015-08-26 17:38:03 -04:00
parent 695978cfa1
commit 59a3ca32b7
9 changed files with 1 additions and 21 deletions

View file

@ -555,7 +555,6 @@ void database::init_genesis(const genesis_state_type& genesis_state)
witness_create_operation op; witness_create_operation op;
op.witness_account = get_account_id(witness.owner_name); op.witness_account = get_account_id(witness.owner_name);
op.block_signing_key = witness.block_signing_key; op.block_signing_key = witness.block_signing_key;
op.initial_secret = secret_hash_type::hash( secret_hash_type() );
apply_operation(genesis_eval_state, op); apply_operation(genesis_eval_state, op);
}); });

View file

@ -92,7 +92,6 @@ fc::variant_object get_config()
result[ "GRAPHENE_MAX_URL_LENGTH" ] = GRAPHENE_MAX_URL_LENGTH; result[ "GRAPHENE_MAX_URL_LENGTH" ] = GRAPHENE_MAX_URL_LENGTH;
result[ "GRAPHENE_NEAR_SCHEDULE_CTR_IV" ] = GRAPHENE_NEAR_SCHEDULE_CTR_IV; result[ "GRAPHENE_NEAR_SCHEDULE_CTR_IV" ] = GRAPHENE_NEAR_SCHEDULE_CTR_IV;
result[ "GRAPHENE_FAR_SCHEDULE_CTR_IV" ] = GRAPHENE_FAR_SCHEDULE_CTR_IV; result[ "GRAPHENE_FAR_SCHEDULE_CTR_IV" ] = GRAPHENE_FAR_SCHEDULE_CTR_IV;
result[ "GRAPHENE_RNG_SEED_LENGTH" ] = GRAPHENE_RNG_SEED_LENGTH;
result[ "GRAPHENE_CORE_ASSET_CYCLE_RATE" ] = GRAPHENE_CORE_ASSET_CYCLE_RATE; result[ "GRAPHENE_CORE_ASSET_CYCLE_RATE" ] = GRAPHENE_CORE_ASSET_CYCLE_RATE;
result[ "GRAPHENE_CORE_ASSET_CYCLE_RATE_BITS" ] = GRAPHENE_CORE_ASSET_CYCLE_RATE_BITS; result[ "GRAPHENE_CORE_ASSET_CYCLE_RATE_BITS" ] = GRAPHENE_CORE_ASSET_CYCLE_RATE_BITS;
result[ "GRAPHENE_DEFAULT_WITNESS_PAY_PER_BLOCK" ] = GRAPHENE_DEFAULT_WITNESS_PAY_PER_BLOCK; result[ "GRAPHENE_DEFAULT_WITNESS_PAY_PER_BLOCK" ] = GRAPHENE_DEFAULT_WITNESS_PAY_PER_BLOCK;

View file

@ -122,10 +122,6 @@
| (uint64_t( 0x84ca ) << 0x10) \ | (uint64_t( 0x84ca ) << 0x10) \
| (uint64_t( 0xa73b ) ) ) | (uint64_t( 0xa73b ) ) )
// counter used to determine bits of entropy
// must be less than or equal to secret_hash_type::data_length()
#define GRAPHENE_RNG_SEED_LENGTH (160 / 8)
/** /**
* every second, the fraction of burned core asset which cycles is * every second, the fraction of burned core asset which cycles is
* GRAPHENE_CORE_ASSET_CYCLE_RATE / (1 << GRAPHENE_CORE_ASSET_CYCLE_RATE_BITS) * GRAPHENE_CORE_ASSET_CYCLE_RATE / (1 << GRAPHENE_CORE_ASSET_CYCLE_RATE_BITS)

View file

@ -216,7 +216,6 @@ namespace graphene { namespace chain {
typedef fc::sha256 digest_type; typedef fc::sha256 digest_type;
typedef fc::ecc::compact_signature signature_type; typedef fc::ecc::compact_signature signature_type;
typedef safe<int64_t> share_type; typedef safe<int64_t> share_type;
typedef fc::ripemd160 secret_hash_type;
typedef uint16_t weight_type; typedef uint16_t weight_type;
struct public_key_type struct public_key_type

View file

@ -19,7 +19,6 @@ namespace graphene { namespace chain {
account_id_type witness_account; account_id_type witness_account;
string url; string url;
public_key_type block_signing_key; public_key_type block_signing_key;
secret_hash_type initial_secret;
account_id_type fee_payer()const { return witness_account; } account_id_type fee_payer()const { return witness_account; }
void validate()const; void validate()const;
@ -55,7 +54,7 @@ namespace graphene { namespace chain {
} } // graphene::chain } } // graphene::chain
FC_REFLECT( graphene::chain::witness_create_operation::fee_parameters_type, (fee) ) FC_REFLECT( graphene::chain::witness_create_operation::fee_parameters_type, (fee) )
FC_REFLECT( graphene::chain::witness_create_operation, (fee)(witness_account)(url)(block_signing_key)(initial_secret) ) FC_REFLECT( graphene::chain::witness_create_operation, (fee)(witness_account)(url)(block_signing_key) )
FC_REFLECT( graphene::chain::witness_update_operation::fee_parameters_type, (fee) ) FC_REFLECT( graphene::chain::witness_update_operation::fee_parameters_type, (fee) )
FC_REFLECT( graphene::chain::witness_update_operation, (fee)(witness)(witness_account)(new_url)(new_signing_key) ) FC_REFLECT( graphene::chain::witness_update_operation, (fee)(witness)(witness_account)(new_url)(new_signing_key) )

View file

@ -34,8 +34,6 @@ namespace graphene { namespace chain {
account_id_type witness_account; account_id_type witness_account;
uint64_t last_aslot = 0; uint64_t last_aslot = 0;
public_key_type signing_key; public_key_type signing_key;
secret_hash_type next_secret_hash;
secret_hash_type previous_secret;
optional< vesting_balance_id_type > pay_vb; optional< vesting_balance_id_type > pay_vb;
vote_id_type vote_id; vote_id_type vote_id;
uint64_t total_votes = 0; uint64_t total_votes = 0;

View file

@ -40,7 +40,6 @@ object_id_type witness_create_evaluator::do_apply( const witness_create_operatio
const auto& new_witness_object = db().create<witness_object>( [&]( witness_object& obj ){ const auto& new_witness_object = db().create<witness_object>( [&]( witness_object& obj ){
obj.witness_account = op.witness_account; obj.witness_account = op.witness_account;
obj.signing_key = op.block_signing_key; obj.signing_key = op.block_signing_key;
obj.next_secret_hash = op.initial_secret;
obj.vote_id = vote_id; obj.vote_id = vote_id;
obj.url = op.url; obj.url = op.url;
}); });

View file

@ -1317,11 +1317,6 @@ public:
witness_create_op.witness_account = witness_account.id; witness_create_op.witness_account = witness_account.id;
witness_create_op.block_signing_key = witness_public_key; witness_create_op.block_signing_key = witness_public_key;
witness_create_op.url = url; witness_create_op.url = url;
secret_hash_type::encoder enc;
fc::raw::pack(enc, witness_private_key);
fc::raw::pack(enc, secret_hash_type());
witness_create_op.initial_secret = secret_hash_type::hash(enc.result());
if (_remote_db->get_witness_by_account(witness_create_op.witness_account)) if (_remote_db->get_witness_by_account(witness_create_op.witness_account))
FC_THROW("Account ${owner_account} is already a witness", ("owner_account", owner_account)); FC_THROW("Account ${owner_account} is already a witness", ("owner_account", owner_account));

View file

@ -593,10 +593,6 @@ const witness_object& database_fixture::create_witness( const account_object& ow
witness_create_operation op; witness_create_operation op;
op.witness_account = owner.id; op.witness_account = owner.id;
op.block_signing_key = signing_private_key.get_public_key(); op.block_signing_key = signing_private_key.get_public_key();
secret_hash_type::encoder enc;
fc::raw::pack(enc, signing_private_key);
fc::raw::pack(enc, secret_hash_type());
op.initial_secret = secret_hash_type::hash(enc.result());
trx.operations.push_back(op); trx.operations.push_back(op);
trx.validate(); trx.validate();
processed_transaction ptx = db.push_transaction(trx, ~0); processed_transaction ptx = db.push_transaction(trx, ~0);