Struct ckb_chain_spec::consensus::Consensus [−][src]
Struct Consensus defines various parameters that influence chain consensus
Fields
id: String
Names the network.
genesis_block: BlockView
The genesis block
genesis_hash: Byte32
The genesis block hash
dao_type_hash: Option<Byte32>
The dao type hash
secp256k1_blake160_sighash_all_type_hash: Option<Byte32>
The secp256k1_blake160_sighash_all_type_hash
secp256k1_blake160_multisig_all_type_hash: Option<Byte32>
The secp256k1_blake160_multisig_all_type_hash
initial_primary_epoch_reward: Capacity
The initial primary_epoch_reward
secondary_epoch_reward: Capacity
The secondary primary_epoch_reward
max_uncles_num: usize
The maximum amount of uncles allowed for a block
orphan_rate_target: RationalU256
The expected orphan_rate
epoch_duration_target: u64
The expected epoch_duration
tx_proposal_window: ProposalWindow
The two-step-transaction-confirmation proposal window
proposer_reward_ratio: Ratio
The two-step-transaction-confirmation proposer reward ratio
pow: Pow
The pow parameters
cellbase_maturity: EpochNumberWithFraction
The Cellbase maturity
For each input, if the referenced output transaction is cellbase,
it must have at least cellbase_maturity
confirmations;
else reject this transaction.
median_time_block_count: usize
This parameter indicates the count of past blocks used in the median time calculation
max_block_cycles: Cycle
Maximum cycles that all the scripts in all the commit transactions can take
max_block_bytes: u64
Maximum number of bytes to use for the entire block
block_version: Version
The block version number supported
tx_version: Version
The tx version number supported
type_id_code_hash: H256
The “TYPE_ID” in hex
max_block_proposals_limit: u64
The Limit to the number of proposals per block
genesis_epoch_ext: EpochExt
The genesis epoch information
satoshi_pubkey_hash: H160
Satoshi’s pubkey hash in Bitcoin genesis.
satoshi_cell_occupied_ratio: Ratio
Ratio of satoshi cell occupied of capacity, only affects genesis cellbase’s satoshi lock cells.
primary_epoch_reward_halving_interval: EpochNumber
Primary reward is cut in half every halving_interval epoch which will occur approximately every 4 years.
permanent_difficulty_in_dummy: bool
Keep difficulty be permanent if the pow is dummy
Implementations
impl Consensus
[src]
pub fn genesis_block(&self) -> &BlockView
[src]
The genesis block
pub fn proposer_reward_ratio(&self) -> Ratio
[src]
The two-step-transaction-confirmation proposer reward ratio
pub fn finalization_delay_length(&self) -> BlockNumber
[src]
The two-step-transaction-confirmation block reward delay length
pub fn finalize_target(&self, block_number: BlockNumber) -> Option<BlockNumber>
[src]
Get block reward finalize number from specified block number
pub fn genesis_hash(&self) -> Byte32
[src]
The genesis block hash
pub fn dao_type_hash(&self) -> Option<Byte32>
[src]
The dao type hash
pub fn secp256k1_blake160_sighash_all_type_hash(&self) -> Option<Byte32>
[src]
The secp256k1_blake160_sighash_all_type_hash
pub fn secp256k1_blake160_multisig_all_type_hash(&self) -> Option<Byte32>
[src]
The secp256k1_blake160_multisig_all_type_hash
pub fn max_uncles_num(&self) -> usize
[src]
The maximum amount of uncles allowed for a block
pub fn min_difficulty(&self) -> U256
[src]
The minimum difficulty (genesis_block difficulty)
pub fn initial_primary_epoch_reward(&self) -> Capacity
[src]
The minimum difficulty (genesis_block difficulty)
pub fn primary_epoch_reward(&self, epoch_number: u64) -> Capacity
[src]
The initial primary_epoch_reward
pub fn primary_epoch_reward_halving_interval(&self) -> EpochNumber
[src]
Primary reward is cut in half every halving_interval epoch which will occur approximately every 4 years.
pub fn epoch_duration_target(&self) -> u64
[src]
The expected epoch_duration
pub fn genesis_epoch_ext(&self) -> &EpochExt
[src]
The genesis epoch information
pub fn max_epoch_length(&self) -> BlockNumber
[src]
The maximum epoch length
pub fn min_epoch_length(&self) -> BlockNumber
[src]
The minimum epoch length
pub fn secondary_epoch_reward(&self) -> Capacity
[src]
The secondary primary_epoch_reward
pub fn orphan_rate_target(&self) -> &RationalU256
[src]
The expected orphan_rate
pub fn pow_engine(&self) -> Arc<dyn PowEngine>
[src]
The pow_engine
pub fn permanent_difficulty(&self) -> bool
[src]
The permanent_difficulty mode
pub fn cellbase_maturity(&self) -> EpochNumberWithFraction
[src]
The cellbase_maturity
pub fn median_time_block_count(&self) -> usize
[src]
This parameter indicates the count of past blocks used in the median time calculation
pub fn max_block_cycles(&self) -> Cycle
[src]
Maximum cycles that all the scripts in all the commit transactions can take
pub fn max_block_bytes(&self) -> u64
[src]
Maximum number of bytes to use for the entire block
pub fn max_block_proposals_limit(&self) -> u64
[src]
The Limit to the number of proposals per block
pub fn block_version(&self) -> Version
[src]
The current block version
pub fn tx_version(&self) -> Version
[src]
The current transaction version
pub fn type_id_code_hash(&self) -> &H256
[src]
The “TYPE_ID” in hex
pub fn tx_proposal_window(&self) -> ProposalWindow
[src]
The two-step-transaction-confirmation proposal window
pub fn next_epoch_ext<A, B>(
&self,
last_epoch: &EpochExt,
header: &HeaderView,
get_block_header: A,
total_uncles_count: B
) -> Option<EpochExt> where
A: Fn(&Byte32) -> Option<HeaderView>,
B: Fn(&Byte32) -> Option<u64>,
[src]
&self,
last_epoch: &EpochExt,
header: &HeaderView,
get_block_header: A,
total_uncles_count: B
) -> Option<EpochExt> where
A: Fn(&Byte32) -> Option<HeaderView>,
B: Fn(&Byte32) -> Option<u64>,
The dynamic-difficulty-adjustment-mechanism implementation
pub fn identify_name(&self) -> String
[src]
The network identify name, used for network identify protocol
pub fn get_secp_type_script_hash(&self) -> Byte32
[src]
The secp256k1_blake160_sighash_all code hash
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Consensus
impl Send for Consensus
impl Sync for Consensus
impl Unpin for Consensus
impl UnwindSafe for Consensus
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsAny for T where
T: Any,
[src]
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,