Page MenuHomePhabricator

[core#19011 2/3] Add BlockAndHeaderTipInfo to the node interface/appInit
ClosedPublic

Authored by PiRK on Jul 5 2021, 07:55.

Details

Summary

PR description:

During the GUI startup, there is currently an accumulation of cs_main locks due to setting initial chain state values at multiple locations (in the GUI main thread).

This PR tries to cache the initial chain state (tip height, tip time, best header, etc.) short after loading the blockindex.

The cached values are then used instead of fetching them again (and thus locking cs_main) during setting the client model.

This should fix the initial GUI blocking often experienced during or short after the splashscreen.

https://github.com/bitcoin/bitcoin/pull/19011/commits/b354a1480abbd71fb7fb82c39c81ea0644bbfce4

Add BlockAndHeaderTipInfo to the node interface/appInit

https://github.com/bitcoin/bitcoin/pull/19011/commits/d42cb790687788c78aa2f0c1988238ab52050782

Optionally populate BlockAndHeaderTipInfo during AppInitMain

This is a backport of core#19011 [2&3/4]
The commits needed squashing because the first one alone breaks the build.

Depends on D9734

Test Plan

ninja all check-all

Event Timeline

PiRK requested review of this revision.Jul 5 2021, 07:55
PiRK retitled this revision from Add BlockAndHeaderTipInfo to the node interface/appInit to [core#19011 2/3] Add BlockAndHeaderTipInfo to the node interface/appInit.Jul 5 2021, 07:58
This revision is now accepted and ready to land.Jul 5 2021, 15:01