Conversation
|
is the manifests of native contracts fixed? |
| if (Ledger.CurrentIndex(snapshot) + 1 < index) | ||
| throw new ArgumentOutOfRangeException(nameof(index)); | ||
| // Fix hardfork for https://github.com/neo-project/neo/pull/3172 | ||
| if (role == Role.P2PNotary && !ProtocolSettings.Custom.IsHardforkEnabled(Hardfork.HF_Cockatrice, Ledger.CurrentIndex(snapshot))) |
There was a problem hiding this comment.
Breaks NeoFS chains immediately. I've tried to explain why we're doing it this way numerous times, but looks like no one cares about NeoFS and compatibility.
There was a problem hiding this comment.
breaks neofs or break the mainnet, this is a problem. We will have it but can not make it take effect untill we have the fork.
There was a problem hiding this comment.
Please, revert #3172 then. It causes more problems than it solves with this HF logic.
There was a problem hiding this comment.
BTW, it can only be exploited by committee. Nasty committee.
There was a problem hiding this comment.
BTW, it can only be exploited by committee. Nasty committee.
Hardly ever committee will designate this role before Notary subsystem implementation is finished. Thus, I'd vote for keeping P2PNotary role without binding to hardfork.
There was a problem hiding this comment.
BTW, it can only be exploited by committee
Sorry, not exactly. getDesignatedByRole will return empty array instead of failing.
This reverts commit c1af443.
| public long CpuFee { get; init; } | ||
| public long StorageFee { get; init; } | ||
| public Hardfork? ActiveIn { get; init; } = null; | ||
| public Hardfork? DeprecatedIn { get; init; } = null; |
There was a problem hiding this comment.
BTW, this is a part of #3210. Add a reference to the PR description, please.
There was a problem hiding this comment.
Also, we need the same functionality to be implemented for events. It's not hard to extend it, read the original issue.
There was a problem hiding this comment.
This pr is a hotpatch for the hf issues, i prefer to keep it as simple as possible.
| ActiveIn = activeIn; | ||
| } | ||
|
|
||
| public ContractMethodAttribute(bool isDeprecated, Hardfork deprecatedIn) |
There was a problem hiding this comment.
| public ContractMethodAttribute(bool isDeprecated, Hardfork deprecatedIn) | |
| public ContractMethodAttribute(Hardfork? activeIn, Hardfork deprecatedIn) |
I'd suggest to use this option, and just put null as the first argument for those methods that were always active but need to be deprecated.
There was a problem hiding this comment.
Existing solution already works, i may update it after we have confirmed that this pr works fine.
|
|
||
| // This is for solving the hardfork issue in https://github.com/neo-project/neo/pull/3209 | ||
| [ContractMethod(true, Hardfork.HF_Cockatrice, CpuFee = 1 << 15)] | ||
| public static bool VerifyWithECDsa(byte[] message, byte[] pubkey, byte[] signature, NamedCurve curve) |
There was a problem hiding this comment.
You may safely get rid of NamedCurve type here and use NamedCurveHash, just check that curve falls within the expected range (22 or 23) and throw if not. You can do this because NamedCurveHash is compatible. If you implement this, then no 'NamedCurve' is obsolete linter warnings will be raised.
There was a problem hiding this comment.
This is a hotpatch, i prefer to keep it simple and use original logic as much as possible.
There was a problem hiding this comment.
Every TODO is an issue, otherwise it won't be done. See #3236.
|
manifest of event |
|
|
||
| // This is for solving the hardfork issue in https://github.com/neo-project/neo/pull/3209 | ||
| [ContractMethod(true, Hardfork.HF_Cockatrice, CpuFee = 1 << 15)] | ||
| public static bool VerifyWithECDsa(byte[] message, byte[] pubkey, byte[] signature, NamedCurve curve) |
There was a problem hiding this comment.
Every TODO is an issue, otherwise it won't be done. See #3236.
shargon
left a comment
There was a problem hiding this comment.
Seems good to me, only the rename to ActiveTil, but also it's ok like this
|
|
||
| if (!newCommittee.SequenceEqual(prevCommittee)) | ||
| // Hardfork check for https://github.com/neo-project/neo/pull/3158 | ||
| // New notification will case 3.7.0 and 3.6.0 have different behavior |
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>
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 fix included. So this fix may safely be postponed to 3.8.0. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
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 <shaleva.ann@nspcc.ru>
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 <shaleva.ann@nspcc.ru> Co-authored-by: Shargon <shargon@gmail.com>
…gins * 'latest-plugins' of github.com:Jim8y/neo: (21 commits) fix: custom plugins won't shown by command `plugins` (neo-project#3269) COVERALL: Improve maintenance and readbility of some variables (neo-project#3248) Update nuget (neo-project#3262) [**Part-2**] Neo module/master fixes (neo-project#3244) Fix `dotnet pack` error (neo-project#3266) Fix and Update devcontainer.json to use Dockerfile (neo-project#3259) Add optimization to template (neo-project#3247) Optimize plugin's models (neo-project#3246) fix CancelTransaction !signers.Any() (neo-project#3263) COVERALL: fix broken by changing report from lcov to cobertura (neo-project#3252) fix TraverseIterator count (neo-project#3261) Native: include DeprecatedIn hardfork into usedHardforks (neo-project#3245) [**Part-1**] `neo-module/master` (neo-project#3232) Make `ApplicationEngine.LoadContext` protection level `public` (neo-project#3243) improve parse method in neo-cli (neo-project#3204) Fix neo-project#3239 (neo-project#3242) Neo.CLI: enable hardforks for NeoFS mainnet (neo-project#3240) v3.7.4 (neo-project#3237) fix hardfork issues (neo-project#3234) Update src/Neo.CLI/CLI/MainService.Plugins.cs ... # Conflicts: # src/Neo.CLI/CLI/MainService.Plugins.cs
Port neo-project/neo#3234, should be a part of #3351. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Port neo-project/neo#3234, should be a part of #3351. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Description
This pr fixes the hardfork issue in the 3.7.
Fixes # (issue)
Type of change
Test Configuration:
Checklist: