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: blocked mnlistdiff processing #263

Merged
merged 5 commits into from
Nov 26, 2024

Conversation

HashEngineering
Copy link
Collaborator

Issue being fixed or feature implemented

What was done?

How Has This Been Tested?

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@HashEngineering HashEngineering self-assigned this Nov 20, 2024
Comment on lines -124 to -129
long newHeight = ((CoinbaseTx) mnlistdiff.coinBaseTx.getExtraPayloadObject()).getHeight();
block = blockChain.getBlock(mnlistdiff.getBlockHash());

if(!isLoadingBootStrap && block.getHeight() != newHeight)
throw new ProtocolException("mnlistdiff blockhash (height="+block.getHeight()+" doesn't match coinbase blockheight: " + newHeight);

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

        block = blockChain.getBlock(mnlistdiff.getBlockHash());

Based on the logs, this line of code was probably taking too long. We don't really need it because if the block heights don't match, then neither will the block hashes which will be discovered later in the code.

Comment on lines -268 to -288
// TODO: Remove with v21.0.1
if (lock.isLocked()) {
log.warn("the lock is held. holdCount {}, queue length {}, held by this thread {}", lock.getHoldCount(), lock.getQueueLength(), lock.isHeldByCurrentThread());
log.warn("the current thread is {} with stack trace:", Thread.currentThread().getName());
StackTraceElement [] trace = lock.getOwner().getStackTrace();
for (StackTraceElement e : trace) {
log.info(" {}", e);
}
log.warn("the lock is held by {} with stack trace:", lock.getOwner());
trace = lock.getOwner().getStackTrace();
for (StackTraceElement e : trace) {
log.info(" {}", e);
}
for (Thread thread : lock.getQueuedThreads()) {
log.info("queued thread: {}\n stack trace:", thread.getName());
trace = thread.getStackTrace();
for (StackTraceElement e : trace) {
log.info(" {}", e);
}
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't need this deadlock detector anymore.

Copy link
Member

@Syn-McJ Syn-McJ left a comment

Choose a reason for hiding this comment

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

Looks good

@HashEngineering HashEngineering merged commit 28e631e into master Nov 26, 2024
5 checks passed
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.

2 participants