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

hotfix: for getting block with transactions #2576

Merged
merged 1 commit into from
Sep 29, 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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.20)
# Set current version of the project
set(TARAXA_MAJOR_VERSION 1)
set(TARAXA_MINOR_VERSION 4)
set(TARAXA_PATCH_VERSION 5)
set(TARAXA_PATCH_VERSION 6)
set(TARAXA_VERSION ${TARAXA_MAJOR_VERSION}.${TARAXA_MINOR_VERSION}.${TARAXA_PATCH_VERSION})

# Any time a change in the network protocol is introduced this version should be increased
Expand Down
2 changes: 1 addition & 1 deletion libraries/config/src/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void ConnectionConfig::validate() const {
}

// Max enabled number of threads for processing rpc requests
constexpr uint16_t MAX_RPC_THREADS_NUM = 10;
constexpr uint16_t MAX_RPC_THREADS_NUM = 20;
if (threads_num <= 0 || threads_num > MAX_RPC_THREADS_NUM) {
throw ConfigException(std::string("threads_num must be in range (0, ") + std::to_string(MAX_RPC_THREADS_NUM) + "]");
}
Expand Down
14 changes: 6 additions & 8 deletions libraries/core_libs/consensus/src/final_chain/final_chain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "final_chain/cache.hpp"
#include "final_chain/rewards_stats.hpp"
#include "final_chain/trie_common.hpp"
#include "pbft/pbft_manager.hpp"
#include "vote/vote.hpp"

namespace taraxa::final_chain {
Expand Down Expand Up @@ -457,15 +458,12 @@ class FinalChainImpl final : public FinalChain {
}

const SharedTransactions get_transactions(std::optional<EthBlockNumber> n = {}) const {
SharedTransactions ret;
auto hashes = transaction_hashes(n);
ret.reserve(hashes->size());
for (size_t i = 0; i < ret.capacity(); ++i) {
auto trx = db_->getTransaction(hashes->at(i));
assert(trx);
ret.emplace_back(trx);
if (auto trxs = db_->getPeriodTransactions(last_if_absent(n))) {
// TODO[2495]: remove after a proper fix of transactions ordering in PeriodData
PbftManager::reorderTransactions(*trxs);
return *trxs;
}
return ret;
return {};
}

std::shared_ptr<const BlockHeader> get_block_header(EthBlockNumber n) const {
Expand Down
2 changes: 1 addition & 1 deletion libraries/core_libs/network/rpc/Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Json::Value Debug::trace_replayBlockTransactions(const std::string& block_num, c
res["status"] = "Block has no transactions";
return res;
}
// TODO[2495]: remove after a proper fox of transactions ordering in PeriodData
// TODO[2495]: remove after a proper fix of transactions ordering in PeriodData
PbftManager::reorderTransactions(*transactions);
std::vector<state_api::EVMTransaction> trxs;
trxs.reserve(transactions->size());
Expand Down
Loading