From b1b15c160e32bada20f26b2df3db175555f6cc62 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 21 May 2024 01:00:33 +0300 Subject: [PATCH] Native: include DeprecatedIn hardfork into usedHardforks DeprecatedIn hardfork of every native method (if not null) should be included into the set of used hardforks, otherwise no contract update will be performed on this hardfork activation: https://github.com/neo-project/neo/blob/08f2dfc56762bb43be33e873bc3659bad368d4d6/src/Neo/SmartContract/Native/NativeContract.cs#L279-L284 https://github.com/neo-project/neo/blob/08f2dfc56762bb43be33e873bc3659bad368d4d6/src/Neo/SmartContract/Native/ContractManagement.cs#L69-L73 This commit should be a part of #3234 and a part of 3.7.4. Luckily, this new DeprecatedIn functionality is used only for the old native CryptoLib's verifyWithECDsa method with Cockatrice hardfork. And luckily, there are other CryptoLib's methods with ActiveIn set to Cockatrice hardfork. Due to these two facts this bug does not affect mainnet/testnet, and thus we don't need 3.7.5 with this fix included. So this fix may safely be postponed to 3.8.0. Signed-off-by: Anna Shaleva --- src/Neo/SmartContract/Native/NativeContract.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Neo/SmartContract/Native/NativeContract.cs b/src/Neo/SmartContract/Native/NativeContract.cs index 55e88b2ec6..03815b3fae 100644 --- a/src/Neo/SmartContract/Native/NativeContract.cs +++ b/src/Neo/SmartContract/Native/NativeContract.cs @@ -160,6 +160,7 @@ protected NativeContract() // Calculate the initializations forks usedHardforks = methodDescriptors.Select(u => u.ActiveIn) + .Concat(methodDescriptors.Select(u => u.DeprecatedIn)) .Concat(eventsDescriptors.Select(u => u.ActiveIn)) .Concat(new Hardfork?[] { ActiveIn }) .Where(u => u is not null)