Template Class block_operations#

Class Documentation#

template<class params>
class block_operations#

The block operations class. Contains the block operations 40s: Block Information:

  • BLOCKHASH

  • COINBASE

  • TIMESTAMP

  • NUMBER

  • DIFFICULTY

  • GASLIMIT

  • CHAINID

  • BASEFEE

SELFBALANCE is moved to environmental operations because it is not related to the block.

Public Types

typedef arith_env_t<params> arith_t#

The arithmetical environment used by the arbitrary length integer library.

typedef arith_t::bn_t bn_t#

The arbitrary length integer type.

typedef stack_t<params> stack_t#

The stackk class.

typedef block_t<params> block_t#

The block class.

Public Static Functions

static inline __host__ __device__ __forceinline__ void operation_BLOCKHASH (arith_t &arith, bn_t &gas_limit, bn_t &gas_used, uint32_t &error_code, uint32_t &pc, stack_t &stack, block_t &block)

The BLOCKHASH operation implementation. Takes the number from the stack and pushes the hash of the block with that number. The number can be at most 256 blocks behind the current block.

Parameters
  • arith[in] The arithmetical environment.

  • gas_limit[in] The gas limit.

  • gas_used[inout] The gas used.

  • error_code[out] The error code.

  • pc[inout] The program counter.

  • stack[inout] The stack.

  • block[in] The block.

static inline __host__ __device__ __forceinline__ void operation_COINBASE (arith_t &arith, bn_t &gas_limit, bn_t &gas_used, uint32_t &error_code, uint32_t &pc, stack_t &stack, block_t &block)

The COINBASE operation implementation. Pushes on the stack the coinbase address of the current block.

Parameters
  • arith[in] The arithmetical environment.

  • gas_limit[in] The gas limit.

  • gas_used[inout] The gas used.

  • error_code[out] The error code.

  • pc[inout] The program counter.

  • stack[out] The stack.

  • block[in] The block.

static inline __host__ __device__ __forceinline__ void operation_TIMESTAMP (arith_t &arith, bn_t &gas_limit, bn_t &gas_used, uint32_t &error_code, uint32_t &pc, stack_t &stack, block_t &block)

The TIMESTAMP operation implementation. Pushes on the stack the timestamp of the current block.

Parameters
  • arith[in] The arithmetical environment.

  • gas_limit[in] The gas limit.

  • gas_used[inout] The gas used.

  • error_code[out] The error code.

  • pc[inout] The program counter.

  • stack[out] The stack.

  • block[in] The block.

static inline __host__ __device__ __forceinline__ void operation_NUMBER (arith_t &arith, bn_t &gas_limit, bn_t &gas_used, uint32_t &error_code, uint32_t &pc, stack_t &stack, block_t &block)

The NUMBER operation implementation. Pushes on the stack the number of the current block.

Parameters
  • arith[in] The arithmetical environment.

  • gas_limit[in] The gas limit.

  • gas_used[inout] The gas used.

  • error_code[out] The error code.

  • pc[inout] The program counter.

  • stack[out] The stack.

  • block[in] The block.

static inline __host__ __device__ __forceinline__ void operation_PREVRANDAO (arith_t &arith, bn_t &gas_limit, bn_t &gas_used, uint32_t &error_code, uint32_t &pc, stack_t &stack, block_t &block)

The DIFFICULTY/PREVRANDAO operation implementation. Pushes on the stack the difficulty/prevandao of the current block.

Parameters
  • arith[in] The arithmetical environment.

  • gas_limit[in] The gas limit.

  • gas_used[inout] The gas used.

  • error_code[out] The error code.

  • pc[inout] The program counter.

  • stack[out] The stack.

  • block[in] The block.

static inline __host__ __device__ __forceinline__ void operation_GASLIMIT (arith_t &arith, bn_t &gas_limit, bn_t &gas_used, uint32_t &error_code, uint32_t &pc, stack_t &stack, block_t &block)

The GASLIMIT operation implementation. Pushes on the stack the gas limit of the current block.

Parameters
  • arith[in] The arithmetical environment.

  • gas_limit[in] The gas limit.

  • gas_used[inout] The gas used.

  • error_code[out] The error code.

  • pc[inout] The program counter.

  • stack[out] The stack.

  • block[in] The block.

static inline __host__ __device__ __forceinline__ void operation_CHAINID (arith_t &arith, bn_t &gas_limit, bn_t &gas_used, uint32_t &error_code, uint32_t &pc, stack_t &stack, block_t &block)

The CHAINID operation implementation. Pushes on the stack the chain id of the current block.

Parameters
  • arith[in] The arithmetical environment.

  • gas_limit[in] The gas limit.

  • gas_used[inout] The gas used.

  • error_code[out] The error code.

  • pc[inout] The program counter.

  • stack[out] The stack.

  • block[in] The block.

static inline __host__ __device__ __forceinline__ void operation_BASEFEE (arith_t &arith, bn_t &gas_limit, bn_t &gas_used, uint32_t &error_code, uint32_t &pc, stack_t &stack, block_t &block)

The BASEFEE operation implementation. Pushes on the stack the base fee of the current block.

Parameters
  • arith[in] The arithmetical environment.

  • gas_limit[in] The gas limit.

  • gas_used[inout] The gas used.

  • error_code[out] The error code.

  • pc[inout] The program counter.

  • stack[out] The stack.

  • block[in] The block.