From 7d43a7bba6db28780ab3c759b07270792666e253 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 16 Sep 2024 12:15:50 +0100 Subject: [PATCH] Remove backup signature stuff (#6476) Co-authored-by: Amaury Chamayou --- src/kv/kv_types.h | 4 --- src/node/history.h | 26 ------------------ src/service/network_tables.h | 1 - src/service/tables/backup_signatures.h | 38 -------------------------- 4 files changed, 69 deletions(-) delete mode 100644 src/service/tables/backup_signatures.h diff --git a/src/kv/kv_types.h b/src/kv/kv_types.h index 0be236c901e2..5c55afb4f243 100644 --- a/src/kv/kv_types.h +++ b/src/kv/kv_types.h @@ -399,10 +399,6 @@ namespace ccf::kv }; virtual ~TxHistory() {} - virtual Result verify_and_sign( - ccf::PrimarySignature& signature, - Term* term, - ccf::kv::Configuration::Nodes& nodes) = 0; virtual bool verify_root_signatures() = 0; virtual void try_emit_signature() = 0; virtual void emit_signature() = 0; diff --git a/src/node/history.h b/src/node/history.h index 893a9b16d2ef..ac686653ef7e 100644 --- a/src/node/history.h +++ b/src/node/history.h @@ -152,14 +152,6 @@ namespace ccf version++; } - ccf::kv::TxHistory::Result verify_and_sign( - PrimarySignature&, - ccf::kv::Term*, - ccf::kv::Configuration::Nodes&) override - { - return ccf::kv::TxHistory::Result::OK; - } - bool verify_root_signatures() override { return true; @@ -703,24 +695,6 @@ namespace ccf term_of_next_version}; } - ccf::kv::TxHistory::Result verify_and_sign( - PrimarySignature& sig, - ccf::kv::Term* term, - ccf::kv::Configuration::Nodes& config) override - { - if (!verify_root_signatures()) - { - return ccf::kv::TxHistory::Result::FAIL; - } - - ccf::kv::TxHistory::Result result = ccf::kv::TxHistory::Result::OK; - - sig.node = id; - sig.sig = node_kp.sign_hash(sig.root.h.data(), sig.root.h.size()); - - return result; - } - bool verify_root_signatures() override { auto tx = store.create_read_only_tx(); diff --git a/src/service/network_tables.h b/src/service/network_tables.h index 26a6c48966c3..3e1ce975c767 100644 --- a/src/service/network_tables.h +++ b/src/service/network_tables.h @@ -21,7 +21,6 @@ #include "ccf/service/tables/users.h" #include "ccf/service/tables/uvm_endorsements.h" #include "kv/store.h" -#include "tables/backup_signatures.h" #include "tables/config.h" #include "tables/governance_history.h" #include "tables/previous_service_identity.h" diff --git a/src/service/tables/backup_signatures.h b/src/service/tables/backup_signatures.h deleted file mode 100644 index 6e5610d25f35..000000000000 --- a/src/service/tables/backup_signatures.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the Apache 2.0 License. -#pragma once - -#include "ccf/service/map.h" -#include "node_signature.h" - -#include -#include - -namespace ccf -{ - struct BackupSignatures - { - ccf::View view = 0; - ccf::SeqNo seqno = 0; - ccf::crypto::Sha256Hash root; - std::vector signatures; - - BackupSignatures() = default; - - BackupSignatures( - ccf::View view_, ccf::SeqNo seqno_, const ccf::crypto::Sha256Hash root_) : - view(view_), - seqno(seqno_), - root(root_) - {} - }; - DECLARE_JSON_TYPE(BackupSignatures); - DECLARE_JSON_REQUIRED_FIELDS(BackupSignatures, view, seqno, root, signatures); - - using BackupSignaturesMap = ServiceValue; - namespace Tables - { - static constexpr auto BACKUP_SIGNATURES = - "public:ccf.internal.consensus.backup_signatures"; - } -} \ No newline at end of file