-
Notifications
You must be signed in to change notification settings - Fork 249
Expand file tree
/
Copy pathconfiguration.h
More file actions
173 lines (149 loc) · 5.22 KB
/
configuration.h
File metadata and controls
173 lines (149 loc) · 5.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache 2.0 License.
#pragma once
#include "ccf/crypto/curve.h"
#include "ccf/crypto/pem.h"
#include "ccf/ds/unit_strings.h"
#include "ccf/node/startup_config.h"
#include "ccf/pal/attestation_sev_snp_endorsements.h"
#include "ccf/service/consensus_type.h"
#include "ccf/service/node_info_network.h"
#include "ccf/service/reconfiguration_type.h"
#include "ccf/service/tables/members.h"
#include "common/enclave_interface_types.h"
#include "consensus/consensus_types.h"
#include "ds/internal_logger.h"
#include "ds/oversized.h"
#include "service/tables/config.h"
#include <optional>
#include <string>
#include <vector>
DECLARE_JSON_ENUM(
StartType,
{{StartType::Start, "Start"},
{StartType::Join, "Join"},
{StartType::Recover, "Recover"}});
struct EnclaveConfig
{
uint8_t* to_enclave_buffer_start = nullptr;
size_t to_enclave_buffer_size = 0;
ringbuffer::Offsets* to_enclave_buffer_offsets = nullptr;
uint8_t* from_enclave_buffer_start = nullptr;
size_t from_enclave_buffer_size = 0;
ringbuffer::Offsets* from_enclave_buffer_offsets = nullptr;
oversized::WriterConfig writer_config = {};
};
static constexpr auto node_to_node_interface_name = "node_to_node_interface";
namespace ccf
{
DECLARE_JSON_ENUM(
LoggerLevel,
{{LoggerLevel::TRACE, "Trace"},
{LoggerLevel::DEBUG, "Debug"},
{LoggerLevel::INFO, "Info"},
{LoggerLevel::FAIL, "Fail"},
{LoggerLevel::FATAL, "Fatal"}});
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCFConfig::NodeCertificateInfo);
DECLARE_JSON_REQUIRED_FIELDS(CCFConfig::NodeCertificateInfo);
DECLARE_JSON_OPTIONAL_FIELDS(
CCFConfig::NodeCertificateInfo,
subject_name,
subject_alt_names,
curve_id,
initial_validity_days);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCFConfig::Ledger);
DECLARE_JSON_REQUIRED_FIELDS(CCFConfig::Ledger);
DECLARE_JSON_OPTIONAL_FIELDS(
CCFConfig::Ledger, directory, read_only_directories, chunk_size);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCFConfig::LedgerSignatures);
DECLARE_JSON_REQUIRED_FIELDS(CCFConfig::LedgerSignatures);
DECLARE_JSON_OPTIONAL_FIELDS(CCFConfig::LedgerSignatures, tx_count, delay);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCFConfig::JWT);
DECLARE_JSON_REQUIRED_FIELDS(CCFConfig::JWT);
DECLARE_JSON_OPTIONAL_FIELDS(CCFConfig::JWT, key_refresh_interval);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCFConfig::Attestation::Environment);
DECLARE_JSON_REQUIRED_FIELDS(CCFConfig::Attestation::Environment);
DECLARE_JSON_OPTIONAL_FIELDS(
CCFConfig::Attestation::Environment,
security_policy,
uvm_endorsements,
snp_endorsements);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCFConfig::Attestation);
DECLARE_JSON_REQUIRED_FIELDS(CCFConfig::Attestation);
DECLARE_JSON_OPTIONAL_FIELDS(
CCFConfig::Attestation,
snp_endorsements_servers,
environment,
snp_security_policy_file,
snp_uvm_endorsements_file,
snp_endorsements_file);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCFConfig::Snapshots::BackupFetch);
DECLARE_JSON_REQUIRED_FIELDS(CCFConfig::Snapshots::BackupFetch);
DECLARE_JSON_OPTIONAL_FIELDS(
CCFConfig::Snapshots::BackupFetch,
enabled,
max_attempts,
retry_interval,
target_rpc_interface,
max_size);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCFConfig::Snapshots);
DECLARE_JSON_REQUIRED_FIELDS(CCFConfig::Snapshots);
DECLARE_JSON_OPTIONAL_FIELDS(
CCFConfig::Snapshots,
directory,
tx_count,
read_only_directory,
backup_fetch);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCFConfig);
DECLARE_JSON_REQUIRED_FIELDS(CCFConfig, network);
DECLARE_JSON_OPTIONAL_FIELDS(
CCFConfig,
worker_threads,
node_certificate,
consensus,
ledger,
ledger_signatures,
jwt,
attestation,
snapshots,
node_to_node_message_limit,
historical_cache_soft_limit);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(RecoveryDecisionProtocolConfig);
DECLARE_JSON_REQUIRED_FIELDS(
RecoveryDecisionProtocolConfig, expected_locations);
DECLARE_JSON_OPTIONAL_FIELDS(
RecoveryDecisionProtocolConfig, message_retry_timeout, failover_timeout);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(SealingRecoveryConfig);
DECLARE_JSON_REQUIRED_FIELDS(SealingRecoveryConfig, location);
DECLARE_JSON_OPTIONAL_FIELDS(
SealingRecoveryConfig, recovery_decision_protocol);
DECLARE_JSON_TYPE(StartupConfig::Start);
DECLARE_JSON_REQUIRED_FIELDS(
StartupConfig::Start, members, constitution, service_configuration);
DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(StartupConfig::Join);
DECLARE_JSON_REQUIRED_FIELDS(
StartupConfig::Join,
target_rpc_address,
retry_timeout,
service_cert,
follow_redirect);
DECLARE_JSON_OPTIONAL_FIELDS(
StartupConfig::Join, host_data_transparent_statement_path);
DECLARE_JSON_TYPE(StartupConfig::Recover);
DECLARE_JSON_REQUIRED_FIELDS(
StartupConfig::Recover, previous_service_identity);
DECLARE_JSON_TYPE_WITH_BASE(StartupConfig, CCFConfig);
DECLARE_JSON_REQUIRED_FIELDS(
StartupConfig,
startup_host_time,
snapshot_tx_interval,
initial_service_certificate_validity_days,
service_subject_name,
cose_signatures,
service_data,
node_data,
start,
join,
recover,
sealing_recovery);
}