Page MenuHomePhabricator

Update chainparams
ClosedPublic

Authored by jasonbcox on Aug 8 2019, 18:41.

Details

Summary

See title.

Test Plan

make check
Check against your own nodes.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
chainparams
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7087
Build 12220: Bitcoin ABC Buildbot (legacy)
Build 12219: arc lint + arc unit

Event Timeline

Mengerian requested changes to this revision.Aug 8 2019, 19:31
Mengerian added a subscriber: Mengerian.

Seems strange that chainwork does not correspond to the block hashes used for assumevalid.

src/chainparams.cpp
108

Chain work does not seem to correspond to the block that's used for "assume valid".
I get:

{
  "hash": "00000000000000000351a488f34e8d5f4e215836fc6022ef271eb57024968eaa",
  "confirmations": 2048,
  "height": 592876,
  "version": 1073676288,
  "versionHex": "3fff0000",
  "merkleroot": "0e553351446894a9620269c5841b5aebc218f48f8e141c947baefd38839cbe47",
  "time": 1564064669,
  "mediantime": 1564059698,
  "nonce": 1902565215,
  "bits": "1803ffa7",
  "difficulty": 274967066174.277,
  "chainwork": "000000000000000000000000000000000000000000f61da43242c003a3d8df2b",
  "previousblockhash": "0000000000000000035f97312a126effa84809d56a9f58c76b0a7f5c96daa5d8",
  "nextblockhash": "000000000000000002a9ea9dc4e47c43546508de86d3f2aa1f388e4e7428483c"
}
271

The chainwork does not seem to match the "assume valid" block. I get:

{
  "hash": "000000000000074e1e01f86773c740a6ad576f253b26d3f337b4f07c4c5209d4",
  "confirmations": 5040,
  "height": 1315177,
  "version": 536870912,
  "versionHex": "20000000",
  "merkleroot": "db57ed3d01bdddac3cbd3d498018ec4cb340c2c425e142693d99f5957eba6c9e",
  "time": 1563269702,
  "mediantime": 1563267750,
  "nonce": 2197439365,
  "bits": "1a089431",
  "difficulty": 1955613.58986171,
  "chainwork": "000000000000000000000000000000000000000000000050e6a15628d3775625",
  "previousblockhash": "0000000000000101c2ad15ec95c785e9f8da71ff88a17a20d518c560fb1ade4f",
  "nextblockhash": "000000000000055501ec08df2b1411a1a9d3a64753fb77f0318789da27a211ac"
}
This revision now requires changes to proceed.Aug 8 2019, 19:31
jasonbcox requested review of this revision.EditedAug 8 2019, 19:35

The chainwork should be as high as the highest seen PoW and does not need to match the assume valid block. However, it should always be greater than the assume valid block, which is obvious. See D3732

The chainwork should be as high as the highest seen PoW and does not need to match the assume valid block. However, it should always be greater than the assume valid block, which is obvious. See D3732

In that case, it seems to be fine according to my local nodes.

I do find that this makes it difficult and confusing to verify manually though.

For example, the Upgrade testnet forks off the main testnet, and I am concerned that changing this parameter may mess with it. (Current value is fine, but it should be checked every time it is changed).

This revision is now accepted and ready to land.Aug 8 2019, 20:41

You can always change the minimum chainwork via command line if you want to switch chains.

This revision was automatically updated to reflect the committed changes.

Just to follow up, this did indeed break my testnet node's ability to sync to the fork testnet. I had to put minimumchainwork=0 in the bitcoin.conf so it would stop disconnecting imaginary_username's node with reason "Disconnecting outbound peer 51 -- headers chain has insufficient work"