Skip to content

Commit de7f928

Browse files
committed
evo: prohibit upgrading from LegacyBLS to ExtAddr support directly
As ExtAddr > BasicBLS > LegacyBLS, an upgrade to ExtAddr *assumes* the node is already *at least* at BasicBLS. We should not allow upgrades if this assumption is not met.
1 parent e430e6e commit de7f928

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/evo/deterministicmns.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,11 @@ bool IsVersionChangeValid(gsl::not_null<const CBlockIndex*> pindexPrev, const ui
13131313
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-protx-version-downgrade");
13141314
}
13151315

1316+
if (state_version == ProTxVersion::LegacyBLS && tx_version > ProTxVersion::BasicBLS) {
1317+
// Nodes using the legacy scheme must first upgrade to the basic scheme before upgrading further
1318+
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-protx-version-upgrade");
1319+
}
1320+
13161321
return true;
13171322
}
13181323

0 commit comments

Comments
 (0)