Reparameterize devnet

Replace stagenet parameters with new devnet parameters:

- Wallet prefix is now dV[123] for regular wallets, dV[ABC] for
  integrated addresses, and dV[abc] for subaddresses.  Wallet length is
  the same as testnet (i.e. 2 longer than mainnet).

- devnet has a single v7 genesis block (because change this is too
  intrusive) and then immediately jumps to v15 at height 2.

- Moved default ports from 3805x to 3885x (to avoid conflicting with
  potential existing stagenet daemons)

- DEVNET staking requirement is 1/10 of the mainnet requirement
  beginning at height 600000.  i.e. devnet staking requirement at height
  1234 == 1/10 of mainnet requirement at height 601234.  (This makes
  lets devnet test out the decreasing stake, which testnet's fixed
  requirement has never allowed).
This commit is contained in:
Jason Rhinelander 2020-08-11 18:47:19 -03:00
parent ef91df6af0
commit b664226d76
5 changed files with 25 additions and 24 deletions

View File

@ -90,12 +90,8 @@ static constexpr HardFork::Params testnet_hard_forks[] =
static constexpr HardFork::Params devnet_hard_forks[] =
{
{ network_version_7, 1, 0, 1341378000 },
{ network_version_8, 64324, 0, 1533006000 },
{ network_version_9_service_nodes, 96210, 0, 1536840000 },
{ network_version_10_bulletproofs, 96211, 0, 1536840120 },
{ network_version_11_infinite_staking, 147029, 0, 1551223964 }, // 2019-02-27 12:30 AEDT
{ network_version_12_checkpointing, 213125, 0, 1561608000 }, // 2019-06-28 14:00 AEDT
{ network_version_7, 1, 0, 1597170000 },
{ network_version_15_lns, 2, 0, 1597170000 }, // 2020-08-11 18:20 UTC
};
uint64_t HardFork::get_hardcoded_hard_fork_height(network_type nettype, cryptonote::network_version version)

View File

@ -268,26 +268,26 @@ namespace config
namespace devnet
{
inline constexpr uint64_t HEIGHT_ESTIMATE_HEIGHT = 339767;
inline constexpr time_t HEIGHT_ESTIMATE_TIMESTAMP = 1595360006;
inline constexpr uint64_t CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 24;
inline constexpr uint64_t CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 25;
inline constexpr uint64_t CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 36;
inline constexpr uint16_t P2P_DEFAULT_PORT = 38056;
inline constexpr uint16_t RPC_DEFAULT_PORT = 38057;
inline constexpr uint16_t ZMQ_RPC_DEFAULT_PORT = 38058;
inline constexpr uint16_t QNET_DEFAULT_PORT = 38059;
inline constexpr uint64_t HEIGHT_ESTIMATE_HEIGHT = 0;
inline constexpr time_t HEIGHT_ESTIMATE_TIMESTAMP = 1597170000;
inline constexpr uint64_t CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 3930; // ~ dV1 .. dV3
inline constexpr uint64_t CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 4442; // ~ dVA .. dVC
inline constexpr uint64_t CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 5850; // ~dVa .. dVc
inline constexpr uint16_t P2P_DEFAULT_PORT = 38856;
inline constexpr uint16_t RPC_DEFAULT_PORT = 38857;
inline constexpr uint16_t ZMQ_RPC_DEFAULT_PORT = 38858;
inline constexpr uint16_t QNET_DEFAULT_PORT = 38859;
inline constexpr boost::uuids::uuid const NETWORK_ID = { {
0xbb ,0x37, 0x9B, 0x22 , 0x0A, 0x66 , 0x69, 0x1E, 0x09, 0xB2, 0x97, 0x8A, 0xCC, 0xA1, 0xDF, 0x9C
} }; // Beep Boop
inline constexpr std::string_view GENESIS_TX = "021e01ff000380808d93f5d771027e4490431900c66a6532917ad9e6a1de634a209b708f653097e7b48efc1238c68080b4ccd4dfc60302ba19a224e6474371f9161b2e6271a36d060cbdc2e479ad78f1be64c56576fa07808088fccdbcc32302bccf9c13ba1b5bb02638de6e557acdd46bf48953e42cf98a12d2ad2900cc316121018fc6728d9e3c062d3afae3b2317998d2abee1e12f51271ba1c0d3cdd236b81d200"sv;
inline constexpr uint32_t GENESIS_NONCE = 10002;
0xa9, 0xf7, 0x5c, 0x7d, 0x55, 0x17, 0xcb, 0x6b, 0x5a, 0xf4, 0x63, 0x79, 0x7a, 0x57, 0xab, 0xd3
} };
inline constexpr std::string_view GENESIS_TX = "04011e1e01ff00018080c9db97f4fb2702fa27e905f604faa4eb084ee675faca77b0cfea9adec1526da33cae5e286f31624201dae05bf3fa1662b7fd373c92426763d921cf3745e10ee43edb510f690c656f247200000000000000000000000000000000000000000000000000000000000000000000"sv;
inline constexpr uint32_t GENESIS_NONCE = 12345;
inline constexpr uint64_t GOVERNANCE_REWARD_INTERVAL_IN_BLOCKS = ((60 * 60 * 24 * 7) / DIFFICULTY_TARGET_V2);
inline constexpr std::array GOVERNANCE_WALLET_ADDRESS =
{
"59f7FCwYMiwMnFr8HwsnfJ2hK3DYB1tryhjsfmXqEBJojKyqKeNWoaDaZaauoZPiZHUYp2wJuy5s9H96qy4q9xUVCXXHmTU"sv, // hardfork v7-9
"59f7FCwYMiwMnFr8HwsnfJ2hK3DYB1tryhjsfmXqEBJojKyqKeNWoaDaZaauoZPiZHUYp2wJuy5s9H96qy4q9xUVCXXHmTU"sv, // hardfork v10
"dV3EhSE1xXgSzswBgVioqFNTfcqGopvTrcYjs4YDLHUfU64DuHxFoEmbwoyipTidGiTXx5EuYdgzZhDLMTo9uEv82M4A7Uimp"sv, // hardfork v7-9
"dV3EhSE1xXgSzswBgVioqFNTfcqGopvTrcYjs4YDLHUfU64DuHxFoEmbwoyipTidGiTXx5EuYdgzZhDLMTo9uEv82M4A7Uimp"sv, // hardfork v10
};
}
}

View File

@ -16,6 +16,11 @@ uint64_t get_staking_requirement(cryptonote::network_type m_nettype, uint64_t he
if (m_nettype == cryptonote::TESTNET || m_nettype == cryptonote::FAKECHAIN)
return COIN * 100;
// For devnet we use the 10% of mainnet requirement at height (650k + H) so that we follow the
// same linear approximation but stay a bit ahead of it (devnet launched at ~600k mainnet height).
if (m_nettype == cryptonote::DEVNET)
return get_staking_requirement(cryptonote::MAINNET, 600000 + height, hf_version) / 10;
if (hf_version >= cryptonote::network_version_13_enforce_checkpoints)
{
constexpr int64_t heights[] = {
@ -71,7 +76,7 @@ uint64_t get_staking_requirement(cryptonote::network_type m_nettype, uint64_t he
return static_cast<uint64_t>(result);
}
uint64_t hardfork_height = m_nettype == cryptonote::MAINNET ? 101250 : 96210 /* stagenet */;
uint64_t hardfork_height = 101250;
if (height < hardfork_height) height = hardfork_height;
uint64_t height_adjusted = height - hardfork_height;

View File

@ -612,7 +612,7 @@ namespace nodetool
}
else if (nettype == cryptonote::DEVNET)
{
full_addrs.insert("159.69.109.145:38153");
full_addrs.insert("144.76.164.202:38856");
}
else if (nettype == cryptonote::FAKECHAIN)
{

View File

@ -4832,7 +4832,7 @@ void simple_wallet::on_money_received(uint64_t height, const crypto::hash &txid,
tr("idx ") << subaddr_index;
}
const uint64_t warn_height = m_wallet->nettype() == TESTNET ? 1000000 : m_wallet->nettype() == DEVNET ? 50000 : 1650000;
const uint64_t warn_height = m_wallet->nettype() == TESTNET ? 1000000 : m_wallet->nettype() == DEVNET ? 0 : 1650000;
if (height >= warn_height)
{
std::vector<tx_extra_field> tx_extra_fields;