6#ifndef OPENCBDC_TX_SRC_SENTINEL_INTERFACE_H_
7#define OPENCBDC_TX_SRC_SENTINEL_INTERFACE_H_
56 std::optional<transaction::validation::tx_error>
m_tx_error;
70 using request = std::variant<execute_request, validate_request>;
73 using response = std::variant<execute_response, validate_response>;
93 -> std::optional<execute_response> = 0;
101 -> std::optional<validate_response> = 0;
Interface for a sentinel.
virtual auto execute_transaction(transaction::full_tx tx) -> std::optional< execute_response >=0
Validate transaction on the sentinel, and forward it to the coordinator or shards depending on the im...
auto operator=(interface &&) -> interface &=delete
interface(const interface &)=delete
virtual auto validate_transaction(transaction::full_tx tx) -> std::optional< validate_response >=0
Validate transaction and generate a sentinel attestation if the transaction is valid.
virtual ~interface()=default
interface(interface &&)=delete
auto operator=(const interface &) -> interface &=delete
std::pair< uint8_t, uint8_t > shard_range_t
[start, end] inclusive.
size_t peer_id_t
Peer IDs within a connection_manager.
transaction::sentinel_attestation validate_response
Response type from transaction validation, a sentinel attestation on the given transaction.
auto to_string(tx_status status) -> std::string
Return a human-readable string describing a tx_status.
std::variant< execute_response, validate_response > response
Sentinel RPC response type.
tx_status
Status of the transaction following sentinel processing.
@ static_invalid
Statically invalid. Must be fixed and resubmitted.
@ state_invalid
Statically valid, but rejected by the shards for trying to spend inputs either that do not exist or t...
@ pending
Statically valid, and the sentinel has submitted the transaction to the network for processing.
@ confirmed
Executed to completion.
std::variant< execute_request, validate_request > request
Sentinel RPC request type.
std::pair< pubkey_t, signature_t > sentinel_attestation
Sentinel attestation type.
Sentinel request message.
Sentinel response message.
cbdc::sentinel::tx_status m_tx_status
Transaction execution status.
auto operator==(const execute_response &rhs) const -> bool
std::optional< transaction::validation::tx_error > m_tx_error
Transaction validation error if static validation failed.
Sentinel-specific representation of shard network information.
cbdc::network::peer_id_t m_peer_id
Network ID of the peer corresponding to this shard generated by a call to cbdc::network::network::con...
config::shard_range_t m_range
UHS ID range.
Request type for transaction validation and attestation.