Skip to content

wait until local p-chain has caught up with the p-chain height of inner VM blocks #3905

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yacovm
Copy link
Contributor

@yacovm yacovm commented Apr 21, 2025

Why this should be merged

How this works

How this was tested

Need to be documented in RELEASES.md?

@yacovm yacovm requested a review from StephenButtolph as a code owner April 21, 2025 19:24
@yacovm yacovm marked this pull request as draft April 21, 2025 19:25
for !vm.isLocalPlatformChainInSync() {
time.Sleep(pChainPostBootstrapSyncPollInterval)
}
scheduler.Dispatch(time.Now())
Copy link
Contributor

Choose a reason for hiding this comment

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

By deferring the call to Dispatch the scheduler is going to block upon calls to scheduler.SetBuildBlockTime. However, scheduler.SetBuildBlockTime is called with the context lock held in SetPreference.

I think that can cause a deadlock if we are unlucky enough for the P-chain to have caught back up before SetPreference is called but without isLocalPlatformChainInSync having returned true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, fixed.

@yacovm yacovm force-pushed the platformVMDispatch branch 7 times, most recently from 625b6dc to d302519 Compare April 21, 2025 22:13
…er VM blocks

Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
@yacovm yacovm force-pushed the platformVMDispatch branch from d302519 to 95f020b Compare April 21, 2025 22:36
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