Skip to content
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
9 changes: 7 additions & 2 deletions core/application/impl/app_configuration_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ namespace kagome::application {
}

fs::path AppConfigurationImpl::keystorePath(std::string chain_id) const {
if (keystore_path_) return *keystore_path_ / chain_id / "keystore";
if (keystore_path_) {
return *keystore_path_ / chain_id / "keystore";
}
return chainPath(chain_id) / "keystore";
}

Expand Down Expand Up @@ -1036,6 +1038,7 @@ namespace kagome::application {
return false; // just proxy erroneous case to the top level
}

// Check of possible address ambiguity
if (p2p_port_explicitly_defined_ and not listen_addresses_.empty()) {
SL_ERROR(logger_,
"Port and listen address must not be defined simultaneously; "
Expand All @@ -1058,7 +1061,9 @@ namespace kagome::application {
public_addresses_ = listen_addresses_;
}

if (p2p_port_explicitly_defined_ and listen_addresses_.empty()) {
// If listen address has not defined, listen P2P TCP-port on all
// accessible interfaces
if (listen_addresses_.empty()) {
// IPv6
{
auto ma_res = libp2p::multi::Multiaddress::create(
Expand Down
24 changes: 13 additions & 11 deletions core/consensus/babe/impl/babe_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,19 @@ namespace kagome::consensus::babe {

current_state_ = Babe::State::STATE_LOADING;

if (app_config_.syncMethod() == SyncMethod::FastWithoutState) {
if (app_state_manager_->state()
!= application::AppStateManager::State::ShuttingDown) {
SL_INFO(log_,
"Stateless fast sync is finished on block {}; "
"Application is stopping",
block_tree_->bestLeaf());
log_->flush();
app_state_manager_->shutdown();
}
return;
}

// Switch to last finalized to have a state on it
auto block_at_state = block_tree_->getLastFinalized();

Expand Down Expand Up @@ -572,17 +585,6 @@ namespace kagome::consensus::babe {
}
} while (affected);

if (app_config_.syncMethod() == SyncMethod::FastWithoutState) {
if (app_state_manager_->state()
!= application::AppStateManager::State::ShuttingDown) {
SL_INFO(log_,
"Stateless fast sync is finished; Application is stopping");
log_->flush();
app_state_manager_->shutdown();
}
return;
}

SL_TRACE(log_,
"Trying to sync state on block {} from {}",
block_at_state,
Expand Down