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

Change Net Plugin Log Messages To Be Less Alarming #73

Closed
ericpassmore opened this issue Apr 25, 2024 · 0 comments · Fixed by #75
Closed

Change Net Plugin Log Messages To Be Less Alarming #73

ericpassmore opened this issue Apr 25, 2024 · 0 comments · Fixed by #75
Assignees
Labels
OCI Work exclusive to OCI team

Comments

@ericpassmore
Copy link
Contributor

Net_plugin has log message which use the word fork. This may cause unneeded alarm as many people associate fork with a divergence in block chain across nodes. This issue is a request to use a different noun in place of fork in net_plugin.

Example: updating chain info lib ${lib}, fork ${fork}

// call only from main application thread
void net_plugin_impl::update_chain_info() {
controller& cc = chain_plug->chain();
uint32_t lib_num = 0, head_num = 0;
{
fc::lock_guard g( chain_info_mtx );
chain_info.lib_id = cc.last_irreversible_block_id();
chain_info.lib_num = lib_num = block_header::num_from_id(chain_info.lib_id);
chain_info.head_id = cc.fork_db_head_block_id();
chain_info.head_num = head_num = block_header::num_from_id(chain_info.head_id);
}
fc_dlog( logger, "updating chain info lib ${lib}, fork ${fork}", ("lib", lib_num)("fork", head_num) );
}
// call only from main application thread
void net_plugin_impl::update_chain_info(const block_id_type& lib) {
controller& cc = chain_plug->chain();
uint32_t lib_num = 0, head_num = 0;
{
fc::lock_guard g( chain_info_mtx );
chain_info.lib_num = lib_num = block_header::num_from_id(lib);
chain_info.lib_id = lib;
chain_info.head_id = cc.fork_db_head_block_id();
chain_info.head_num = head_num = block_header::num_from_id(chain_info.head_id);
}
fc_dlog( logger, "updating chain info lib ${lib}, fork ${fork}", ("lib", lib_num)("fork", head_num) );
}

@heifner heifner self-assigned this Apr 26, 2024
@heifner heifner added the OCI Work exclusive to OCI team label Apr 26, 2024
heifner added a commit that referenced this issue Apr 26, 2024
IF: Avoid using fork in log messages that are not about micro-forks
@heifner heifner removed the triage label Apr 26, 2024
@heifner heifner closed this as completed Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants