Page MenuHomePhabricator

[avalanche] initialize g_avalanche after loading the block chain
ClosedPublic

Authored by PiRK on Jan 31 2023, 16:02.

Details

Summary

Initializing Avalanche requires the ChainstateManager to be initialized first. In a next commit, when backporting https://github.com/bitcoin/bitcoin/pull/22564/commits/5921b863e39e5c3997895ffee1c87159e37a5d6f, the chainman will be initialized after the loading of the block chain.

As far as I can tell this is OK because at this point the Avalanche event loop is not yet started, and the other components don't use g_avalanche or nLocalServices at this point. These objects are both used when the node is started at step 12.

Test Plan

ninja all check-all

Event Timeline

PiRK requested review of this revision.Jan 31 2023, 16:02
PiRK retitled this revision from initialize avalanche after loading the block chain to [avalanche] initialize g_avalanche after loading the block chain.
sdulfari added a subscriber: sdulfari.

Please monitor IBD test logs for network related messages that indicate Avalanche is not initialized. I don't expect them but let's be sure about it.

This revision is now accepted and ready to land.Jan 31 2023, 17:41

Avalanche started successfully after the IBD.