Template Class log_state_t#

Nested Relationships#

Nested Types#

Class Documentation#

template<class params>
class log_state_t#

Class to represent the log state. The log state is the state which contains the log recorded by the execution of the transaction. YP: accrued transaction substate \(A_{l}\) for log series

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 cgbn_mem_t<params::BITS> evm_word_t#

The arbitrary length integer type used for the storage. It is defined as the EVM word type.

Public Functions

inline __host__ __device__ __forceinline__ log_state_t (arith_t &arith, log_state_data_t *content)

Constructor with given content.

Parameters
  • arith[in] The arithmetical environment

  • content[in] The content of the log state

inline __host__ __device__ __forceinline__ log_state_t (arith_t &arith)

Constructor without content.

Parameters

arith[in] The arithmetical environment

inline __host__ __device__ __forceinline__ ~log_state_t ()

The destructor. It frees the memory allocated for the log state.

inline __host__ __device__ __forceinline__ void grow ()
inline __host__ __device__ __forceinline__ void push (bn_t &address, data_content_t &record, bn_t &topic_1, bn_t &topic_2, bn_t &topic_3, bn_t &topic_4, uint32_t &no_topics)
inline __host__ __device__ __forceinline__ void update_with_child_state (log_state_t &child)

Update the current touch state with the touch state of a children

Parameters

child[in] The touch state of the child

inline __host__ __device__ __forceinline__ void to_log_state_data_t (log_state_data_t &log_state_data)

Copy the content of the touch state to the given touch state data.

Parameters

touch_state_data[out] The touch state data

inline __host__ __device__ __forceinline__ void print ()

Print the state.

inline __host__ __forceinline__ cJSON * json ()

Get json of the state

Returns

The json of the state

Public Members

log_state_data_t *_content#

The content of the touch state

arith_t _arith#

The arithmetical environment

uint32_t _allocated_size#

The allocated size

Public Static Functions

static inline __host__ log_state_data_t * get_cpu_instances (uint32_t count)

Generate the CPU instances of the log state data.

Parameters

count[in] The number of instances

static inline __host__ void free_cpu_instances (log_state_data_t *cpu_instances, uint32_t count)

Free the CPU instances of the log state data.

Parameters
  • cpu_instances[in] The CPU instances

  • count[in] The number of instances

static inline __host__ log_state_data_t * get_gpu_instances_from_cpu_instances (log_state_data_t *cpu_instances, uint32_t count)

Generate the GPU instances of the log state data from the CPU counterparts.

Parameters
  • cpu_instances[in] The CPU instances

  • count[in] The number of instances

static inline __host__ void free_gpu_instances (log_state_data_t *gpu_instances, uint32_t count)

Free the GPU instances of the log state data.

Parameters
  • gpu_instances[in] The GPU instances

  • count[in] The number of instances

static inline __host__ log_state_data_t * get_cpu_instances_from_gpu_instances (log_state_data_t *gpu_instances, uint32_t count)

Get the CPU instances of the log state data from the GPU counterparts.

Parameters
  • gpu_instances[in] The GPU instances

  • count[in] The number of instances

static inline __host__ __device__ __forceinline__ void print_log_state_data_t (arith_t &arith, log_state_data_t &log_state_data)

Print the log state data structure

Parameters
  • arith[in] The arithemtic instance

  • log_state_data[in] The log state data

static inline __host__ cJSON * json_from_log_state_data_t (arith_t &arith, log_state_data_t &log_state_data)

Get json of the lof state data structure.

Parameters
  • arith[in] The arithemtic instance

  • log_state_data[in] The log state data

Returns

The json of the lof state data

Public Static Attributes

static const uint32_t LOG_PAGE_SIZE = 20#

The write operation for log

struct log_data_t#

The log data type for one log.

Public Members

evm_word_t address#

The address of the code executing

data_content_t record#

The record of the log

evm_word_t topics[4]#

The topics of the log

uint32_t no_topics#

The number of topics

struct log_state_data_t#

The log state data type. Contains the logs.

Public Members

log_data_t *logs#

The logs

uint32_t no_logs#

The number of logs