-
Notifications
You must be signed in to change notification settings - Fork 220
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: fix new block handling of non-tip blocks #4431
fix: fix new block handling of non-tip blocks #4431
Conversation
4929a78
to
9b10919
Compare
error!(target: LOG_TARGET, "Failed to handle incoming block message: {:?}", e); | ||
match result { | ||
Err(BaseNodeServiceError::CommsInterfaceError(CommsInterfaceError::ChainStorageError( | ||
ChainStorageError::CannotAcquireFileLock, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error only happens when you startup a node with the same base dir - the db lockfile is present.
Cannot acquire exclusive file lock, another instance of the application is already running
Which error message are you trying to suppress?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, wrong error.
26c7cc9
to
ded0584
Compare
ded0584
to
d27fa3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the need for this special case. Surely the mempool check will perform the same logic?
Description
Currently, the base node cannot process a block that was received out of order (aka orphaned).
The
reconcile_block
function makes the assumption that the block is always on the current tip and tries to calculate the MMR roots of the block as a sanity check. The MMR roots can only be checked by a block that is built on the current local tip.This changes the
reconcile_block
function to first check orphan status, and if true, it will require the full block from the peer.This Pr also changes how the db lock is processed. Currently, it will print out a warn followed by an error. This suppresses the error and only prints the warn.
How Has This Been Tested?
Manual
Fixes: #4352