chaincfg: Add AssumeValid param.
This introduces an AssumeValid parameter that is the hash of a block that has been externally verified to be valid. In a subsequent commit, it will be used to allow several validation checks to be skipped for blocks that are both an ancestor of the assumed valid block and an ancestor of the best header. Note that the AssumeValid block hash that is specified for mainnet and testnet is for the same block that was used for MinKnownChainWork. Using the same block for both of these slightly simplifies the process for external verification of the values when they are updated periodically with new releases.
This commit is contained in:
parent
3b8efba395
commit
583c8fdad0
@ -116,6 +116,16 @@ func MainNetParams() *Params {
|
||||
{601900, newHashFromStr("00000000000000001c1865a45a038bb680fc076d70cd88c1843e3e669cb54942")},
|
||||
},
|
||||
|
||||
// AssumeValid is the hash of a block that has been externally verified
|
||||
// to be valid. It allows several validation checks to be skipped for
|
||||
// blocks that are both an ancestor of the assumed valid block and an
|
||||
// ancestor of the best header. This is intended to be updated
|
||||
// periodically with new releases.
|
||||
//
|
||||
// Block 00000000000000001251efb83ad1a5c71351b50fe9195f009cf0bf5a7cd99d52
|
||||
// Height: 606000
|
||||
AssumeValid: *newHashFromStr("00000000000000001251efb83ad1a5c71351b50fe9195f009cf0bf5a7cd99d52"),
|
||||
|
||||
// MinKnownChainWork is the minimum amount of known total work for the
|
||||
// chain at a given point in time. This is intended to be updated
|
||||
// periodically with new releases.
|
||||
|
||||
@ -335,6 +335,13 @@ type Params struct {
|
||||
// will likely be changed to only allow a single checkpoint in the future.
|
||||
Checkpoints []Checkpoint
|
||||
|
||||
// AssumeValid is the hash of a block that has been externally verified to
|
||||
// be valid. It allows several validation checks to be skipped for blocks
|
||||
// that are both an ancestor of the assumed valid block and an ancestor of
|
||||
// the best header. This is intended to be updated periodically with new
|
||||
// releases. It may not be set for networks that do not require it.
|
||||
AssumeValid chainhash.Hash
|
||||
|
||||
// MinKnownChainWork is the minimum amount of known total work for the chain
|
||||
// at a given point in time. This is intended to be updated periodically
|
||||
// with new releases. It may be nil for networks that do not require it.
|
||||
|
||||
@ -112,6 +112,12 @@ func RegNetParams() *Params {
|
||||
// Checkpoints ordered from oldest to newest.
|
||||
Checkpoints: nil,
|
||||
|
||||
// AssumeValid is the hash of a block that has been externally verified
|
||||
// to be valid.
|
||||
//
|
||||
// Not set for regression test network since its chain is dynamic.
|
||||
AssumeValid: chainhash.Hash{},
|
||||
|
||||
// MinKnownChainWork is the minimum amount of known total work for the
|
||||
// chain at a given point in time.
|
||||
//
|
||||
|
||||
@ -111,6 +111,12 @@ func SimNetParams() *Params {
|
||||
// Checkpoints ordered from oldest to newest.
|
||||
Checkpoints: nil,
|
||||
|
||||
// AssumeValid is the hash of a block that has been externally verified
|
||||
// to be valid.
|
||||
//
|
||||
// Not set for simnet test network since its chain is dynamic.
|
||||
AssumeValid: chainhash.Hash{},
|
||||
|
||||
// MinKnownChainWork is the minimum amount of known total work for the
|
||||
// chain at a given point in time.
|
||||
//
|
||||
|
||||
@ -111,6 +111,16 @@ func TestNet3Params() *Params {
|
||||
{803810, newHashFromStr("000000016e841f4d94c3b253bc7bdf3a13217c7f28a5935bbaec37c7752678e9")},
|
||||
},
|
||||
|
||||
// AssumeValid is the hash of a block that has been externally verified
|
||||
// to be valid. It allows several validation checks to be skipped for
|
||||
// blocks that are both an ancestor of the assumed valid block and an
|
||||
// ancestor of the best header. This is intended to be updated
|
||||
// periodically with new releases.
|
||||
//
|
||||
// Block 00000000d64ceb1a686315ed56235e9a6838e3a22e9ec9bd92c2e04c09e0778b
|
||||
// Height: 807905
|
||||
AssumeValid: *newHashFromStr("00000000d64ceb1a686315ed56235e9a6838e3a22e9ec9bd92c2e04c09e0778b"),
|
||||
|
||||
// MinKnownChainWork is the minimum amount of known total work for the
|
||||
// chain at a given point in time. This is intended to be updated
|
||||
// periodically with new releases.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user