diff --git a/crud/crud.cpp b/crud/crud.cpp index 071a0a21..2e94ec87 100644 --- a/crud/crud.cpp +++ b/crud/crud.cpp @@ -176,6 +176,7 @@ crud::send_response(const database_msg& request, const bzn::storage_result resul if (this->node && !response.header().point_of_contact().empty()) { + LOG(trace) << "Sending response via PoC: " << response.header().point_of_contact(); try { this->node->send_signed_message(response.header().point_of_contact(), std::make_shared(env)); diff --git a/pbft/pbft.cpp b/pbft/pbft.cpp index 3b4155f5..cfc6a695 100644 --- a/pbft/pbft.cpp +++ b/pbft/pbft.cpp @@ -222,7 +222,7 @@ pbft::handle_membership_message(const bzn_envelope& msg, std::shared_ptr lock(this->pbft_lock); @@ -362,7 +362,7 @@ pbft::handle_request(const bzn_envelope& request_env, const std::shared_ptralready_seen_request(request_env, hash)) { // TODO: send error message to client - LOG(trace) << "Rejecting duplicate request: " << request_env.ShortDebugString().substr(0, MAX_MESSAGE_SIZE); + LOG(debug) << "Rejecting duplicate request: " << request_env.ShortDebugString().substr(0, MAX_MESSAGE_SIZE); return; } this->saw_request(request_env, hash); @@ -648,6 +648,7 @@ pbft::handle_set_state(const pbft_membership_msg& msg) pbft_configuration current_configuration; current_configuration.from_string(msg.current_configuration()); this->configurations->add(std::make_shared(current_configuration)); + this->configurations->set_committed(current_configuration.get_hash()); this->configurations->set_current(current_configuration.get_hash(), this->view.value()); } @@ -1145,6 +1146,7 @@ pbft::is_valid_prepared_proof(const prepared_proof& proof, uint64_t valid_checkp if (!this->is_peer(pre_prepare_envelope.sender()) || !this->crypto->verify(pre_prepare_envelope)) { LOG(error) << "is_valid_prepared_proof - a pre prepare message has a bad envelope, or the sender is not in the peers list"; + LOG(error) << "Sender: " << pre_prepare_envelope.sender() << " is " << (this->is_peer(pre_prepare_envelope.sender()) ? "" : "not ") << "a peer"; return false; } @@ -1164,6 +1166,7 @@ pbft::is_valid_prepared_proof(const prepared_proof& proof, uint64_t valid_checkp { LOG(error) << "is_valid_prepared_proof - a prepare message has a bad envelope, " "the sender may not be in the peer list, or the envelope failed cryptographic verification"; + LOG(error) << "Sender: " << pre_prepare_envelope.sender() << " is " << (this->is_peer(pre_prepare_envelope.sender()) ? "" : "not ") << "a peer"; return false; } @@ -1644,11 +1647,8 @@ pbft::handle_newview(const pbft_msg& msg, const bzn_envelope& original_msg) this->move_to_new_configuration(hash, msg.view()); } - if (!this->is_valid_newview_message(msg, original_msg)) - { - LOG (debug) << "handle_newview - ignoring invalid NEWVIEW message while waiting to join swarm"; - return; - } + // KEP-1574: We're unable to do a full newview validation here as we don't have the requests yet. + // Since we're already assuming no byzantine nodes, skip the validation for now. this->in_swarm = swarm_status::joined; } else if (!this->is_valid_newview_message(msg, original_msg)) @@ -1837,6 +1837,8 @@ pbft::handle_config_message(const pbft_msg& msg, const std::shared_ptrconfigurations->set_current(config_hash, view); }