Tor  0.4.7.0-alpha-dev
Data Fields
sr_state_t Struct Reference

#include <shared_random_state.h>

Data Fields

char * fname
 
uint32_t version
 
time_t valid_after
 
time_t valid_until
 
sr_phase_t phase
 
uint64_t n_protocol_runs
 
unsigned int n_commit_rounds
 
unsigned int n_reveal_rounds
 
digestmap_t * commits
 
sr_srv_tprevious_srv
 
sr_srv_tcurrent_srv
 
unsigned int is_srv_fresh:1
 

Detailed Description

State of the protocol. It's also saved on disk in fname. This data structure MUST be synchronized at all time with the one on disk.

Definition at line 41 of file shared_random_state.h.

Field Documentation

◆ commits

digestmap_t* commits

A map of all the received commitments for this protocol run. This is indexed by authority RSA identity digest.

Definition at line 62 of file shared_random_state.h.

Referenced by commit_add_to_state(), and state_query_get_commit().

◆ current_srv

sr_srv_t* current_srv

Previous shared random value.

Definition at line 67 of file shared_random_state.h.

◆ fname

char* fname

Filename of the state file on disk.

Definition at line 43 of file shared_random_state.h.

Referenced by state_free_().

◆ is_srv_fresh

unsigned int is_srv_fresh

Indicate if the state contains an SRV that was just generated. This is used during voting so that we know whether to use the super majority rule or not when deciding on keeping it for the consensus. It is always set to 0 post consensus.

EDGE CASE: if an authority computes a new SRV then immediately reboots and, once back up, votes for the current round, it won't know if the SRV is fresh or not ultimately making it NOT use the super majority when deciding to put or not the SRV in the consensus. This is for now an acceptable very rare edge case.

Definition at line 79 of file shared_random_state.h.

Referenced by sr_state_set_fresh_srv(), sr_state_srv_is_fresh(), and sr_state_unset_fresh_srv().

◆ n_commit_rounds

unsigned int n_commit_rounds

The number of commitment rounds we've performed in this protocol run.

Definition at line 56 of file shared_random_state.h.

◆ n_protocol_runs

uint64_t n_protocol_runs

Number of runs completed.

Definition at line 54 of file shared_random_state.h.

◆ n_reveal_rounds

unsigned int n_reveal_rounds

The number of reveal rounds we've performed in this protocol run.

Definition at line 58 of file shared_random_state.h.

◆ phase

sr_phase_t phase

Protocol phase.

Definition at line 51 of file shared_random_state.h.

Referenced by disk_state_parse(), is_phase_transition(), and new_protocol_run().

◆ previous_srv

sr_srv_t* previous_srv

Current shared random value.

Definition at line 65 of file shared_random_state.h.

◆ valid_after

time_t valid_after

The valid-after of the voting period we have prepared the state for.

Definition at line 47 of file shared_random_state.h.

Referenced by disk_state_parse().

◆ valid_until

time_t valid_until

Until when is this state valid?

Definition at line 49 of file shared_random_state.h.

Referenced by disk_state_parse().

◆ version

uint32_t version

Version of the protocol.

Definition at line 45 of file shared_random_state.h.

Referenced by disk_state_parse().


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