Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::chain::transaction_header Struct Reference

#include <transaction.hpp>

Inheritance diagram for sysio::chain::transaction_header:
Collaboration diagram for sysio::chain::transaction_header:

Public Member Functions

block_num_type get_ref_blocknum (block_num_type head_blocknum) const
 number of seconds to delay this transaction for during which it may be canceled.
 
void set_reference_block (const block_id_type &reference_block)
 
bool verify_reference_block (const block_id_type &reference_block) const
 
void validate () const
 

Public Attributes

time_point_sec expiration
 the time at which a transaction expires
 
uint16_t ref_block_num = 0U
 specifies a block num in the last 2^16 blocks.
 
uint32_t ref_block_prefix = 0UL
 specifies the lower 32 bits of the blockid at get_ref_blocknum
 
fc::unsigned_int max_net_usage_words = 0UL
 
uint8_t max_cpu_usage_ms = 0
 upper limit on total network bandwidth (in 8 byte words) billed for this transaction
 
fc::unsigned_int delay_sec = 0UL
 upper limit on the total CPU time billed for this transaction
 

Detailed Description

The transaction header contains the fixed-sized data associated with each transaction. It is separated from the transaction body to facilitate partial parsing of transactions without requiring dynamic memory allocation.

All transactions have an expiration time after which they may no longer be included in the blockchain. Once a block with a block_header::timestamp greater than expiration is deemed irreversible, then a user can safely trust the transaction will never be included.

Each region is an independent blockchain, it is included as routing information for inter-blockchain communication. A contract in this region might generate or authorize a transaction intended for a foreign region.

Definition at line 59 of file transaction.hpp.

Member Function Documentation

◆ get_ref_blocknum()

block_num_type sysio::chain::transaction_header::get_ref_blocknum ( block_num_type head_blocknum) const
inline
Returns
the absolute block number given the relative ref_block_num

Definition at line 70 of file transaction.hpp.

70 {
71 return ((head_blocknum/0xffff)*0xffff) + head_blocknum%0xffff;
72 }

◆ set_reference_block()

void sysio::chain::transaction_header::set_reference_block ( const block_id_type & reference_block)

Definition at line 26 of file transaction.cpp.

26 {
27 ref_block_num = fc::endian_reverse_u32(reference_block._hash[0]);
28 ref_block_prefix = reference_block._hash[1];
29}
uint32_t endian_reverse_u32(uint32_t x)
Definition bitutil.hpp:19
uint16_t ref_block_num
specifies a block num in the last 2^16 blocks.
uint32_t ref_block_prefix
specifies the lower 32 bits of the blockid at get_ref_blocknum
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate()

void sysio::chain::transaction_header::validate ( ) const

Definition at line 36 of file transaction.cpp.

36 {
38 "declared max_net_usage_words overflows when expanded to max net usage" );
39}
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
Definition exceptions.hpp:7
key Invalid authority Invalid transaction Invalid block ID Invalid packed transaction Invalid chain ID Invalid symbol Signature type is not a currently activated type Block can not be found Unlinkable block Block does not guarantee concurrent execution without conflicts Block exhausted allowed resources Block is from the future Block is not signed by expected producer Block includes an ill formed protocol feature activation extension Block includes an ill formed additional block signature extension transaction_exception
#define UINT32_MAX
Definition stdint.h:188
uint32_t value
Definition varint.hpp:17

◆ verify_reference_block()

bool sysio::chain::transaction_header::verify_reference_block ( const block_id_type & reference_block) const

Definition at line 31 of file transaction.cpp.

31 {
32 return ref_block_num == (decltype(ref_block_num))fc::endian_reverse_u32(reference_block._hash[0]) &&
33 ref_block_prefix == (decltype(ref_block_prefix))reference_block._hash[1];
34}
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ delay_sec

fc::unsigned_int sysio::chain::transaction_header::delay_sec = 0UL

Definition at line 65 of file transaction.hpp.

◆ expiration

time_point_sec sysio::chain::transaction_header::expiration

Definition at line 60 of file transaction.hpp.

◆ max_cpu_usage_ms

uint8_t sysio::chain::transaction_header::max_cpu_usage_ms = 0

Definition at line 64 of file transaction.hpp.

◆ max_net_usage_words

fc::unsigned_int sysio::chain::transaction_header::max_net_usage_words = 0UL

Definition at line 63 of file transaction.hpp.

◆ ref_block_num

uint16_t sysio::chain::transaction_header::ref_block_num = 0U

Definition at line 61 of file transaction.hpp.

◆ ref_block_prefix

uint32_t sysio::chain::transaction_header::ref_block_prefix = 0UL

Definition at line 62 of file transaction.hpp.


The documentation for this struct was generated from the following files: