dcrd/params.go

54 lines
1.6 KiB
Go
Raw Normal View History

// Copyright (c) 2013-2016 The btcsuite developers
main: Update to use all new major module versions. This updates all code in the main module to use the latest major modules versions to pull in the latest updates. A more general high level overview of the changes is provided below, however, there is one semantic change worth calling out independently. The verifymessage RPC will now return an error when provided with an address that is not for the current active network and the RPC server version has been bumped accordingly. Previously, it would return false which indicated the signature is invalid, even when the provided signature was actually valid for the other network. Said behavior was not really incorrect since the address, signature, and message combination is in fact invalid for the current active network, however, that result could be somewhat misleading since a false result could easily be interpreted to mean the signature is actually invalid altogether which is distinct from the case of the address being for a different network. Therefore, it is preferable to explicitly return an error in the case of an address on the wrong network to cleanly separate these cases. The following is a high level overview of the changes: - Replace all calls to removed blockchain merkle root, pow, subsidy, and coinbase funcs with their standalone module equivalents - Introduce a new local func named calcTxTreeMerkleRoot that accepts dcrutil.Tx as before and defers to the new standalone func - Update block locator handling to match the new signature required by the peer/v2 module - Introduce a new local func named chainBlockLocatorToHashes which performs the necessary conversion - Update all references to old v1 chaincfg params global instances to use the new v2 functions - Modify all cases that parse addresses to provide the now required current network params - Include address params with the wsClientFilter - Replace removed v1 chaincfg constants with local constants - Create subsidy cache during server init and pass it to the relevant subsystems - blockManagerConfig - BlkTmplGenerator - rpcServer - VotingWallet - Update mining code that creates the block one coinbase transaction to create the output scripts as defined in the v2 params - Replace old v2 dcrjson constant references with new types module - Fix various comment typos - Update fees module to use the latest major module versions and bump it v2
2019-08-13 15:50:53 +00:00
// Copyright (c) 2015-2019 The Decred developers
2013-08-06 21:55:22 +00:00
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package main
import (
main: Update to use all new major module versions. This updates all code in the main module to use the latest major modules versions to pull in the latest updates. A more general high level overview of the changes is provided below, however, there is one semantic change worth calling out independently. The verifymessage RPC will now return an error when provided with an address that is not for the current active network and the RPC server version has been bumped accordingly. Previously, it would return false which indicated the signature is invalid, even when the provided signature was actually valid for the other network. Said behavior was not really incorrect since the address, signature, and message combination is in fact invalid for the current active network, however, that result could be somewhat misleading since a false result could easily be interpreted to mean the signature is actually invalid altogether which is distinct from the case of the address being for a different network. Therefore, it is preferable to explicitly return an error in the case of an address on the wrong network to cleanly separate these cases. The following is a high level overview of the changes: - Replace all calls to removed blockchain merkle root, pow, subsidy, and coinbase funcs with their standalone module equivalents - Introduce a new local func named calcTxTreeMerkleRoot that accepts dcrutil.Tx as before and defers to the new standalone func - Update block locator handling to match the new signature required by the peer/v2 module - Introduce a new local func named chainBlockLocatorToHashes which performs the necessary conversion - Update all references to old v1 chaincfg params global instances to use the new v2 functions - Modify all cases that parse addresses to provide the now required current network params - Include address params with the wsClientFilter - Replace removed v1 chaincfg constants with local constants - Create subsidy cache during server init and pass it to the relevant subsystems - blockManagerConfig - BlkTmplGenerator - rpcServer - VotingWallet - Update mining code that creates the block one coinbase transaction to create the output scripts as defined in the v2 params - Replace old v2 dcrjson constant references with new types module - Fix various comment typos - Update fees module to use the latest major module versions and bump it v2
2019-08-13 15:50:53 +00:00
"github.com/decred/dcrd/chaincfg/v2"
2013-08-06 21:55:22 +00:00
)
// activeNetParams is a pointer to the parameters specific to the
// currently active Decred network.
var activeNetParams = &mainNetParams
2013-08-06 21:55:22 +00:00
// params is used to group parameters for various networks such as the main
// network and test networks.
type params struct {
*chaincfg.Params
rpcPort string
2013-08-06 21:55:22 +00:00
}
// mainNetParams contains parameters specific to the main network
// (wire.MainNet). NOTE: The RPC port is intentionally different than the
// reference implementation because dcrd does not handle wallet requests. The
// separate wallet process listens on the well-known port and forwards requests
// it does not handle on to dcrd. This approach allows the wallet process
// to emulate the full reference implementation RPC API.
2013-08-06 21:55:22 +00:00
var mainNetParams = params{
main: Update to use all new major module versions. This updates all code in the main module to use the latest major modules versions to pull in the latest updates. A more general high level overview of the changes is provided below, however, there is one semantic change worth calling out independently. The verifymessage RPC will now return an error when provided with an address that is not for the current active network and the RPC server version has been bumped accordingly. Previously, it would return false which indicated the signature is invalid, even when the provided signature was actually valid for the other network. Said behavior was not really incorrect since the address, signature, and message combination is in fact invalid for the current active network, however, that result could be somewhat misleading since a false result could easily be interpreted to mean the signature is actually invalid altogether which is distinct from the case of the address being for a different network. Therefore, it is preferable to explicitly return an error in the case of an address on the wrong network to cleanly separate these cases. The following is a high level overview of the changes: - Replace all calls to removed blockchain merkle root, pow, subsidy, and coinbase funcs with their standalone module equivalents - Introduce a new local func named calcTxTreeMerkleRoot that accepts dcrutil.Tx as before and defers to the new standalone func - Update block locator handling to match the new signature required by the peer/v2 module - Introduce a new local func named chainBlockLocatorToHashes which performs the necessary conversion - Update all references to old v1 chaincfg params global instances to use the new v2 functions - Modify all cases that parse addresses to provide the now required current network params - Include address params with the wsClientFilter - Replace removed v1 chaincfg constants with local constants - Create subsidy cache during server init and pass it to the relevant subsystems - blockManagerConfig - BlkTmplGenerator - rpcServer - VotingWallet - Update mining code that creates the block one coinbase transaction to create the output scripts as defined in the v2 params - Replace old v2 dcrjson constant references with new types module - Fix various comment typos - Update fees module to use the latest major module versions and bump it v2
2019-08-13 15:50:53 +00:00
Params: chaincfg.MainNetParams(),
rpcPort: "9109",
2013-08-06 21:55:22 +00:00
}
// testNet3Params contains parameters specific to the test network (version 3)
// (wire.TestNet3).
var testNet3Params = params{
main: Update to use all new major module versions. This updates all code in the main module to use the latest major modules versions to pull in the latest updates. A more general high level overview of the changes is provided below, however, there is one semantic change worth calling out independently. The verifymessage RPC will now return an error when provided with an address that is not for the current active network and the RPC server version has been bumped accordingly. Previously, it would return false which indicated the signature is invalid, even when the provided signature was actually valid for the other network. Said behavior was not really incorrect since the address, signature, and message combination is in fact invalid for the current active network, however, that result could be somewhat misleading since a false result could easily be interpreted to mean the signature is actually invalid altogether which is distinct from the case of the address being for a different network. Therefore, it is preferable to explicitly return an error in the case of an address on the wrong network to cleanly separate these cases. The following is a high level overview of the changes: - Replace all calls to removed blockchain merkle root, pow, subsidy, and coinbase funcs with their standalone module equivalents - Introduce a new local func named calcTxTreeMerkleRoot that accepts dcrutil.Tx as before and defers to the new standalone func - Update block locator handling to match the new signature required by the peer/v2 module - Introduce a new local func named chainBlockLocatorToHashes which performs the necessary conversion - Update all references to old v1 chaincfg params global instances to use the new v2 functions - Modify all cases that parse addresses to provide the now required current network params - Include address params with the wsClientFilter - Replace removed v1 chaincfg constants with local constants - Create subsidy cache during server init and pass it to the relevant subsystems - blockManagerConfig - BlkTmplGenerator - rpcServer - VotingWallet - Update mining code that creates the block one coinbase transaction to create the output scripts as defined in the v2 params - Replace old v2 dcrjson constant references with new types module - Fix various comment typos - Update fees module to use the latest major module versions and bump it v2
2019-08-13 15:50:53 +00:00
Params: chaincfg.TestNet3Params(),
rpcPort: "19109",
}
// simNetParams contains parameters specific to the simulation test network
// (wire.SimNet).
var simNetParams = params{
main: Update to use all new major module versions. This updates all code in the main module to use the latest major modules versions to pull in the latest updates. A more general high level overview of the changes is provided below, however, there is one semantic change worth calling out independently. The verifymessage RPC will now return an error when provided with an address that is not for the current active network and the RPC server version has been bumped accordingly. Previously, it would return false which indicated the signature is invalid, even when the provided signature was actually valid for the other network. Said behavior was not really incorrect since the address, signature, and message combination is in fact invalid for the current active network, however, that result could be somewhat misleading since a false result could easily be interpreted to mean the signature is actually invalid altogether which is distinct from the case of the address being for a different network. Therefore, it is preferable to explicitly return an error in the case of an address on the wrong network to cleanly separate these cases. The following is a high level overview of the changes: - Replace all calls to removed blockchain merkle root, pow, subsidy, and coinbase funcs with their standalone module equivalents - Introduce a new local func named calcTxTreeMerkleRoot that accepts dcrutil.Tx as before and defers to the new standalone func - Update block locator handling to match the new signature required by the peer/v2 module - Introduce a new local func named chainBlockLocatorToHashes which performs the necessary conversion - Update all references to old v1 chaincfg params global instances to use the new v2 functions - Modify all cases that parse addresses to provide the now required current network params - Include address params with the wsClientFilter - Replace removed v1 chaincfg constants with local constants - Create subsidy cache during server init and pass it to the relevant subsystems - blockManagerConfig - BlkTmplGenerator - rpcServer - VotingWallet - Update mining code that creates the block one coinbase transaction to create the output scripts as defined in the v2 params - Replace old v2 dcrjson constant references with new types module - Fix various comment typos - Update fees module to use the latest major module versions and bump it v2
2019-08-13 15:50:53 +00:00
Params: chaincfg.SimNetParams(),
rpcPort: "19556",
}
multi: Resurrect regression network. This resurrects the regression test network that was removed before initial launch although it really should not have been. The simulation test network and the regression test network do not serve the same purpose. Specifically, the regression test network is intended for unit tests, RPC server tests, and consensus tests. On the other hand, the simulation test network is intended for private use within a group of individuals doing simulation testing and full integration tests between different applications such as wallets, voting service providers, mining pools, block explorers, and other services that build on Decred. Keeping the concerns separate will allow the simulation test network to be modified in ways such as activating consensus changes that have been successfully voted into mainnet without also needing to vote them in on the simulation test network while still preserving the ability for the unit tests to properly test the voting semantics and handling to help prevent regressions. In addition to resurrecting the regression test network, this also fully fleshes out new values for the various addresses prefixes (Rk, Rs, Re, etc), HD key prefixes (rprv, rpub), and treasury multisig details. As a part of resurrecting the network, a new CLI flag `--regnet` is added to allow the RPC test harness connect to a running instance, the areas of the code which involve votes have been modified to allow the votes to apply to the new network, and tests have been added to the relevant modules. This bumps the affected module versions as follows: - github.com/decred/dcrd/wire@v1.2.0 - github.com/decred/dcrd/chaincfg@v1.2.0 - github.com/decred/dcrd/dcrutil@v1.2.0 - github.com/decred/dcrd/hdkeychain@v1.1.1 The blockchain module is also affected, but since its version has already been bumped since the last release tag, it is not bumped again. Finally, this does not include switching unit tests or the RPC test harness over the new network since that will be done in a separate commit.
2018-10-05 04:46:56 +00:00
// regNetParams contains parameters specific to the regression test
// network (wire.RegNet).
var regNetParams = params{
main: Update to use all new major module versions. This updates all code in the main module to use the latest major modules versions to pull in the latest updates. A more general high level overview of the changes is provided below, however, there is one semantic change worth calling out independently. The verifymessage RPC will now return an error when provided with an address that is not for the current active network and the RPC server version has been bumped accordingly. Previously, it would return false which indicated the signature is invalid, even when the provided signature was actually valid for the other network. Said behavior was not really incorrect since the address, signature, and message combination is in fact invalid for the current active network, however, that result could be somewhat misleading since a false result could easily be interpreted to mean the signature is actually invalid altogether which is distinct from the case of the address being for a different network. Therefore, it is preferable to explicitly return an error in the case of an address on the wrong network to cleanly separate these cases. The following is a high level overview of the changes: - Replace all calls to removed blockchain merkle root, pow, subsidy, and coinbase funcs with their standalone module equivalents - Introduce a new local func named calcTxTreeMerkleRoot that accepts dcrutil.Tx as before and defers to the new standalone func - Update block locator handling to match the new signature required by the peer/v2 module - Introduce a new local func named chainBlockLocatorToHashes which performs the necessary conversion - Update all references to old v1 chaincfg params global instances to use the new v2 functions - Modify all cases that parse addresses to provide the now required current network params - Include address params with the wsClientFilter - Replace removed v1 chaincfg constants with local constants - Create subsidy cache during server init and pass it to the relevant subsystems - blockManagerConfig - BlkTmplGenerator - rpcServer - VotingWallet - Update mining code that creates the block one coinbase transaction to create the output scripts as defined in the v2 params - Replace old v2 dcrjson constant references with new types module - Fix various comment typos - Update fees module to use the latest major module versions and bump it v2
2019-08-13 15:50:53 +00:00
Params: chaincfg.RegNetParams(),
multi: Resurrect regression network. This resurrects the regression test network that was removed before initial launch although it really should not have been. The simulation test network and the regression test network do not serve the same purpose. Specifically, the regression test network is intended for unit tests, RPC server tests, and consensus tests. On the other hand, the simulation test network is intended for private use within a group of individuals doing simulation testing and full integration tests between different applications such as wallets, voting service providers, mining pools, block explorers, and other services that build on Decred. Keeping the concerns separate will allow the simulation test network to be modified in ways such as activating consensus changes that have been successfully voted into mainnet without also needing to vote them in on the simulation test network while still preserving the ability for the unit tests to properly test the voting semantics and handling to help prevent regressions. In addition to resurrecting the regression test network, this also fully fleshes out new values for the various addresses prefixes (Rk, Rs, Re, etc), HD key prefixes (rprv, rpub), and treasury multisig details. As a part of resurrecting the network, a new CLI flag `--regnet` is added to allow the RPC test harness connect to a running instance, the areas of the code which involve votes have been modified to allow the votes to apply to the new network, and tests have been added to the relevant modules. This bumps the affected module versions as follows: - github.com/decred/dcrd/wire@v1.2.0 - github.com/decred/dcrd/chaincfg@v1.2.0 - github.com/decred/dcrd/dcrutil@v1.2.0 - github.com/decred/dcrd/hdkeychain@v1.1.1 The blockchain module is also affected, but since its version has already been bumped since the last release tag, it is not bumped again. Finally, this does not include switching unit tests or the RPC test harness over the new network since that will be done in a separate commit.
2018-10-05 04:46:56 +00:00
rpcPort: "18656",
}