Skip to content

Commit

Permalink
Native: include DeprecatedIn hardfork into usedHardforks
Browse files Browse the repository at this point in the history
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#L284

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 fixincluded, so this fix may safely be postponed to 3.8.0.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
  • Loading branch information
AnnaShaleva committed May 20, 2024
1 parent 08f2dfc commit ab9c882
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Neo/SmartContract/Native/NativeContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ab9c882

Please sign in to comment.