Skip to content
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

chore: remove HF functionality #2376

Merged
merged 2 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions doc/RPC.md
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,6 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"taraxa_getConfig","params":[],"i
"0x0274cfffea9fa850e54c93a23042f12a87358a82": "0x141e8d17",
"0x111f91441efc8c6c0edf6534970cc887e2fabaa8": "0x24048ce3d"
},
"hardforks": {
"fix_genesis_fork_block": "0x102ca0"
}
},
"pbft": {
"committee_size": "0x3e8",
Expand Down Expand Up @@ -492,7 +489,7 @@ none
#### Returns

`OBJECT` - current chain stats object
* `pbft_period`: `QUANTITY` - current PBFT period
* `pbft_period`: `QUANTITY` - current PBFT period
* `dag_blocks_executed`: `QUANTITY` - count of executed(finalized) DAG blocks
* `transactions_executed`: `QUANTITY` - count of executed transactions

Expand Down
5 changes: 0 additions & 5 deletions libraries/cli/src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,6 @@ Config::Config(int argc, const char* argv[]) {
auto default_genesis_json = tools::getGenesis((Config::ChainIdType)chain_id);
// override hardforks data with one from default json
addNewHardforks(genesis_json, default_genesis_json);
// add vote_eligibility_balance_step field if it is missing in the config
if (genesis_json["dpos"]["vote_eligibility_balance_step"].isNull()) {
genesis_json["dpos"]["vote_eligibility_balance_step"] =
default_genesis_json["dpos"]["vote_eligibility_balance_step"];
}
write_config_and_wallet_files();
}
// Override config values with values from CLI
Expand Down
4 changes: 2 additions & 2 deletions libraries/config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(HEADERS
include/config/dag_config.hpp
include/config/pbft_config.hpp
include/config/state_config.hpp
include/config/hardfork.hpp
# include/config/hardfork.hpp
)

set(SOURCES
Expand All @@ -18,7 +18,7 @@ set(SOURCES
src/dag_config.cpp
src/pbft_config.cpp
src/state_config.cpp
src/hardfork.cpp
# src/hardfork.cpp
)

# Configure file with version
Expand Down
2 changes: 1 addition & 1 deletion libraries/config/include/config/state_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "common/encoding_rlp.hpp"
#include "common/types.hpp"
#include "common/vrf_wrapper.hpp"
#include "config/hardfork.hpp"
// #include "config/hardfork.hpp"

namespace taraxa::state_api {

Expand Down
2 changes: 2 additions & 0 deletions libraries/core_libs/network/graphql/src/query.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "graphql/query.hpp"

#include <libdevcore/CommonJS.h>

#include "graphql/account.hpp"
#include "graphql/block.hpp"
#include "graphql/log.hpp"
Expand Down
2 changes: 2 additions & 0 deletions libraries/core_libs/network/graphql/src/types/dag_block.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "graphql/types/dag_block.hpp"

#include <libdevcore/CommonJS.h>

#include "graphql/account.hpp"
#include "graphql/transaction.hpp"

Expand Down
24 changes: 0 additions & 24 deletions libraries/core_libs/node/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,30 +302,6 @@ void FullNode::start() {
},
subscription_pool_);

// Subscription to process hardforks
// final_chain_->block_applying_.subscribe([&](uint64_t block_num) {
// // TODO: should have only common hardfork code calling hardfork executor
// auto &state_conf = conf_.genesis.state;
// if (state_conf.hardforks.fix_genesis_fork_block == block_num) {
// for (auto &e : state_conf.dpos->genesis_state) {
// for (auto &b : e.second) {
// b.second *= kOneTara;
// }
// }
// for (auto &b : state_conf.initial_balances) {
// b.second *= kOneTara;
// }
// // we are multiplying it by TARA precision
// state_conf.dpos->eligibility_balance_threshold *= kOneTara;
// // amount of stake per vote should be 10 times smaller than eligibility threshold
// state_conf.dpos->vote_eligibility_balance_step.assign(state_conf.dpos->eligibility_balance_threshold);
// state_conf.dpos->eligibility_balance_threshold *= 10;
// // if this part of code will be needed we need to overwrite genesis json here
// // conf_.overwrite_chain_config_in_file();
// final_chain_->update_state_config(state_conf);
// }
// });

vote_mgr_->setNetwork(network_);
pbft_mgr_->setNetwork(network_);
dag_mgr_->setNetwork(network_);
Expand Down
7 changes: 0 additions & 7 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ add_executable(full_node_test full_node_test.cpp)
target_link_libraries(full_node_test test_util)
add_test(full_node_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/full_node_test)

# add_executable(hardfork_test hardfork_test.cpp)
# target_link_libraries(hardfork_test
# core_libs
# CONAN_PKG::gtest
# )
# add_test(hardfork_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/hardfork_test)

add_executable(network_test network_test.cpp)
target_link_libraries(network_test test_util)
add_test(network_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/network_test)
Expand Down
6 changes: 0 additions & 6 deletions tests/final_chain_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,6 @@ TEST_F(FinalChainTest, initial_balances) {
init();
}

// TEST_F(FinalChainTest, update_state_config) {
// init();
// cfg.genesis.state.hardforks.fix_genesis_fork_block = 2222222;
// SUT->update_state_config(cfg.genesis.state);
// }

TEST_F(FinalChainTest, contract) {
auto sender_keys = dev::KeyPair::create();
const auto& addr = sender_keys.address();
Expand Down
199 changes: 0 additions & 199 deletions tests/hardfork_test.cpp

This file was deleted.

1 change: 1 addition & 0 deletions tests/rpc_test.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <gtest/gtest.h>
#include <libdevcore/Address.h>
#include <libdevcore/Common.h>
#include <libdevcore/CommonJS.h>

#include "network/rpc/eth/Eth.h"
#include "test_util/gtest.hpp"
Expand Down
1 change: 0 additions & 1 deletion tests/state_api_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ TEST_F(StateAPITest, DISABLED_dpos_integration) {
// dpos_cfg.eligibility_balance_threshold = 1000;
// dpos_cfg.vote_eligibility_balance_step = 1000;
// addr_1_bal_expected -= dpos_cfg.genesis_state[make_addr(1)][make_addr(1)] = dpos_cfg.eligibility_balance_threshold;
// chain_cfg.hardforks.fix_genesis_fork_block = 0;

// uint64_t curr_blk = 0;
// StateAPI SUT([&](auto /*n*/) -> h256 { assert(false); }, //
Expand Down