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 reference to chain tip #632

Merged
merged 1 commit into from
Nov 22, 2019

Conversation

aguycalled
Copy link
Member

@aguycalled aguycalled commented Nov 17, 2019

Fixes #631

See issue for more details.

What to test

  • Launch a fully synced wallet with -reindex=1. Wallet should show a correct sync and state after reindexing.

@aguycalled
Copy link
Member Author

Tested and verified on my side.

@navbuilder
Copy link

A new build of ab2c02c has completed succesfully!
Binaries available at https://build.nav.community/binaries/early-coldstake-check

@aguycalled
Copy link
Member Author

aguycalled commented Nov 18, 2019

Confirmed fix in:

Ryzen 3900x 12 core, 64GB RAM CL16 DDR4-3600, 1TB NVMe SSD
Hackintosh with Catalina OSX.
Gitian build ab2c02c with no indexes

2019-11-18 10:03:24 Loaded 247977 blocks from external file in 38288ms
2019-11-18 10:03:24 Reindexing block file blk00001.dat...
2019-11-18 10:04:00 Loaded 229111 blocks from external file in 35588ms
2019-11-18 10:04:00 Reindexing block file blk00002.dat...
2019-11-18 10:04:33 Loaded 229827 blocks from external file in 33018ms
2019-11-18 10:04:33 Reindexing block file blk00003.dat...
2019-11-18 10:05:10 Loaded 259099 blocks from external file in 37421ms
2019-11-18 10:05:10 Reindexing block file blk00004.dat...
2019-11-18 10:05:53 Loaded 299808 blocks from external file in 42770ms
2019-11-18 10:05:53 Reindexing block file blk00005.dat...
2019-11-18 10:06:31 Loaded 263398 blocks from external file in 38159ms
2019-11-18 10:06:31 Reindexing block file blk00006.dat...
2019-11-18 10:07:03 Loaded 215858 blocks from external file in 31778ms
2019-11-18 10:07:03 Reindexing block file blk00007.dat...
2019-11-18 10:07:41 Loaded 257915 blocks from external file in 37733ms
2019-11-18 10:07:41 Reindexing block file blk00008.dat...
2019-11-18 10:08:23 Loaded 285377 blocks from external file in 41960ms
2019-11-18 10:08:23 Reindexing block file blk00009.dat...
2019-11-18 10:09:04 Loaded 292614 blocks from external file in 41951ms
2019-11-18 10:09:04 Reindexing block file blk00010.dat...
2019-11-18 10:09:36 Loaded 226356 blocks from external file in 31209ms
2019-11-18 10:09:36 Reindexing block file blk00011.dat...
2019-11-18 10:10:05 Loaded 197654 blocks from external file in 29140ms
2019-11-18 10:10:05 Reindexing block file blk00012.dat...
2019-11-18 10:10:34 Loaded 193039 blocks from external file in 28738ms
2019-11-18 10:10:34 Reindexing block file blk00013.dat...
2019-11-18 10:11:03 Loaded 214368 blocks from external file in 29104ms
2019-11-18 10:11:03 Reindexing block file blk00014.dat...
2019-11-18 10:11:34 Loaded 233480 blocks from external file in 31253ms
2019-11-18 10:11:34 Reindexing block file blk00015.dat...
2019-11-18 10:11:36 Loaded 13883 blocks from external file in 2006ms
2019-11-18 10:11:36 Reindexing finished
2019-11-18 10:11:36 Pre-allocating up to position 0x100000 in rev00000.dat

@chasingkirkjufell
Copy link
Contributor

Confirmed fix in:
Intel(R) i7-5820K 6 core, 64 GB RAM DDR4-2666 mSATA 500GB SSD
Windows 10 Pro
Gitian build ab2c02c with no indexes

Copy link
Contributor

@chasingkirkjufell chasingkirkjufell left a comment

Choose a reason for hiding this comment

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

Confirmed fix and cold-staking transaction correctly rejected before its activation on devnet

@proletesseract
Copy link
Member

proletesseract commented Nov 22, 2019

Built fine, on OSX using depends. Trying to reindex now.

What is the material difference in moving the cold staking check to ContextualCheckBlock rather than where it used to be in CheckBlock and using pindexPrev vs chainActive.Tip()

@mxaddict
Copy link
Contributor

@aguycalled I noticed that running -reindex=1 on the GUI wallet hangs the wallet.

Maybe we should have the re-index run on the splash screen?

@mxaddict
Copy link
Contributor

@aguycalled Is this normal?

2019-11-22 09:34:42 Loaded 248168 blocks from external file in 66481ms
2019-11-22 09:34:42 Reindexing block file blk00001.dat...
2019-11-22 09:35:41 Loaded 229165 blocks from external file in 59169ms
2019-11-22 09:35:41 Reindexing block file blk00002.dat...
2019-11-22 09:36:38 Loaded 229585 blocks from external file in 56184ms
2019-11-22 09:36:38 Reindexing block file blk00003.dat...
2019-11-22 09:37:47 Loaded 259107 blocks from external file in 69396ms
2019-11-22 09:37:47 Reindexing block file blk00004.dat...
2019-11-22 09:38:58 Loaded 299980 blocks from external file in 71071ms
2019-11-22 09:38:58 Reindexing block file blk00005.dat...
2019-11-22 09:40:04 Loaded 263250 blocks from external file in 66136ms
2019-11-22 09:40:04 Reindexing block file blk00006.dat...
2019-11-22 09:40:58 Loaded 215839 blocks from external file in 54109ms
2019-11-22 09:40:58 Reindexing block file blk00007.dat...
2019-11-22 09:42:13 INFO: Updating prices
2019-11-22 09:42:16 INFO: Updated prices
2019-11-22 09:42:20 Loaded 257070 blocks from external file in 81459ms
2019-11-22 09:42:20 Reindexing block file blk00008.dat...
2019-11-22 09:43:40 Loaded 286300 blocks from external file in 80140ms
2019-11-22 09:43:40 Reindexing block file blk00009.dat...
2019-11-22 09:44:50 Loaded 292554 blocks from external file in 69720ms
2019-11-22 09:44:50 Reindexing block file blk00010.dat...
2019-11-22 09:45:46 Loaded 226447 blocks from external file in 56297ms
2019-11-22 09:45:46 Reindexing block file blk00011.dat...
2019-11-22 09:46:34 Loaded 197691 blocks from external file in 48141ms
2019-11-22 09:46:34 Reindexing block file blk00012.dat...
2019-11-22 09:47:21 Loaded 192939 blocks from external file in 47162ms
2019-11-22 09:47:21 Reindexing block file blk00013.dat...
2019-11-22 09:48:13 Loaded 214344 blocks from external file in 51964ms
2019-11-22 09:48:13 Reindexing block file blk00014.dat...
2019-11-22 09:49:09 Loaded 233454 blocks from external file in 55334ms
2019-11-22 09:49:09 Reindexing block file blk00015.dat...
2019-11-22 09:49:14 Loaded 25054 blocks from external file in 5661ms
2019-11-22 09:49:14 Reindexing finished
2019-11-22 09:49:14 Pre-allocating up to position 0x100000 in rev00000.dat
2019-11-22 09:49:14 UpdateTip: new best=f73048d6e35d6af1ffe545cc8afbd3fe235b31fadc72e8639c7da5c195835d75 height=1 version=0x00000007 log2_work=17.000022 tx=2 date='2016-05-12 16:51:44' progress=0.000000 cache=0.0MiB(1tx)
2019-11-22 09:49:14 UpdateTip: new best=54dafdf7e67f00fd09e64ace51e26fb7e3fb2ade3865225b94e9601a3a24cc36 height=2 version=0x00000007 log2_work=17.584985 tx=3 date='2016-05-12 16:55:18' progress=0.000000 cache=0.0MiB(2tx)
2019-11-22 09:49:14 UpdateTip: new best=948af872d5c9e62196b231cbdc9e19c1f4b1a43c4bef901ada50d55e3417c22e height=3 version=0x00000007 log2_work=18.000022 tx=4 date='2016-05-12 16:55:25' progress=0.000000 cache=0.0MiB(3tx)
2019-11-22 09:49:14 UpdateTip: new best=0ae57a49a9d2bd55b18c399a8bb48a687b46e3472a7ae78f60bcdc68e6514cdc height=4 version=0x00000007 log2_work=18.33992 tx=5 date='2016-05-12 16:55:33' progress=0.000000 cache=0.0MiB(4tx)
2019-11-22 09:49:14 UpdateTip: new best=6947b438b13fb729ca69e72454816fe40019644c6d80cbd541df6425fbd114b7 height=5 version=0x00000007 log2_work=18.629698 tx=6 date='2016-05-12 16:55:39' progress=0.000000 cache=0.0MiB(5tx)

@mxaddict
Copy link
Contributor

It seems like after the re-index, it started syncing from genesis block (I think it's not syncing from network though)

@aguycalled
Copy link
Member Author

Yes. https://bitcoin.stackexchange.com/questions/60709/when-should-i-use-reindex-chainstate-and-when-reindex

Reindexing....Loaded... is related to the blockindex
UpdateTips related to the chainstate

@mxaddict mxaddict merged commit 2ad3391 into navcoin:master Nov 22, 2019
@proletesseract
Copy link
Member

I know this has already been merged, but I can confirm my node successfully reindexed overnight.

aguycalled pushed a commit to aguycalled/navcoin-core that referenced this pull request Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

-reindex corrupts the blockindex
5 participants