diff --git a/BCH release table.md b/BCH release table.md index 7ac52d52f..bad657dcc 100644 --- a/BCH release table.md +++ b/BCH release table.md @@ -11,8 +11,8 @@ Date Knuth name BCHN name Timestamp 2023-May-15 Descartes Upgrade9 1684152000 2024-May-15 Lobachevski Upgrade10 1715774400 2025-May-15 Galois Upgrade11 1747310400 +2026-May-15 Leibniz Upgrade12 1778846400 -????-???-?? Leibniz ? ? ????-???-?? Cantor ? ? ????-???-?? Peano ? ? ????-???-?? Hilbert ? ? diff --git a/ci_utils b/ci_utils index 559f39af4..86e9d3f49 160000 --- a/ci_utils +++ b/ci_utils @@ -1 +1 @@ -Subproject commit 559f39af4e00ad2e00a39bb3b23a922a1ca03861 +Subproject commit 86e9d3f49557ac49f7b06232f9fff2884436736f diff --git a/conan.lock b/conan.lock index 585ff5387..e644140e6 100644 --- a/conan.lock +++ b/conan.lock @@ -1,11 +1,12 @@ { "version": "0.5", "requires": [ - "zlib/1.2.13#e377bee636333ae348d51ca90874e353%1682597484.674", + "zlib/1.3#06023034579559bb64357db3a53f88a4%1692672716.907", "spdlog/1.13.0#2775cc949e26b339029a852785b6b276%1705707717.233", "secp256k1/0.18.0#c2e7e05855c71cb8f4e350a7aa10bfa9%1698921631.178", + "libiconv/1.17#fa54397801cd96911a8294bc5fc76335%1675449822.495", "libbacktrace/cci.20210118#ec1aa63bbc10145c6a299e68e711670c%1676205469.545", - "infrastructure/0.32.0#ca438a22e0ec5b0e3f3bfe421227e761%1706979702.4233263", + "infrastructure/0.32.0#ca438a22e0ec5b0e3f3bfe421227e761%1706978102.691", "gmp/6.3.0#df20ffb6d21c34d67704305bcd1dea9e%1698225617.026", "fmt/10.2.1#9199a7a0611866dea5c8849a77467b25%1704415120.216", "expected-lite/0.6.3#262026767cf9d5ab1fdccb25c9bdbac2%1692807329.641", @@ -14,8 +15,9 @@ "boost/1.84.0#695713218cdeec6aef61de1f34bf57ee%1706382844.645" ], "build_requires": [ - "m4/1.4.19#c1c4b1ee919e34630bb9b50046253d3c%1676610086.39", + "m4/1.4.19#b38ced39a01e31fef5435bc634461fd2%1700758725.451", "b2/4.10.1#8dc3df1cc73ad65d86cbdfd31fdb011f%1690006205.975" ], - "python_requires": [] + "python_requires": [], + "config_requires": [] } \ No newline at end of file diff --git a/conanfile.py b/conanfile.py index 022f7de6d..916716c09 100644 --- a/conanfile.py +++ b/conanfile.py @@ -61,7 +61,7 @@ class KnuthDomainConan(KnuthConanFileV2): def build_requirements(self): if self.options.tests: - self.test_requires("catch2/3.5.2") + self.test_requires("catch2/3.6.0") def requirements(self): self.requires("infrastructure/0.32.0", transitive_headers=True, transitive_libs=True) diff --git a/include/kth/domain/chain/chain_state.hpp b/include/kth/domain/chain/chain_state.hpp index e406f1d2e..9f1965ab9 100644 --- a/include/kth/domain/chain/chain_state.hpp +++ b/include/kth/domain/chain/chain_state.hpp @@ -142,8 +142,9 @@ class KD_API chain_state { // , euler_t euler_activation_time // , gauss_t gauss_activation_time // , descartes_t descartes_activation_time - , lobachevski_t lobachevski_activation_time + // , lobachevski_t lobachevski_activation_time , galois_t galois_activation_time + , leibniz_t leibniz_activation_time #endif //KTH_CURRENCY_BCH ); @@ -220,11 +221,14 @@ class KD_API chain_state { // [[nodiscard]] // descartes_t descartes_activation_time() const; - [[nodiscard]] - lobachevski_t lobachevski_activation_time() const; + // [[nodiscard]] + // lobachevski_t lobachevski_activation_time() const; [[nodiscard]] galois_t galois_activation_time() const; + + [[nodiscard]] + leibniz_t leibniz_activation_time() const; #endif //KTH_CURRENCY_BCH /// Construction with zero height or any empty array causes invalid state. @@ -287,6 +291,9 @@ class KD_API chain_state { [[nodiscard]] bool is_galois_enabled() const; + [[nodiscard]] + bool is_leibniz_enabled() const; + #endif //KTH_CURRENCY_BCH static @@ -312,8 +319,9 @@ class KD_API chain_state { // , euler_t euler_activation_time // , gauss_t gauss_activation_time // , descartes_t descartes_activation_time - , lobachevski_t lobachevski_activation_time + // , lobachevski_t lobachevski_activation_time , galois_t galois_activation_time + , leibniz_t leibniz_activation_time #endif //KTH_CURRENCY_BCH ); @@ -323,8 +331,9 @@ class KD_API chain_state { // , euler_t euler_activation_time // , gauss_t gauss_activation_time // , descartes_t descartes_activation_time - , lobachevski_t lobachevski_activation_time + // , lobachevski_t lobachevski_activation_time , galois_t galois_activation_time + , leibniz_t leibniz_activation_time , assert_anchor_block_info_t const& assert_anchor_block_info , uint32_t asert_half_life #endif @@ -356,6 +365,7 @@ class KD_API chain_state { size_t bip9_bit1_height(size_t height, uint32_t forks); #endif +public: // static // bool is_rule_enabled(size_t height, uint32_t forks, size_t mainnet_height, size_t testnet_height); static @@ -404,14 +414,19 @@ class KD_API chain_state { static bool is_descartes_enabled(size_t height, config::network network); - // static - // bool is_lobachevski_enabled(size_t height, config::network network); + static + bool is_lobachevski_enabled(size_t height, config::network network); // static // bool is_galois_enabled(size_t height, config::network network); + + // static + // bool is_leibniz_enabled(size_t height, config::network network); + #endif // KTH_CURRENCY_BCH // ------------------------------------------------------------------------ +private: static data to_block(chain_state const& pool, block const& block); @@ -492,8 +507,9 @@ class KD_API chain_state { // euler_t const euler_activation_time_; // gauss_t const gauss_activation_time_; // descartes_t const descartes_activation_time_; - lobachevski_t const lobachevski_activation_time_; + // lobachevski_t const lobachevski_activation_time_; galois_t const galois_activation_time_; + leibniz_t const leibniz_activation_time_; #endif //KTH_CURRENCY_BCH }; diff --git a/include/kth/domain/chain/token_data.hpp b/include/kth/domain/chain/token_data.hpp index 0f6de47d3..0a1453382 100644 --- a/include/kth/domain/chain/token_data.hpp +++ b/include/kth/domain/chain/token_data.hpp @@ -13,6 +13,7 @@ #include #include #include +#include // for __cpp_lib_three_way_comparison #include #include @@ -37,7 +38,7 @@ template inline constexpr bool always_false_v = false; namespace encoding { static constexpr uint8_t PREFIX_BYTE = uint8_t(::kth::domain::machine::opcode::special_token_prefix); -} +} // namespace encoding using token_id_t = hash_digest; enum class amount_t : int64_t {}; @@ -54,44 +55,43 @@ using commitment_t = std::vector; // #endif //TODO(fernando): move to a helper library -#if __cpp_lib_three_way_comparison < 201907L -template //, typename Cmp> -constexpr -// auto lexicographical_compare_three_way(I1 f1, I1 l1, I2 f2, I2 l2, Cmp comp) { //-> decltype(comp(*f1, *f2)) { -auto lexicographical_compare_three_way(I1 f1, I1 l1, I2 f2, I2 l2) { //-> decltype(comp(*f1, *f2)) { - // using ret_t = decltype(comp(*f1, *f2)); - using ret_t = decltype(*f1 <=> *f2); - static_assert(std::disjunction_v< - std::is_same, - std::is_same, - std::is_same>, - "The return type must be a comparison category type."); - - bool exhaust1 = (f1 == l1); - bool exhaust2 = (f2 == l2); - for (; !exhaust1 && !exhaust2; exhaust1 = (++f1 == l1), exhaust2 = (++f2 == l2)) { - // if (auto c = comp(*f1, *f2); c != 0) { - if (auto c = *f1 <=> *f2; c != 0) { - return c; - } - } - - return !exhaust1 ? std::strong_ordering::greater: - !exhaust2 ? std::strong_ordering::less: - std::strong_ordering::equal; -} - -constexpr -auto operator<=>(commitment_t const& x, commitment_t const& y) { - return lexicographical_compare_three_way(x.begin(), x.end(), y.begin(), y.end()); -} - -constexpr -auto operator<=>(token_id_t const& x, token_id_t const& y) { - return lexicographical_compare_three_way(x.begin(), x.end(), y.begin(), y.end()); -} -#endif - +// #if __cpp_lib_three_way_comparison < 201907L +// template //, typename Cmp> +// constexpr +// // auto lexicographical_compare_three_way(I1 f1, I1 l1, I2 f2, I2 l2, Cmp comp) { //-> decltype(comp(*f1, *f2)) { +// auto lexicographical_compare_three_way(I1 f1, I1 l1, I2 f2, I2 l2) { //-> decltype(comp(*f1, *f2)) { +// // using ret_t = decltype(comp(*f1, *f2)); +// using ret_t = decltype(*f1 <=> *f2); +// static_assert(std::disjunction_v< +// std::is_same, +// std::is_same, +// std::is_same>, +// "The return type must be a comparison category type."); + +// bool exhaust1 = (f1 == l1); +// bool exhaust2 = (f2 == l2); +// for (; !exhaust1 && !exhaust2; exhaust1 = (++f1 == l1), exhaust2 = (++f2 == l2)) { +// // if (auto c = comp(*f1, *f2); c != 0) { +// if (auto c = *f1 <=> *f2; c != 0) { +// return c; +// } +// } + +// return !exhaust1 ? std::strong_ordering::greater: +// !exhaust2 ? std::strong_ordering::less: +// std::strong_ordering::equal; +// } + +// constexpr +// auto operator<=>(commitment_t const& x, commitment_t const& y) { +// return lexicographical_compare_three_way(x.begin(), x.end(), y.begin(), y.end()); +// } + +// constexpr +// auto operator<=>(token_id_t const& x, token_id_t const& y) { +// return lexicographical_compare_three_way(x.begin(), x.end(), y.begin(), y.end()); +// } +// #endif // __cpp_lib_three_way_comparison // The values assigned to the low-order nibble of the bitfield byte represent the "permissions" of an NFT. // For pure-fungible tokens, the value must be none (0x0). @@ -102,7 +102,6 @@ enum class capability_t : uint8_t { minting = 0x02, // If the minting capability is present, it indicates that the encoded token is a non-fungible token used for minting. }; - struct fungible { amount_t amount; diff --git a/include/kth/domain/config/parser.hpp b/include/kth/domain/config/parser.hpp index 1bfb9d47a..4ccab085c 100644 --- a/include/kth/domain/config/parser.hpp +++ b/include/kth/domain/config/parser.hpp @@ -321,12 +321,17 @@ kth::infrastructure::config::checkpoint::list default_checkpoints(config::networ checkpoints.emplace_back("000000000000000002fc0cdadaef1857bbd2936d37ea94f80ba3db4a5e8353e8", 792773); checkpoints.emplace_back("00000000000000000340a607ca5e9a8b56b620297216edb818eb09e3c6e95609", 792774); - // //2024-May Hardfork - lobachevski - (1715774400) + //2024-May Hardfork - lobachevski - (1715774400) + checkpoints.emplace_back("000000000000000001806bcdde19c47f088a8026e24905ac6f75afe3ef83594c", 845'890); + checkpoints.emplace_back("0000000000000000017012058e7b67032926f1f20f96d1a2cd66abff9aaf8244", 845'891); + checkpoints.emplace_back("0000000000000000016e3353d5da435ef5d374abe90d9bb430c0408e423632d5", 845'892); + + // //2025-May Hardfork - galois - (1747310400) // checkpoints.emplace_back("", 0); // checkpoints.emplace_back("", 0); // checkpoints.emplace_back("", 0); - // //2025-May Hardfork - galois - (1747310400) + // //2026-May Hardfork - leibniz - (1778846400) // checkpoints.emplace_back("", 0); // checkpoints.emplace_back("", 0); // checkpoints.emplace_back("", 0); diff --git a/include/kth/domain/constants/bch.hpp b/include/kth/domain/constants/bch.hpp index 70bd27af4..83a2cd9e0 100644 --- a/include/kth/domain/constants/bch.hpp +++ b/include/kth/domain/constants/bch.hpp @@ -85,8 +85,9 @@ const infrastructure::config::checkpoint chipnet_bip34_active_checkpoint { // enum class euler_t : uint64_t {}; // enum class gauss_t : uint64_t {}; // enum class descartes_t : uint64_t {}; -enum class lobachevski_t : uint64_t {}; +// enum class lobachevski_t : uint64_t {}; enum class galois_t : uint64_t {}; +enum class leibniz_t : uint64_t {}; enum class unnamed_t : uint64_t {}; //TODO(fernando): rename it // constexpr size_t bch_activation_height = 478559 //478558; // 2017-Aug-01 HF @@ -100,8 +101,9 @@ enum class unnamed_t : uint64_t {}; //TODO(fernando): rename it // 2021-May-15 (skipped, not a HF) // constexpr gauss_t bch_gauss_activation_time{1652616000}; // 2022-May-15 HF // constexpr descartes_t bch_descartes_activation_time{1684152000}; // 2023-May-15 HF -constexpr lobachevski_t bch_lobachevski_activation_time{1715774400}; // 2024-May-15 HF -constexpr galois_t bch_galois_activation_time{1747310400}; // 2025-May-15 HF +// constexpr lobachevski_t bch_lobachevski_activation_time{1715774400}; // 2024-May-15 HF +constexpr galois_t bch_galois_activation_time{1747310400}; // 2025-May-15 HF +constexpr leibniz_t bch_leibniz_activation_time{1778846400}; // 2026-May-15 HF // Block height at which CSV (BIP68, BIP112 and BIP113) becomes active @@ -212,12 +214,26 @@ constexpr size_t testnet4_descartes_activation_height = 95'465; //FIXME(fern constexpr size_t scalenet_descartes_activation_height = 10'007; //FIXME(fernando): check this constexpr size_t chipnet_descartes_activation_height = 95'465; //FIXME(fernando): check this -// //2024-May hard fork -// constexpr size_t mainnet_lobachevski_activation_height = ???; -// constexpr size_t testnet_lobachevski_activation_height = ???; -// constexpr size_t testnet4_lobachevski_activation_height = ???; -// constexpr size_t scalenet_lobachevski_activation_height = ???; -// constexpr size_t chipnet_lobachevski_activation_height = ???; +//2024-May hard fork +constexpr size_t mainnet_lobachevski_activation_height = 845'891; +constexpr size_t testnet_lobachevski_activation_height = 1'500'206; //FIXME(fernando): check this +constexpr size_t testnet4_lobachevski_activation_height = 95'465; //FIXME(fernando): check this +constexpr size_t scalenet_lobachevski_activation_height = 10'007; //FIXME(fernando): check this +constexpr size_t chipnet_lobachevski_activation_height = 95'465; //FIXME(fernando): check this + +// //2025-May hard fork +// constexpr size_t mainnet_galois_activation_height = ???; +// constexpr size_t testnet_galois_activation_height = ???; +// constexpr size_t testnet4_galois_activation_height = ???; +// constexpr size_t scalenet_galois_activation_height = ???; +// constexpr size_t chipnet_galois_activation_height = ???; + +// //2026-May hard fork +// constexpr size_t mainnet_leibniz_activation_height = ???; +// constexpr size_t testnet_leibniz_activation_height = ???; +// constexpr size_t testnet4_leibniz_activation_height = ???; +// constexpr size_t scalenet_leibniz_activation_height = ???; +// constexpr size_t chipnet_leibniz_activation_height = ???; } // namespace kth diff --git a/include/kth/domain/machine/rule_fork.hpp b/include/kth/domain/machine/rule_fork.hpp index 114158211..235f00b43 100644 --- a/include/kth/domain/machine/rule_fork.hpp +++ b/include/kth/domain/machine/rule_fork.hpp @@ -59,7 +59,8 @@ enum rule_fork : uint32_t { bch_descartes = 1U << 20, //2023-May Hardfork - descartes - (1684152000) bch_lobachevski = 1U << 21, //2024-May Hardfork - lobachevski - (1715774400) bch_galois = 1U << 22, //2025-May Hardfork - galois - (1747310400) - // bch_unnamed = 1U << 23, //2026-May Hardfork - unnamed - (9999999999) + bch_leibniz = 1U << 23, //2025-May Hardfork - leibniz - (1778846400) + // bch_unnamed = 1U << 24, //2026-May Hardfork - unnamed - (9999999999) #else // Just for segwit coins /// Segregated witness consensus layer (soft fork, feature). diff --git a/src/chain/chain_state.cpp b/src/chain/chain_state.cpp index 1e2d19d9c..51a3771f1 100644 --- a/src/chain/chain_state.cpp +++ b/src/chain/chain_state.cpp @@ -53,8 +53,9 @@ chain_state::chain_state(data&& values, uint32_t forks, checkpoints const& check // , euler_t euler_activation_time // , gauss_t gauss_activation_time // , descartes_t descartes_activation_time - , lobachevski_t lobachevski_activation_time + // , lobachevski_t lobachevski_activation_time , galois_t galois_activation_time + , leibniz_t leibniz_activation_time #endif //KTH_CURRENCY_BCH ) : data_(std::move(values)) @@ -73,8 +74,9 @@ chain_state::chain_state(data&& values, uint32_t forks, checkpoints const& check // , euler_activation_time // , gauss_activation_time // , descartes_activation_time - , lobachevski_activation_time + // , lobachevski_activation_time , galois_activation_time + , leibniz_activation_time #endif //KTH_CURRENCY_BCH )) , median_time_past_(median_time_past(data_)) @@ -83,8 +85,9 @@ chain_state::chain_state(data&& values, uint32_t forks, checkpoints const& check // , euler_activation_time // , gauss_activation_time // , descartes_activation_time - , lobachevski_activation_time + // , lobachevski_activation_time , galois_activation_time + , leibniz_activation_time , assert_anchor_block_info_ , asert_half_life #endif @@ -99,8 +102,9 @@ chain_state::chain_state(data&& values, uint32_t forks, checkpoints const& check // , euler_activation_time_(euler_activation_time) // , gauss_activation_time_(gauss_activation_time) // , descartes_activation_time_(descartes_activation_time) - , lobachevski_activation_time_(lobachevski_activation_time) + // , lobachevski_activation_time_(lobachevski_activation_time) , galois_activation_time_(galois_activation_time) + , leibniz_activation_time_(leibniz_activation_time) #endif //KTH_CURRENCY_BCH {} @@ -128,8 +132,9 @@ std::shared_ptr chain_state::from_pool_ptr(chain_state const& pool, // , pool.euler_activation_time_ // , pool.gauss_activation_time_ // , pool.descartes_activation_time_ - , pool.lobachevski_activation_time_ + // , pool.lobachevski_activation_time_ , pool.galois_activation_time_ + , pool.leibniz_activation_time_ #endif //KTH_CURRENCY_BCH ); } @@ -299,42 +304,51 @@ bool chain_state::is_mtp_activated(uint32_t median_time_past, uint32_t activatio return (median_time_past >= activation_time); } +// 2018-May bool chain_state::is_pythagoras_enabled() const { return is_pythagoras_enabled(height(), network()); } +// 2018-Nov bool chain_state::is_euclid_enabled() const { return is_euclid_enabled(height(), network()); } +// 2019-May bool chain_state::is_pisano_enabled() const { return is_pisano_enabled(height(), network()); } +// 2019-Nov bool chain_state::is_mersenne_enabled() const { return is_mersenne_enabled(height(), network()); } +// 2020-May bool chain_state::is_fermat_enabled() const { return is_fermat_enabled(height(), network()); } +// 2020-Nov bool chain_state::is_euler_enabled() const { return is_euler_enabled(height(), network()); } +// 2021-May: There were no hard forks in 2021 + +// 2022-May bool chain_state::is_gauss_enabled() const { return is_gauss_enabled(height(), network()); } +// 2023-May bool chain_state::is_descartes_enabled() const { return is_descartes_enabled(height(), network()); } +// 2024-May bool chain_state::is_lobachevski_enabled() const { - //TODO(fernando): this was activated, change to the other method - return is_mtp_activated(median_time_past(), to_underlying(lobachevski_activation_time())); - // return is_lobachevski_enabled(height(), network()); + return is_lobachevski_enabled(height(), network()); } // 2025-May @@ -345,6 +359,13 @@ bool chain_state::is_galois_enabled() const { } // 2026-May +bool chain_state::is_leibniz_enabled() const { + //TODO(fernando): this was activated, change to the other method + return is_mtp_activated(median_time_past(), to_underlying(leibniz_activation_time())); + // return is_leibniz_enabled(height(), network()); +} + +// 2027-May // //static // bool chain_state::is_unnamed_enabled() const { // //TODO(fernando): this was activated, change to the other method @@ -368,8 +389,9 @@ chain_state::activations chain_state::activation(data const& values, uint32_t fo // , euler_t euler_activation_time // , gauss_t gauss_activation_time // , descartes_t descartes_activation_time - , lobachevski_t lobachevski_activation_time + // , lobachevski_t lobachevski_activation_time , galois_t galois_activation_time + , leibniz_t leibniz_activation_time #endif //KTH_CURRENCY_BCH ) { auto const height = values.height; @@ -541,17 +563,22 @@ chain_state::activations chain_state::activation(data const& values, uint32_t fo result.forks |= (rule_fork::bch_descartes & forks); } - auto const mtp = median_time_past(values); - if (is_mtp_activated(mtp, to_underlying(lobachevski_activation_time))) { - //Note(Fernando): Move this to the next fork rules + if (is_lobachevski_enabled(values.height, network)) { result.forks |= (rule_fork::bch_lobachevski & forks); } + auto const mtp = median_time_past(values); if (is_mtp_activated(mtp, to_underlying(galois_activation_time))) { //Note(Fernando): Move this to the next fork rules result.forks |= (rule_fork::bch_galois & forks); } + if (is_mtp_activated(mtp, to_underlying(leibniz_activation_time))) { + //Note(Fernando): Move this to the next fork rules + result.forks |= (rule_fork::bch_leibniz & forks); + } + + // Old rules with Replay Protection // auto const mtp = median_time_past(values); // if (is_mtp_activated(mtp, to_underlying(gauss_activation_time))) { @@ -648,7 +675,6 @@ size_t chain_state::bip9_bit1_height(size_t height, uint32_t forks) { // median_time_past //----------------------------------------------------------------------------- -inline bool chain_state::is_rule_enabled(size_t height, config::network network, size_t mainnet_height, size_t testnet_height #if defined(KTH_CURRENCY_BCH) , size_t testnet4_height @@ -673,7 +699,6 @@ bool chain_state::is_rule_enabled(size_t height, config::network network, size_t #if defined(KTH_CURRENCY_BCH) // Block height at which CSV (BIP68, BIP112 and BIP113) becomes active -inline bool chain_state::is_csv_enabled(size_t height, config::network network) { auto res = is_rule_enabled(height, network , mainnet_csv_activation_height @@ -687,7 +712,6 @@ bool chain_state::is_csv_enabled(size_t height, config::network network) { } //2017-August-01 hard fork -inline bool chain_state::is_uahf_enabled(size_t height, config::network network) { auto res = is_rule_enabled(height, network , mainnet_uahf_activation_height @@ -701,7 +725,6 @@ bool chain_state::is_uahf_enabled(size_t height, config::network network) { } //2017-November-13 hard fork -inline bool chain_state::is_daa_cw144_enabled(size_t height, config::network network) { return is_rule_enabled(height, network , mainnet_daa_cw144_activation_height @@ -713,7 +736,6 @@ bool chain_state::is_daa_cw144_enabled(size_t height, config::network network) { } //2018-May hard fork -inline bool chain_state::is_pythagoras_enabled(size_t height, config::network network) { return is_rule_enabled(height, network , mainnet_pythagoras_activation_height @@ -725,7 +747,6 @@ bool chain_state::is_pythagoras_enabled(size_t height, config::network network) } //2018-Nov hard fork -inline bool chain_state::is_euclid_enabled(size_t height, config::network network) { return is_rule_enabled(height, network , mainnet_euclid_activation_height @@ -737,7 +758,6 @@ bool chain_state::is_euclid_enabled(size_t height, config::network network) { } //2019-May hard fork -inline bool chain_state::is_pisano_enabled(size_t height, config::network network) { return is_rule_enabled(height, network , mainnet_pisano_activation_height @@ -749,7 +769,6 @@ bool chain_state::is_pisano_enabled(size_t height, config::network network) { } //2019-Nov hard fork -inline bool chain_state::is_mersenne_enabled(size_t height, config::network network) { return is_rule_enabled(height, network , mainnet_mersenne_activation_height @@ -761,7 +780,6 @@ bool chain_state::is_mersenne_enabled(size_t height, config::network network) { } //2020-May hard fork -inline bool chain_state::is_fermat_enabled(size_t height, config::network network) { return is_rule_enabled(height, network , mainnet_fermat_activation_height @@ -773,7 +791,6 @@ bool chain_state::is_fermat_enabled(size_t height, config::network network) { } //2020-Nov hard fork -inline bool chain_state::is_euler_enabled(size_t height, config::network network) { return is_rule_enabled(height, network , mainnet_euler_activation_height @@ -785,7 +802,6 @@ bool chain_state::is_euler_enabled(size_t height, config::network network) { } //2022-May hard fork -inline bool chain_state::is_gauss_enabled(size_t height, config::network network) { return is_rule_enabled(height, network , mainnet_gauss_activation_height @@ -797,7 +813,6 @@ bool chain_state::is_gauss_enabled(size_t height, config::network network) { } //2023-May hard fork -inline bool chain_state::is_descartes_enabled(size_t height, config::network network) { return is_rule_enabled(height, network , mainnet_descartes_activation_height @@ -808,22 +823,19 @@ bool chain_state::is_descartes_enabled(size_t height, config::network network) { ); } -//2024-May hard fork -// Complete after the hard fork -// inline -// bool chain_state::is_lobachevski_enabled(size_t height, config::network network) { -// return is_rule_enabled(height, network -// , mainnet_lobachevski_activation_height -// , testnet_lobachevski_activation_height -// , testnet4_lobachevski_activation_height -// , scalenet_lobachevski_activation_height -// , chipnet_lobachevski_activation_height -// ); -// } +// 2024-May hard fork +bool chain_state::is_lobachevski_enabled(size_t height, config::network network) { + return is_rule_enabled(height, network + , mainnet_lobachevski_activation_height + , testnet_lobachevski_activation_height + , testnet4_lobachevski_activation_height + , scalenet_lobachevski_activation_height + , chipnet_lobachevski_activation_height + ); +} //2025-May hard fork // Complete after the hard fork -// inline // bool chain_state::is_galois_enabled(size_t height, config::network network) { // return is_rule_enabled(height, network // , mainnet_galois_activation_height @@ -834,10 +846,20 @@ bool chain_state::is_descartes_enabled(size_t height, config::network network) { // ); // } +//2026-May hard fork +// Complete after the hard fork +// bool chain_state::is_leibniz_enabled(size_t height, config::network network) { +// return is_rule_enabled(height, network +// , mainnet_leibniz_activation_height +// , testnet_leibniz_activation_height +// , testnet4_leibniz_activation_height +// , scalenet_leibniz_activation_height +// , chipnet_leibniz_activation_height +// ); +// } -//2025-May hard fork +//2027-May hard fork // Complete after the hard fork -// inline // bool chain_state::is_unnamed_enabled(size_t height, config::network network) { // return is_rule_enabled(height, network // , mainnet_unnamed_activation_height @@ -989,8 +1011,9 @@ uint32_t chain_state::work_required(data const& values, config::network network, // , euler_t euler_activation_time // , gauss_t gauss_activation_time // , descartes_t descartes_activation_time - , lobachevski_t lobachevski_activation_time + // , lobachevski_t lobachevski_activation_time , galois_t galois_activation_time + , leibniz_t leibniz_activation_time , assert_anchor_block_info_t const& assert_anchor_block_info , uint32_t asert_half_life #endif @@ -1396,14 +1419,18 @@ uint64_t chain_state::dynamic_max_block_sigchecks() const { // return descartes_activation_time_; // } -lobachevski_t chain_state::lobachevski_activation_time() const { - return lobachevski_activation_time_; -} +// lobachevski_t chain_state::lobachevski_activation_time() const { +// return lobachevski_activation_time_; +// } galois_t chain_state::galois_activation_time() const { return galois_activation_time_; } +leibniz_t chain_state::leibniz_activation_time() const { + return leibniz_activation_time_; +} + #endif //KTH_CURRENCY_BCH // Forks. @@ -1433,8 +1460,9 @@ uint32_t chain_state::get_next_work_required(uint32_t time_now) { // , euler_activation_time() // , gauss_activation_time() // , descartes_activation_time() - , lobachevski_activation_time() + // , lobachevski_activation_time() , galois_activation_time() + , leibniz_activation_time() , assert_anchor_block_info_ , asert_half_life() #endif