Debian Codegraph @

src/hardforks/hardforks.cpp

raw
1 // Copyright (c) 2014-2022, The Monero Project
2 //
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without modification, are
6 // permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice, this list of
9 // conditions and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 // of conditions and the following disclaimer in the documentation and/or other
13 // materials provided with the distribution.
14 //
15 // 3. Neither the name of the copyright holder nor the names of its contributors may be
16 // used to endorse or promote products derived from this software without specific
17 // prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 #include "hardforks.h"
30
31 #undef MONERO_DEFAULT_LOG_CATEGORY
32 #define MONERO_DEFAULT_LOG_CATEGORY "blockchain.hardforks"
33
34 const hardfork_t mainnet_hard_forks[] = {
35 // version 1 from the start of the blockchain
36 { 1, 1, 0, 1341378000 },
37
38 // version 2 starts from block 1009827, which is on or around the 20th of March, 2016. Fork time finalised on 2015-09-20. No fork voting occurs for the v2 fork.
39 { 2, 1009827, 0, 1442763710 },
40
41 // version 3 starts from block 1141317, which is on or around the 24th of September, 2016. Fork time finalised on 2016-03-21.
42 { 3, 1141317, 0, 1458558528 },
43
44 // version 4 starts from block 1220516, which is on or around the 5th of January, 2017. Fork time finalised on 2016-09-18.
45 { 4, 1220516, 0, 1483574400 },
46
47 // version 5 starts from block 1288616, which is on or around the 15th of April, 2017. Fork time finalised on 2017-03-14.
48 { 5, 1288616, 0, 1489520158 },
49
50 // version 6 starts from block 1400000, which is on or around the 16th of September, 2017. Fork time finalised on 2017-08-18.
51 { 6, 1400000, 0, 1503046577 },
52
53 // version 7 starts from block 1546000, which is on or around the 6th of April, 2018. Fork time finalised on 2018-03-17.
54 { 7, 1546000, 0, 1521303150 },
55
56 // version 8 starts from block 1685555, which is on or around the 18th of October, 2018. Fork time finalised on 2018-09-02.
57 { 8, 1685555, 0, 1535889547 },
58
59 // version 9 starts from block 1686275, which is on or around the 19th of October, 2018. Fork time finalised on 2018-09-02.
60 { 9, 1686275, 0, 1535889548 },
61
62 // version 10 starts from block 1788000, which is on or around the 9th of March, 2019. Fork time finalised on 2019-02-10.
63 { 10, 1788000, 0, 1549792439 },
64
65 // version 11 starts from block 1788720, which is on or around the 10th of March, 2019. Fork time finalised on 2019-02-15.
66 { 11, 1788720, 0, 1550225678 },
67
68 // version 12 starts from block 1978433, which is on or around the 30th of November, 2019. Fork time finalised on 2019-10-18.
69 { 12, 1978433, 0, 1571419280 },
70
71 { 13, 2210000, 0, 1598180817 },
72 { 14, 2210720, 0, 1598180818 },
73
74 { 15, 2688888, 0, 1656629117 },
75 { 16, 2689608, 0, 1656629118 },
76 };
77 const size_t num_mainnet_hard_forks = sizeof(mainnet_hard_forks) / sizeof(mainnet_hard_forks[0]);
78 const uint64_t mainnet_hard_fork_version_1_till = 1009826;
79
80 const hardfork_t testnet_hard_forks[] = {
81 // version 1 from the start of the blockchain
82 { 1, 1, 0, 1341378000 },
83
84 // version 2 starts from block 624634, which is on or around the 23rd of November, 2015. Fork time finalised on 2015-11-20. No fork voting occurs for the v2 fork.
85 { 2, 624634, 0, 1445355000 },
86
87 // versions 3-5 were passed in rapid succession from September 18th, 2016
88 { 3, 800500, 0, 1472415034 },
89 { 4, 801219, 0, 1472415035 },
90 { 5, 802660, 0, 1472415036 + 86400*180 }, // add 5 months on testnet to shut the update warning up since there's a large gap to v6
91
92 { 6, 971400, 0, 1501709789 },
93 { 7, 1057027, 0, 1512211236 },
94 { 8, 1057058, 0, 1533211200 },
95 { 9, 1057778, 0, 1533297600 },
96 { 10, 1154318, 0, 1550153694 },
97 { 11, 1155038, 0, 1550225678 },
98 { 12, 1308737, 0, 1569582000 },
99 { 13, 1543939, 0, 1599069376 },
100 { 14, 1544659, 0, 1599069377 },
101 { 15, 1982800, 0, 1652727000 },
102 { 16, 1983520, 0, 1652813400 },
103 };
104 const size_t num_testnet_hard_forks = sizeof(testnet_hard_forks) / sizeof(testnet_hard_forks[0]);
105 const uint64_t testnet_hard_fork_version_1_till = 624633;
106
107 const hardfork_t stagenet_hard_forks[] = {
108 // version 1 from the start of the blockchain
109 { 1, 1, 0, 1341378000 },
110
111 // versions 2-7 in rapid succession from March 13th, 2018
112 { 2, 32000, 0, 1521000000 },
113 { 3, 33000, 0, 1521120000 },
114 { 4, 34000, 0, 1521240000 },
115 { 5, 35000, 0, 1521360000 },
116 { 6, 36000, 0, 1521480000 },
117 { 7, 37000, 0, 1521600000 },
118 { 8, 176456, 0, 1537821770 },
119 { 9, 177176, 0, 1537821771 },
120 { 10, 269000, 0, 1550153694 },
121 { 11, 269720, 0, 1550225678 },
122 { 12, 454721, 0, 1571419280 },
123 { 13, 675405, 0, 1598180817 },
124 { 14, 676125, 0, 1598180818 },
125 { 15, 1151000, 0, 1656629117 },
126 { 16, 1151720, 0, 1656629118 },
127 };
128 const size_t num_stagenet_hard_forks = sizeof(stagenet_hard_forks) / sizeof(stagenet_hard_forks[0]);