CCF
Loading...
Searching...
No Matches
node_call_types.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
7#include "ccf/pal/mem.h"
14#include "enclave/interface.h"
15#include "node/identity.h"
16#include "node/ledger_secrets.h"
19
20#include <nlohmann/json.hpp>
21
22namespace ccf
23{
24 struct GetState
25 {
26 using In = void;
27
28 struct Out
29 {
34
35 // Only on recovery
36 std::optional<ccf::kv::Version> recovery_target_seqno;
37 std::optional<ccf::kv::Version> last_recovered_seqno;
38
40 };
41 };
42
44 {
45 using In = void;
46
47 struct Out
48 {
49 std::string ccf_version;
50 std::string quickjs_version;
51 bool unsafe;
52 };
53 };
54
56 {
57 struct In
58 {
67 std::optional<HostDataMetadata> snp_security_policy =
68 std::nullopt; // base64-encoded
69 std::optional<UVMEndorsements> snp_uvm_endorsements = std::nullopt;
71 nlohmann::json node_data;
72 nlohmann::json service_data;
74
75 // Only set on genesis transaction, but not on recovery
76 std::optional<StartupConfig::Start> genesis_info = std::nullopt;
77 // Constitution to set on recovery
78 std::optional<std::string> recovery_constitution = std::nullopt;
79 };
80 };
81
83 {
84 struct In
85 {
89 // Always set by the joiner (node_state.h), but defaults to nullopt here
90 // to make sure serialisation does take place now that it is OPTIONAL.
91 std::optional<ConsensusType> consensus_type = std::nullopt;
92 std::optional<ccf::kv::Version> startup_seqno = std::nullopt;
93 std::optional<ccf::crypto::Pem> certificate_signing_request =
94 std::nullopt;
95 nlohmann::json node_data = nullptr;
96 };
97
98 struct Out
99 {
101
102 // Deprecated in 2.x
103 std::optional<NodeId> node_id = std::nullopt;
104
106 {
107 bool public_only = false;
110 std::optional<ReconfigurationType> reconfiguration_type =
111 std::nullopt; // Unused, but kept for backwards compatibility
112
115 std::optional<ServiceStatus> service_status = std::nullopt;
116
117 std::optional<ccf::crypto::Pem> endorsed_certificate = std::nullopt;
118 std::optional<COSESignaturesConfig> cose_signatures_config =
119 std::nullopt;
120
122
141
154
155 bool operator!=(const NetworkInfo& other) const
156 {
157 return !(*this == other);
158 }
159 };
160
161 // Only set if the caller node is trusted
162 std::optional<NetworkInfo> network_info = std::nullopt;
163 };
164 };
165
184}
Definition pem.h:18
ConsensusType
Definition consensus_type.h:6
@ CFT
Definition consensus_type.h:7
ReconfigurationType
Definition reconfiguration_type.h:6
uint64_t Version
Definition version.h:8
Definition app_interface.h:15
ServiceStatus
Definition service.h:13
std::map< ccf::kv::Version, LedgerSecretPtr > LedgerSecretsMap
Definition ledger_secrets.h:19
NodeStartupState
Definition node_startup_state.h:10
NodeStatus
Definition node_info.h:18
Definition node_call_types.h:58
QuoteInfo quote_info
Definition node_call_types.h:64
nlohmann::json node_data
Definition node_call_types.h:71
std::optional< HostDataMetadata > snp_security_policy
Definition node_call_types.h:67
ccf::crypto::Pem service_cert
Definition node_call_types.h:63
NodeId node_id
Definition node_call_types.h:59
ccf::TxID create_txid
Definition node_call_types.h:73
ccf::crypto::Pem certificate_signing_request
Definition node_call_types.h:60
NodeInfoNetwork node_info_network
Definition node_call_types.h:70
ccf::crypto::Pem public_key
Definition node_call_types.h:62
ccf::crypto::Pem node_endorsed_certificate
Definition node_call_types.h:61
pal::PlatformAttestationMeasurement measurement
Definition node_call_types.h:66
std::optional< StartupConfig::Start > genesis_info
Definition node_call_types.h:76
std::optional< std::string > recovery_constitution
Definition node_call_types.h:78
std::optional< UVMEndorsements > snp_uvm_endorsements
Definition node_call_types.h:69
ccf::crypto::Pem public_encryption_key
Definition node_call_types.h:65
nlohmann::json service_data
Definition node_call_types.h:72
Definition node_call_types.h:56
Definition node_call_types.h:29
std::optional< ccf::kv::Version > last_recovered_seqno
Definition node_call_types.h:37
std::optional< ccf::kv::Version > recovery_target_seqno
Definition node_call_types.h:36
bool stop_notice
Definition node_call_types.h:39
ccf::NodeId node_id
Definition node_call_types.h:30
ccf::kv::Version startup_seqno
Definition node_call_types.h:33
ccf::NodeStartupState state
Definition node_call_types.h:31
ccf::kv::Version last_signed_seqno
Definition node_call_types.h:32
Definition node_call_types.h:25
void In
Definition node_call_types.h:26
Definition node_call_types.h:48
bool unsafe
Definition node_call_types.h:51
std::string quickjs_version
Definition node_call_types.h:50
std::string ccf_version
Definition node_call_types.h:49
Definition node_call_types.h:44
void In
Definition node_call_types.h:45
Definition node_call_types.h:85
QuoteInfo quote_info
Definition node_call_types.h:87
std::optional< ccf::crypto::Pem > certificate_signing_request
Definition node_call_types.h:93
std::optional< ccf::kv::Version > startup_seqno
Definition node_call_types.h:92
NodeInfoNetwork node_info_network
Definition node_call_types.h:86
nlohmann::json node_data
Definition node_call_types.h:95
std::optional< ConsensusType > consensus_type
Definition node_call_types.h:91
ccf::crypto::Pem public_encryption_key
Definition node_call_types.h:88
Definition node_call_types.h:106
std::optional< ccf::crypto::Pem > endorsed_certificate
Definition node_call_types.h:117
bool operator==(const NetworkInfo &other) const
Definition node_call_types.h:142
NetworkInfo(bool public_only, ccf::kv::Version last_recovered_signed_idx, ReconfigurationType reconfiguration_type, const LedgerSecretsMap &ledger_secrets, const NetworkIdentity &identity, ServiceStatus service_status, const std::optional< ccf::crypto::Pem > &endorsed_certificate, const std::optional< COSESignaturesConfig > &cose_signatures_config_)
Definition node_call_types.h:123
ccf::kv::Version last_recovered_signed_idx
Definition node_call_types.h:108
LedgerSecretsMap ledger_secrets
Definition node_call_types.h:113
ConsensusType consensus_type
Definition node_call_types.h:109
NetworkInfo()
Definition node_call_types.h:121
NetworkIdentity identity
Definition node_call_types.h:114
std::optional< ServiceStatus > service_status
Definition node_call_types.h:115
std::optional< COSESignaturesConfig > cose_signatures_config
Definition node_call_types.h:118
std::optional< ReconfigurationType > reconfiguration_type
Definition node_call_types.h:110
bool operator!=(const NetworkInfo &other) const
Definition node_call_types.h:155
bool public_only
Definition node_call_types.h:107
Definition node_call_types.h:99
std::optional< NodeId > node_id
Definition node_call_types.h:103
std::optional< NetworkInfo > network_info
Definition node_call_types.h:162
NodeStatus node_status
Definition node_call_types.h:100
Definition node_call_types.h:83
Definition node_call_types.h:171
size_t current_allocated_heap_size
Definition node_call_types.h:180
Out(const pal::MallocInfo &info)
Definition node_call_types.h:172
size_t max_total_heap_size
Definition node_call_types.h:179
size_t peak_allocated_heap_size
Definition node_call_types.h:181
Definition node_call_types.h:167
void In
Definition node_call_types.h:168
Definition identity.h:23
Definition node_info_network.h:192
Describes a quote (attestation) from trusted hardware.
Definition quote_info.h:26
Definition tx_id.h:44
Definition mem.h:25
Definition measurement.h:116