Skip to content

Commit

Permalink
GH-12 Move finality_core to finality dir. Remove a few more reference…
Browse files Browse the repository at this point in the history
…s to hotstuff.
  • Loading branch information
heifner committed Apr 16, 2024
1 parent 92f57fb commit 45f2e15
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 119 deletions.
6 changes: 3 additions & 3 deletions libraries/chain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@ set(CHAIN_WEBASSEMBLY_SOURCES
webassembly/transaction.cpp
)

set(CHAIN_HOTSTUFF_SOURCES
set(CHAIN_FINALITY_SOURCES
finality/finalizer.cpp
finality/instant_finality_extension.cpp
finality/quorum_certificate.cpp
finality/finality_core.cpp
)

add_library(eosio_rapidjson INTERFACE)
Expand All @@ -98,7 +99,6 @@ add_library( eosio_chain
block_state.cpp
block_header_state_legacy.cpp
block_state_legacy.cpp
finality_core.cpp
fork_database.cpp
controller.cpp
authorization_manager.cpp
Expand Down Expand Up @@ -128,7 +128,7 @@ add_library( eosio_chain
${CHAIN_EOSVMOC_SOURCES}
${CHAIN_EOSVM_SOURCES}
${CHAIN_WEBASSEMBLY_SOURCES}
${CHAIN_HOTSTUFF_SOURCES}
${CHAIN_FINALITY_SOURCES}

authority.cpp
trace.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <eosio/chain/finality_core.hpp>
#include <eosio/chain/finality/finality_core.hpp>
#include <eosio/chain/block_header.hpp>

namespace eosio::chain {
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/include/eosio/chain/block_header_state.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include <eosio/chain/block_header.hpp>
#include <eosio/chain/finality_core.hpp>
#include <eosio/chain/finality/finality_core.hpp>
#include <eosio/chain/protocol_feature_manager.hpp>
#include <eosio/chain/finality/quorum_certificate.hpp>
#include <eosio/chain/finality/finalizer_policy.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace snapshot_detail {
namespace detail {
struct schedule_info {
// schedule_lib_num is compared with dpos lib, but the value is actually current block at time of pending
// After hotstuff is activated, schedule_lib_num is compared to next().next() round for determination of
// After Savanna is activated, schedule_lib_num is compared to next().next() round for determination of
// changing from pending to active.
uint32_t schedule_lib_num = 0; /// block_num of pending
digest_type schedule_hash;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <eosio/chain/finality/finalizer_policy.hpp>
#include <eosio/chain/finality/proposer_policy.hpp>
#include <eosio/chain/finality_core.hpp>
#include <eosio/chain/finality/finality_core.hpp>

namespace eosio::chain {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <eosio/chain/block_timestamp.hpp>
#include <eosio/chain/finality_core.hpp>
#include <eosio/chain/finality/finality_core.hpp>
#include <fc/crypto/bls_private_key.hpp>
#include <fc/crypto/bls_public_key.hpp>
#include <fc/crypto/bls_signature.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ namespace webassembly {
int64_t set_proposed_producers_ex(uint64_t packed_producer_format, legacy_span<const char> packed_producer_schedule);

/**
* Submits a finalizer set change to Hotstuff.
* Submits a finalizer set change.
*
* // format for packed finalizer_policy
* struct abi_finalizer_authority {
Expand Down
4 changes: 2 additions & 2 deletions libraries/libfc/test/test_bls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ BOOST_AUTO_TEST_CASE(bls_sig_verif_digest) try {
} FC_LOG_AND_RETHROW();


//test a single key signature + verification of hotstuff tuple
BOOST_AUTO_TEST_CASE(bls_sig_verif_hotstuff_types) try {
//test a single key signature + verification of finality tuple
BOOST_AUTO_TEST_CASE(bls_sig_verif_finality_types) try {

bls_private_key sk = bls_private_key(seed_1);
bls_public_key pk = sk.get_public_key();
Expand Down
106 changes: 0 additions & 106 deletions libraries/libfc/test/test_hotstuff.cpp.old

This file was deleted.

2 changes: 1 addition & 1 deletion unittests/finality_core_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <eosio/chain/finality_core.hpp>
#include <eosio/chain/finality/finality_core.hpp>
#include <fc/crypto/sha256.hpp>
#include <fc/bitutil.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
2 changes: 1 addition & 1 deletion unittests/finality_test_cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void finality_test_cluster::setup_node(node_info& node, eosio::chain::account_na
node.node.produce_block();
node.node.produce_block();

// activate hotstuff
// activate savanna
eosio::testing::base_tester::finalizer_policy_input policy_input = {
.finalizers = { {.name = "node0"_n, .weight = 1},
{.name = "node1"_n, .weight = 1},
Expand Down

0 comments on commit 45f2e15

Please sign in to comment.