Struct ckb_jsonrpc_types::BlockTemplate
source · [−]pub struct BlockTemplate {Show 16 fields
pub version: Version,
pub compact_target: Uint32,
pub current_time: Timestamp,
pub number: BlockNumber,
pub epoch: EpochNumberWithFraction,
pub parent_hash: H256,
pub cycles_limit: Cycle,
pub bytes_limit: Uint64,
pub uncles_count_limit: Uint64,
pub uncles: Vec<UncleTemplate>,
pub transactions: Vec<TransactionTemplate>,
pub proposals: Vec<ProposalShortId>,
pub cellbase: CellbaseTemplate,
pub work_id: Uint64,
pub dao: Byte32,
pub extension: Option<JsonBytes>,
}Expand description
A block template for miners.
Miners optional pick transactions and then assemble the final block.
Fields
version: VersionBlock version.
Miners must use it unchanged in the assembled block.
compact_target: Uint32The compacted difficulty target for the new block.
Miners must use it unchanged in the assembled block.
current_time: TimestampThe timestamp for the new block.
CKB node guarantees that this timestamp is larger than the median of the previous 37 blocks.
Miners can increase it to the current time. It is not recommended to decrease it, since it may violate the median block timestamp consensus rule.
number: BlockNumberThe block number for the new block.
Miners must use it unchanged in the assembled block.
epoch: EpochNumberWithFractionThe epoch progress information for the new block.
Miners must use it unchanged in the assembled block.
parent_hash: H256The parent block hash of the new block.
Miners must use it unchanged in the assembled block.
cycles_limit: CycleThe cycles limit.
Miners must keep the total cycles below this limit, otherwise, the CKB node will reject the block submission.
It is guaranteed that the block does not exceed the limit if miners do not add new transactions to the block.
bytes_limit: Uint64The block serialized size limit.
Miners must keep the block size below this limit, otherwise, the CKB node will reject the block submission.
It is guaranteed that the block does not exceed the limit if miners do not add new transaction commitments.
uncles_count_limit: Uint64The uncle count limit.
Miners must keep the uncles count below this limit, otherwise, the CKB node will reject the block submission.
uncles: Vec<UncleTemplate>Provided valid uncle blocks candidates for the new block.
Miners must include the uncles marked as required in the assembled new block.
transactions: Vec<TransactionTemplate>Provided valid transactions which can be committed in the new block.
Miners must include the transactions marked as required in the assembled new block.
proposals: Vec<ProposalShortId>Provided proposal ids list of transactions for the new block.
cellbase: CellbaseTemplateProvided cellbase transaction template.
Miners must use it as the cellbase transaction without changes in the assembled block.
work_id: Uint64Work ID. The miner must submit the new assembled and resolved block using the same work ID.
dao: Byte32Reference DAO field.
This field is only valid when miners use all and only use the provided transactions in the template. Two fields must be updated when miners want to select transactions:
S_i, bytes 16 to 23U_i, bytes 24 to 31
See RFC Deposit and Withdraw in Nervos DAO.
extension: Option<JsonBytes>The extension for the new block.
This field is optional. It’s a reserved field, please leave it blank. More details can be found in CKB RFC 0031.
Trait Implementations
sourceimpl Clone for BlockTemplate
impl Clone for BlockTemplate
sourcefn clone(&self) -> BlockTemplate
fn clone(&self) -> BlockTemplate
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for BlockTemplate
impl Debug for BlockTemplate
sourceimpl Default for BlockTemplate
impl Default for BlockTemplate
sourcefn default() -> BlockTemplate
fn default() -> BlockTemplate
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for BlockTemplate
impl<'de> Deserialize<'de> for BlockTemplate
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<BlockTemplate> for Block
impl From<BlockTemplate> for Block
sourcefn from(block_template: BlockTemplate) -> Block
fn from(block_template: BlockTemplate) -> Block
Performs the conversion.
sourceimpl Hash for BlockTemplate
impl Hash for BlockTemplate
sourceimpl PartialEq<BlockTemplate> for BlockTemplate
impl PartialEq<BlockTemplate> for BlockTemplate
sourcefn eq(&self, other: &BlockTemplate) -> bool
fn eq(&self, other: &BlockTemplate) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &BlockTemplate) -> bool
fn ne(&self, other: &BlockTemplate) -> bool
This method tests for !=.
sourceimpl Serialize for BlockTemplate
impl Serialize for BlockTemplate
impl Eq for BlockTemplate
impl StructuralEq for BlockTemplate
impl StructuralPartialEq for BlockTemplate
Auto Trait Implementations
impl RefUnwindSafe for BlockTemplate
impl Send for BlockTemplate
impl Sync for BlockTemplate
impl Unpin for BlockTemplate
impl UnwindSafe for BlockTemplate
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more