CCF
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Enumerations | Functions
raft_types.h File Reference
#include "ccf/crypto/ecdsa.h"
#include "ccf/entity_id.h"
#include "consensus/consensus_types.h"
#include "ds/ring_buffer_types.h"
#include "enclave/rpc_handler.h"
#include "kv/kv_types.h"
#include <array>
#include <chrono>
#include <cstdint>
#include <limits>

Go to the source code of this file.

Classes

class  aft::Store
 
class  aft::Adaptor< T >
 
struct  aft::RaftHeader< M >
 
struct  aft::AppendEntries
 
struct  aft::AppendEntriesResponse
 
struct  aft::RequestVote
 
struct  aft::RequestVoteResponse
 
struct  aft::ProposeRequestVote
 

Namespaces

namespace  aft
 

Typedefs

using aft::Index = uint64_t
 
using aft::Term = uint64_t
 
using aft::Node2NodeMsg = uint64_t
 
using aft::Nonce = ccf::crypto::Sha256Hash
 
using aft::ReplyCallback = std::function< bool(void *owner, ccf::kv::TxHistory::RequestID caller_rid, int status, std::vector< uint8_t > &&data)>
 

Enumerations

enum  aft::RaftMsgType : Node2NodeMsg {
  aft::raft_append_entries = 0 , aft::raft_append_entries_response , aft::raft_append_entries_signed_response , aft::raft_request_vote ,
  aft::raft_request_vote_response , aft::raft_propose_request_vote
}
 
enum class  aft::AppendEntriesResponseType : uint8_t { aft::OK = 0 , aft::FAIL = 1 }
 

Functions

 aft::DECLARE_JSON_ENUM (RaftMsgType, { {RaftMsgType::raft_append_entries, "raft_append_entries"}, {RaftMsgType::raft_append_entries_response, "raft_append_entries_response"}, {RaftMsgType::raft_append_entries_signed_response, "raft_append_entries_signed_response"}, {RaftMsgType::raft_request_vote, "raft_request_vote"}, {RaftMsgType::raft_request_vote_response, "raft_request_vote_response"}, {RaftMsgType::raft_propose_request_vote, "raft_propose_request_vote"}, })
 
 aft::DECLARE_JSON_TYPE_WITH_2BASES (AppendEntries, RaftHeader< raft_append_entries >, ::consensus::AppendEntriesIndex)
 
 aft::DECLARE_JSON_REQUIRED_FIELDS (AppendEntries, term, prev_term, leader_commit_idx, term_of_idx, contains_new_view)
 
 aft::DECLARE_JSON_ENUM (AppendEntriesResponseType, {{AppendEntriesResponseType::OK, "OK"}, {AppendEntriesResponseType::FAIL, "FAIL"}})
 
 aft::DECLARE_JSON_TYPE_WITH_BASE (AppendEntriesResponse, RaftHeader< raft_append_entries_response >)
 
 aft::DECLARE_JSON_REQUIRED_FIELDS (AppendEntriesResponse, term, last_log_idx, success)
 
 aft::DECLARE_JSON_TYPE_WITH_BASE (RequestVote, RaftHeader< raft_request_vote >)
 
 aft::DECLARE_JSON_REQUIRED_FIELDS (RequestVote, term, last_committable_idx, term_of_last_committable_idx)
 
 aft::DECLARE_JSON_TYPE_WITH_BASE (RequestVoteResponse, RaftHeader< raft_request_vote_response >)
 
 aft::DECLARE_JSON_REQUIRED_FIELDS (RequestVoteResponse, term, vote_granted)
 
 aft::DECLARE_JSON_TYPE_WITH_BASE (ProposeRequestVote, RaftHeader< raft_propose_request_vote >)
 
 aft::DECLARE_JSON_REQUIRED_FIELDS (ProposeRequestVote, term)