-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify NetworkIdentity
type
#6666
base: main
Are you sure you want to change the base?
Conversation
@@ -6,13 +6,16 @@ | |||
|
|||
#include <string> | |||
|
|||
struct COSESignaturesConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was deliberately not namespaced, because it started under startup_config.h, out of shallow consistency with other config types. I do not remember why we don't namespace those, and the right thing to do is perhaps to namespace them all.
const ccf::COSESignaturesConfig cose_signatures_config; | ||
}; | ||
|
||
std::optional<ServiceSigningContext> signing_context = std::nullopt; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ServiceSigningIdentity seems slightly more precise.
Following #6660, this PR simplifies the
NetworkIdentity
type by flattening it to a single type. The core of the changes are those inidentity.h
, which removesReplicatedNetworkIdentity
and several fields fromNetworkIdentity
. This touches a bunch of other files for 2 reasons:COSESignaturesConfig
under theccf::
namespace, since it is in a public header.cose_signatures_config
fromNetworkIdentity
, the/join
endpoint innode_frontend.h
now accesses the single instance stored in/owned byhistory.h
, which takes a few hops to reach. I think some of these hops are helpful, some may be unnecessary, but regardless this fits the existing style.While we're doing this, be slightly stricter about the order of calls to history, and ensure we throw errors if
set_service_signing_identity
is called multiple times, or ifset_service_signing_identity
was not called before eitherget_cose_signatures_config
oremit_signature
.