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

Release test #2803

Closed
wants to merge 14 commits into from
Closed
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 9)
set(TARAXA_PATCH_VERSION 0)
set(TARAXA_PATCH_VERSION 3)
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
67 changes: 67 additions & 0 deletions libraries/cli/include/cli/config_jsons/default/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,73 @@
},
"logging": {
"configurations": [
{
"channels" :
[
{
"name" : "SUMMARY",
"verbosity" : "INFO"
},
{
"name" : "PILLAR_CHAIN",
"verbosity" : "DEBUG"
},
{
"name" : "PILLAR_VOTE_PH",
"verbosity" : "DEBUG"
},
{
"name" : "PILLAR_VOTES_BUNDLE_PH",
"verbosity" : "DEBUG"
},
{
"name" : "PILLAR_CHAIN_SYNC_PH",
"verbosity" : "DEBUG"
},
{
"name" : "GET_PILLAR_VOTES_BUNDLE_PH",
"verbosity" : "DEBUG"
},
{
"name" : "GET_PILLAR_CHAIN_SYNC_PH",
"verbosity" : "DEBUG"
},
{
"name" : "PBFT_MGR",
"verbosity" : "DEBUG"
},
{
"name" : "PBFT_CHAIN",
"verbosity" : "DEBUG"
},
{
"name" : "VOTE_MGR",
"verbosity" : "DEBUG"
},
{
"name" : "EXECUTOR",
"verbosity" : "DEBUG"
}
],
"name" : "pillar",
"on" : true,
"outputs" :
[
{
"format" : "%ThreadID% %Channel% [%TimeStamp%] %SeverityStr%: %Message%",
"type" : "console"
},
{
"file_name" : "Taraxa_N1_%m%d%Y_%H%M%S_%5N.log",
"format" : "%ThreadID% %ShortNodeId% %Channel% [%TimeStamp%] %SeverityStr%: %Message%",
"max_size" : 1000000000,
"rotation_size" : 10000000,
"time_based_rotation" : "0,0,0",
"type" : "file"
}
],
"verbosity" : "ERROR"
},
{
"name": "standard",
"on": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@
"generated_rewards": "0x0"
},
"ficus_hf": {
"block_num": 200,
"pillar_blocks_interval": 100,
"pillar_chain_sync_interval": 25,
"block_num": 80,
"pillar_blocks_interval": 16,
"pillar_chain_sync_interval": 8,
"pbft_inclusion_delay": 6,
"bridge_contract_address": "0xcAF2b453FE8382a4B8110356DF0508f6d71F22BF"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"data_path": "",
"is_light_node": false,
"final_chain_cache_in_blocks": 5,
"report_malicious_behaviour" : true,
"report_malicious_behaviour": true,
"network": {
"rpc": {
"http_port": 7777,
Expand Down Expand Up @@ -38,17 +38,17 @@
"boot_nodes": [
{
"id": "f36f467529fe91a750dfdc8086fd0d2f30bad9f55a5800b6b4aa603c7787501db78dc4ac1bf3cf16e42af7c2ebb53648653013c3da1987494960d751871d598a",
"ip": "boot-node-0.testnet.taraxa.io",
"ip": "boot-node-3.testnet.taraxa.io",
"port": 10002
},
{
"id": "d2d445fc3276bdbf2a07628a484baabf45ccb91d6aa078a0dc3aefc11f1941899a923312ec0e664b8e57b63b774c47a006d9d1d16befd2135dcf76067736c688",
"ip": "boot-node-1.testnet.taraxa.io",
"ip": "boot-node-4.testnet.taraxa.io",
"port": 10002
},
{
"id": "c6e7263f44d88c0d6cc3b0d5ebdc31cf891908e8fa7e545e137d3ed0bfec1810fa24c1379228afbb53df0d59e716e17138115fd096782a84261718ab77665171",
"ip": "boot-node-2.testnet.taraxa.io",
"ip": "boot-node-5.testnet.taraxa.io",
"port": 10002
}
]
Expand Down Expand Up @@ -174,4 +174,4 @@
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"level": "0x0",
"pivot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"sig": "0xb7e22d46c1ba94d5e8347b01d137b5c428fcbbeaf0a77fb024cbbf1517656ff00d04f7f25be608c321b0d7483c402c294ff46c49b265305d046a52236c0a363701",
"timestamp": "0x658C3F5E",
"timestamp": "0x66827F92",
"tips": [],
"transactions": []
},
Expand Down Expand Up @@ -105,13 +105,13 @@
"dag_blocks_size": "0x32",
"ghost_path_move_back": "0x0",
"lambda_ms": "0x5DC",
"gas_limit": "0x12C684C0"
"gas_limit": "0x7d2b7500"
},
"dag": {
"block_proposer": {
"shard": 1
},
"gas_limit": "0x1E0A6E0"
"gas_limit": "0x1908B100"
},
"sortition": {
"changes_count_for_average": 10,
Expand Down Expand Up @@ -150,11 +150,11 @@
"generated_rewards": "0x0"
},
"ficus_hf": {
"block_num": -1,
"block_num": 1000,
"pillar_blocks_interval": 100,
"pillar_chain_sync_interval": 25,
"pbft_inclusion_delay": 6,
"bridge_contract_address": "0x0000000000000000000000000000000000000000"
"bridge_contract_address": "0xcAF2b453FE8382a4B8110356DF0508f6d71F22BF"
}
}
}
3 changes: 2 additions & 1 deletion libraries/config/src/hardfork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ RLP_FIELDS_DEFINE(AspenHardfork, block_num_part_one, block_num_part_two, max_sup
bool FicusHardforkConfig::isFicusHardfork(taraxa::PbftPeriod period) const { return period >= block_num; }

bool FicusHardforkConfig::isPillarBlockPeriod(taraxa::PbftPeriod period, bool skip_first_pillar_block) const {
return period >= block_num && period >= firstPillarBlockPeriod() + (skip_first_pillar_block ? 1 : 0) * pillar_blocks_interval &&
return period >= block_num &&
period >= firstPillarBlockPeriod() + (skip_first_pillar_block ? 1 : 0) * pillar_blocks_interval &&
period % pillar_blocks_interval == 0;
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/core_libs/consensus/src/pbft/pbft_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ void PbftManager::secondFinish_() {

// Lambda function for next voting 2t+1 next voted null block from previous round
auto next_vote_null_block = [this, period = period, round = round]() {
if (already_next_voted_null_block_hash_ || round < 2) {
if (cert_voted_block_for_round_.has_value() || already_next_voted_null_block_hash_ || round < 2) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ PillarChainManager::PillarChainManager(const FicusHardforkConfig& ficus_hf_confi
current_pillar_block_vote_counts_{},
pillar_votes_{},
mutex_{} {
LOG_OBJECTS_CREATE("PILLAR_CHAIN");

if (const auto vote = db_->getOwnPillarBlockVote(); vote) {
addVerifiedPillarVote(vote);
}
Expand All @@ -39,8 +41,6 @@ PillarChainManager::PillarChainManager(const FicusHardforkConfig& ficus_hf_confi
addVerifiedPillarVote(vote);
}
}

LOG_OBJECTS_CREATE("PILLAR_CHAIN");
}

std::shared_ptr<PillarBlock> PillarChainManager::createPillarBlock(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ExtPillarVotePacketHandler : public PacketHandler {
const addr_t& node_addr, const std::string& log_channel);

protected:
void processPillarVote(const std::shared_ptr<PillarVote>& vote, const std::shared_ptr<TaraxaPeer>& peer);
bool processPillarVote(const std::shared_ptr<PillarVote>& vote, const std::shared_ptr<TaraxaPeer>& peer);

protected:
std::shared_ptr<pillar_chain::PillarChainManager> pillar_chain_manager_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,26 @@ ExtPillarVotePacketHandler::ExtPillarVotePacketHandler(
: PacketHandler(conf, std::move(peers_state), std::move(packets_stats), node_addr, log_channel),
pillar_chain_manager_{std::move(pillar_chain_manager)} {}

void ExtPillarVotePacketHandler::processPillarVote(const std::shared_ptr<PillarVote> &vote,
bool ExtPillarVotePacketHandler::processPillarVote(const std::shared_ptr<PillarVote> &vote,
const std::shared_ptr<TaraxaPeer> &peer) {
if (!pillar_chain_manager_->isRelevantPillarVote(vote)) {
LOG(log_dg_) << "Drop irrelevant pillar vote " << vote->getHash() << " from peer " << peer->getId();
return;
return false;
}

if (!pillar_chain_manager_->validatePillarVote(vote)) {
std::ostringstream err_msg;
err_msg << "Invalid pillar vote " << vote->getHash() << " from peer " << peer->getId();
throw MaliciousPeerException(err_msg.str());
// TODO: enable for mainnet
// std::ostringstream err_msg;
// err_msg << "Invalid pillar vote " << vote->getHash() << " from peer " << peer->getId();
// throw MaliciousPeerException(err_msg.str());
return false;
}

pillar_chain_manager_->addVerifiedPillarVote(vote);

// Mark pillar vote as known for peer
peer->markPillarVoteAsKnown(vote->getHash());
return true;
}

} // namespace taraxa::network::tarcap
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ void PillarVotePacketHandler::process(const threadpool::PacketData &packet_data,
throw MaliciousPeerException(err_msg.str());
}

processPillarVote(pillar_vote, peer);
onNewPillarVote(pillar_vote);
if (processPillarVote(pillar_vote, peer)) {
onNewPillarVote(pillar_vote);
}
}

void PillarVotePacketHandler::onNewPillarVote(const std::shared_ptr<PillarVote> &vote, bool rebroadcast) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/taraxa-sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def sign(key, wallet, text):
private_key = key

account = Account.from_key(private_key)
sig = account.signHash(keccak(hexstr=text))
sig = account.unsafe_sign_hash(keccak(hexstr=text))
sig_hex = sig.signature.hex()

click.echo(sig_hex)
Expand Down
Loading