Skip to content

[Chain] Eliminate unnecessary overhead testing for stale block indexes.#1023

Merged
seanPhill merged 1 commit intoVeil-Project:masterfrom
barrystyle:reduce_stale_blockindex_checks
Dec 21, 2022
Merged

[Chain] Eliminate unnecessary overhead testing for stale block indexes.#1023
seanPhill merged 1 commit intoVeil-Project:masterfrom
barrystyle:reduce_stale_blockindex_checks

Conversation

@barrystyle
Copy link

Stale block indexes will only occur if the chaintip gets thrashed around aggressively, or during extended periods of minting; never during InitialBlockDownload and even then this only needs to be checked periodically.

Performance increase during block synchronization is very noticeable once applied.

@seanPhill
Copy link
Collaborator

It does seem to be faster syncing (testnet), but I haven't tested and timed a full sync yet.

@seanPhill
Copy link
Collaborator

I got about a block per 0.1 seconds syncing 4000 blocks on mainnet on a late-2013 iMac.

@seanPhill
Copy link
Collaborator

Syncing 10001 mainnet blocks on a late-2013 Mac Pro, with threadbatchverify=4 also yielded close to a tenth of a second per block, in about 20 minutes.

2022-12-20T03:15:16Z UpdateTip: new best=2b5b20c22072ad49d685332652207f4d84f50207999b2af4047eb5bf8557227a height=2043182 type=PoS version=0x30000000 tx=4293744 date='2022-12-13T03:14:36Z' cache=2.6MiB(15813txo)

2022-12-20T03:35:15Z UpdateTip: new best=40ea16b029bf674318948e7e18218a18a93fe2164582149fb17685c0cebd0a41 height=2053183 type=PoS version=0x30000000 tx=4311996 date='2022-12-20T03:35:25Z' cache=6.5MiB(39697txo)

10,001 blocks synced in 20 minutes (minus one second)

1199 seconds for 1000 blocks

1199/10001=0.11988801 seconds per block

@seanPhill
Copy link
Collaborator

I am recommending people try this PR when syncing, and to let us know how it goes.

Copy link
Collaborator

@Zannick Zannick left a comment

Choose a reason for hiding this comment

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

utACK 9ffd9f1

Code looks good.

@seanPhill seanPhill added the QA: Passed This has passed QA testing and can be merged to master label Dec 21, 2022
@seanPhill seanPhill merged commit 002ba9d into Veil-Project:master Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA: Passed This has passed QA testing and can be merged to master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants