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

Fix off by 1 when checking state_t heights causing sync failure #759

Merged
merged 1 commit into from Jul 25, 2019

Conversation

Doy-lee
Copy link
Collaborator

@Doy-lee Doy-lee commented Jul 23, 2019

Found when trying to sync mainnet and we fell onto a 3 block long alt-chain and try to reorg back to the canonical chain. The service node winner was reported incorrect because the service node list reverted 1 too many states.

Upon reconnecting with this fix, the canonical chain was rebroadcasted, detached hooks were called on service node list and correctly popped back to the right state and was able to sync back to the canonical chain.

@jagerman

std::vector<std::pair<cryptonote::blobdata, cryptonote::block>> blocks;
for (uint64_t i = 0; m_state.height < current_height; i++)
{
if (i > 0 && i % 10 == 0)
LOG_PRINT_L0("... scanning height " << m_state.height);
MGINFO("... scanning height " << m_state.height);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (and the Recalculataing message above) was a useful bit of log info to have at L0 for rescans, even with not running with any debugging, to let the user know a potentially long operation is actually doing something: particularly because while it happens everything else is locked out. In theory we ought to hit this much less, but even just 10k blocks could take a minute.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MGINFO always shows up at the default log level? My main concern here is that L0 prints as a warning. I added your suggestion that we store state 100 blocks back from the tip of the chain (in other PR) so keeping this as L0 would emit the message as a warning on startup every time which might concern operators.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, okay, I thought MGINFO was suppressed at default. Sounds good then.

@Doy-lee Doy-lee merged commit 05a7b97 into oxen-io:dev Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants