Ban using Peya as a merge-mining parent
Some checks failed
build / Cross-Mac aarch64 (push) Successful in 12m37s
build / ARM v8 (push) Successful in 10m41s
build / ARM v7 (push) Successful in 7m31s
build / i686 Linux (push) Successful in 6m46s
build / i686 Win (push) Successful in 13m49s
build / RISCV 64bit (push) Successful in 35m29s
build / Cross-Mac x86_64 (push) Successful in 14m24s
build / x86_64 Linux (push) Successful in 15m9s
build / x86_64 Freebsd (push) Successful in 11m5s
build / Win64 (push) Failing after 6s

This commit is contained in:
Codex Bot
2026-03-23 20:26:56 +01:00
parent 4b336c73b1
commit 6115b96ce2
3 changed files with 29 additions and 0 deletions

View File

@@ -256,6 +256,7 @@
#define HF_VERSION_EMERGENCY_DIFFICULTY 12
#define HF_VERSION_MERGE_MINING 13
#define HF_VERSION_RESTRICTED_MERGE_MINING 14
#define HF_VERSION_DISABLE_PEYA_AS_PARENT 15
#define HF_VERSION_REQUIRE_VIEW_TAGS 255
#define HF_VERSION_ENABLE_CONVERT 255

View File

@@ -5742,6 +5742,25 @@ leave:
goto leave;
}
if (!bl.aux_header && hf_version >= HF_VERSION_DISABLE_PEYA_AS_PARENT)
{
std::vector<cryptonote::tx_extra_field> miner_tx_extra_fields;
if (!cryptonote::parse_tx_extra(bl.miner_tx.extra, miner_tx_extra_fields))
{
MERROR_VER("Block with id: " << id << " has invalid miner tx extra while checking parent-side merge-mining tag ban");
bvc.m_verifivation_failed = true;
goto leave;
}
cryptonote::tx_extra_merge_mining_tag mm_tag;
if (cryptonote::find_tx_extra_field_by_type(miner_tx_extra_fields, mm_tag, 0))
{
MERROR_VER("Block with id: " << id << " carries a parent-side merge mining tag in miner tx after HF_VERSION_DISABLE_PEYA_AS_PARENT");
bvc.m_verifivation_failed = true;
goto leave;
}
}
// sanity check basic protocol tx properties;
if(!prevalidate_protocol_transaction(bl, blockchain_height, hf_version))
{

View File

@@ -39,6 +39,9 @@ const hardfork_t mainnet_hard_forks[] = {
{12, 3, 0, 1341378360 },
{13, 4, 0, 1341378480 },
{14, 5, 0, 1341378600 },
// Temporary test height for disabling Peya-as-parent via parent-side merge-mining tags.
// Before real rollout this should be moved lower to the intended production activation height.
{15, 878, 0, 1341482760 },
};
const size_t num_mainnet_hard_forks = sizeof(mainnet_hard_forks) / sizeof(mainnet_hard_forks[0]);
const uint64_t mainnet_hard_fork_version_1_till = 0;
@@ -51,6 +54,9 @@ const hardfork_t testnet_hard_forks[] = {
{12, 3, 0, 1341378360 },
{13, 4, 0, 1341378480 },
{14, 5, 0, 1341378600 },
// Temporary test height for disabling Peya-as-parent via parent-side merge-mining tags.
// Before real rollout this should be moved lower to the intended production activation height.
{15, 878, 0, 1341482760 },
};
const size_t num_testnet_hard_forks = sizeof(testnet_hard_forks) / sizeof(testnet_hard_forks[0]);
const uint64_t testnet_hard_fork_version_1_till = 0;
@@ -63,5 +69,8 @@ const hardfork_t stagenet_hard_forks[] = {
{12, 3, 0, 1341378360 },
{13, 4, 0, 1341378480 },
{14, 5, 0, 1341378600 },
// Temporary test height for disabling Peya-as-parent via parent-side merge-mining tags.
// Before real rollout this should be moved lower to the intended production activation height.
{15, 878, 0, 1341482760 },
};
const size_t num_stagenet_hard_forks = sizeof(stagenet_hard_forks) / sizeof(stagenet_hard_forks[0]);