diff --git a/libraries/chain/combined_database.cpp b/libraries/chain/combined_database.cpp index 6dfc78ffed0..cf7a674a879 100644 --- a/libraries/chain/combined_database.cpp +++ b/libraries/chain/combined_database.cpp @@ -442,6 +442,7 @@ namespace eosio { namespace chain { if (std::is_same::value) { using v2 = legacy::snapshot_global_property_object_v2; using v3 = legacy::snapshot_global_property_object_v3; + using v4 = legacy::snapshot_global_property_object_v4; if (std::clamp(header.version, v2::minimum_version, v2::maximum_version) == header.version) { std::optional genesis = extract_legacy_genesis_state(*snapshot, header.version); @@ -473,6 +474,19 @@ namespace eosio { namespace chain { }); return; // early out to avoid default processing } + + if (std::clamp(header.version, v4::minimum_version, v4::maximum_version) == header.version) { + snapshot->read_section([&db = this->db](auto& section) { + v4 legacy_global_properties; + section.read_row(legacy_global_properties, db); + + db.create([&legacy_global_properties](auto& gpo) { + gpo.initalize_from(legacy_global_properties); + }); + }); + return; // early out to avoid default processing + } + } snapshot->read_section([this](auto& section) { diff --git a/unittests/snapshot_tests.cpp b/unittests/snapshot_tests.cpp index 2ec4d4cc793..416291729a2 100644 --- a/unittests/snapshot_tests.cpp +++ b/unittests/snapshot_tests.cpp @@ -394,7 +394,6 @@ static auto get_extra_args() { return std::make_tuple(save_snapshot, generate_log); } -/* BOOST_AUTO_TEST_CASE_TEMPLATE(test_compatible_versions, SNAPSHOT_SUITE, snapshot_suites) { const uint32_t legacy_default_max_inline_action_size = 4 * 1024; @@ -465,7 +464,6 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_compatible_versions, SNAPSHOT_SUITE, snapshot SNAPSHOT_SUITE::write_to_file("snap_" + current_version, latest); } } -*/ /* When WTMSIG changes were introduced in 1.8.x, the snapshot had to be able