From 7ae30ebff6ddecb4dede5f505fb0eb6889390ad5 Mon Sep 17 00:00:00 2001 From: Fernando Diaz Toledano Date: Mon, 20 Jan 2025 12:11:28 +0100 Subject: [PATCH 1/7] Fix obsolete --- src/Neo/SmartContract/Native/RoleManagement.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Neo/SmartContract/Native/RoleManagement.cs b/src/Neo/SmartContract/Native/RoleManagement.cs index c98eaa611c..b66ee241d9 100644 --- a/src/Neo/SmartContract/Native/RoleManagement.cs +++ b/src/Neo/SmartContract/Native/RoleManagement.cs @@ -60,7 +60,6 @@ public ECPoint[] GetDesignatedByRole(DataCache snapshot, Role role, uint index) } [ContractMethod(CpuFee = 1 << 15, RequiredCallFlags = CallFlags.States | CallFlags.AllowNotify)] - [Obsolete] private void DesignateAsRole(ApplicationEngine engine, Role role, ECPoint[] nodes) { if (nodes.Length == 0 || nodes.Length > 32) From 42aa5fb1aa9378eb601de1a94c080d322e6859d4 Mon Sep 17 00:00:00 2001 From: Fernando Diaz Toledano Date: Mon, 20 Jan 2025 12:22:07 +0100 Subject: [PATCH 2/7] Fix https://github.com/neo-project/neo/pull/3454/files#r1912152270 --- src/Neo/ProtocolSettings.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Neo/ProtocolSettings.cs b/src/Neo/ProtocolSettings.cs index 085cb1e474..f07df4761f 100644 --- a/src/Neo/ProtocolSettings.cs +++ b/src/Neo/ProtocolSettings.cs @@ -132,12 +132,11 @@ public record ProtocolSettings /// Full path of the file if found, null otherwise. public static string FindFile(string fileName, string path) { - // Check if the given path is relative if (!Path.IsPathRooted(path)) { // Combine with the executable directory if relative - var executablePath = AppDomain.CurrentDomain.BaseDirectory; + var executablePath = AppContext.BaseDirectory; path = Path.Combine(executablePath, path); } From 91b92fd480639f76f1555641cec8584c46741e7b Mon Sep 17 00:00:00 2001 From: Fernando Diaz Toledano Date: Mon, 20 Jan 2025 12:22:44 +0100 Subject: [PATCH 3/7] Fix comment --- src/Neo/Cryptography/Ed25519.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Neo/Cryptography/Ed25519.cs b/src/Neo/Cryptography/Ed25519.cs index 5919e152b3..585970a4fc 100644 --- a/src/Neo/Cryptography/Ed25519.cs +++ b/src/Neo/Cryptography/Ed25519.cs @@ -1,4 +1,4 @@ -// Copyright (C) 2015-2024 The Neo Project. +// Copyright (C) 2015-2025 The Neo Project. // // Ed25519.cs file belongs to the neo project and is free // software distributed under the MIT software license, see the From f1dd228758eb7f6340cacee2baf7fc22f06a934e Mon Sep 17 00:00:00 2001 From: Shargon Date: Mon, 20 Jan 2025 13:43:47 +0100 Subject: [PATCH 4/7] Update RoleManagement.cs --- src/Neo/SmartContract/Native/RoleManagement.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Neo/SmartContract/Native/RoleManagement.cs b/src/Neo/SmartContract/Native/RoleManagement.cs index b66ee241d9..0822dc265f 100644 --- a/src/Neo/SmartContract/Native/RoleManagement.cs +++ b/src/Neo/SmartContract/Native/RoleManagement.cs @@ -80,7 +80,7 @@ private void DesignateAsRole(ApplicationEngine engine, Role role, ECPoint[] node engine.SnapshotCache.Add(key, new StorageItem(list)); if (engine.IsHardforkEnabled(Hardfork.HF_Echidna)) { - var oldNodes = new VM.Types.Array(engine.ReferenceCounter, GetDesignatedByRole(engine.Snapshot, role, index - 1).Select(u => (ByteString)u.EncodePoint(true))); + var oldNodes = new VM.Types.Array(engine.ReferenceCounter, GetDesignatedByRole(engine.SnapshotCache, role, index - 1).Select(u => (ByteString)u.EncodePoint(true))); var newNodes = new VM.Types.Array(engine.ReferenceCounter, nodes.Select(u => (ByteString)u.EncodePoint(true))); engine.SendNotification(Hash, "Designation", new VM.Types.Array(engine.ReferenceCounter, [(int)role, engine.PersistingBlock.Index, oldNodes, newNodes])); From fcca1b5933db913de0e0b91d9619328813a22f34 Mon Sep 17 00:00:00 2001 From: Fernando Diaz Toledano Date: Tue, 21 Jan 2025 10:03:27 +0100 Subject: [PATCH 5/7] Unset HF_Echidna --- src/Neo.CLI/config.fs.mainnet.json | 3 +-- src/Neo.CLI/config.json | 3 +-- src/Neo.CLI/config.mainnet.json | 3 +-- src/Neo.CLI/config.testnet.json | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Neo.CLI/config.fs.mainnet.json b/src/Neo.CLI/config.fs.mainnet.json index 08e1cdb35c..a641d0675c 100644 --- a/src/Neo.CLI/config.fs.mainnet.json +++ b/src/Neo.CLI/config.fs.mainnet.json @@ -41,8 +41,7 @@ "HF_Aspidochelone": 3000000, "HF_Basilisk": 4500000, "HF_Cockatrice": 5800000, - "HF_Domovoi": 5800000, - "HF_Echidna": 5800001 + "HF_Domovoi": 5800000 }, "StandbyCommittee": [ "026fa34ec057d74c2fdf1a18e336d0bd597ea401a0b2ad57340d5c220d09f44086", diff --git a/src/Neo.CLI/config.json b/src/Neo.CLI/config.json index 904b1a13d2..e9e92f6913 100644 --- a/src/Neo.CLI/config.json +++ b/src/Neo.CLI/config.json @@ -39,8 +39,7 @@ "HF_Aspidochelone": 1730000, "HF_Basilisk": 4120000, "HF_Cockatrice": 5450000, - "HF_Domovoi": 5570000, - "HF_Echidna": 5570001 + "HF_Domovoi": 5570000 }, "InitialGasDistribution": 5200000000000000, "ValidatorsCount": 7, diff --git a/src/Neo.CLI/config.mainnet.json b/src/Neo.CLI/config.mainnet.json index 904b1a13d2..e9e92f6913 100644 --- a/src/Neo.CLI/config.mainnet.json +++ b/src/Neo.CLI/config.mainnet.json @@ -39,8 +39,7 @@ "HF_Aspidochelone": 1730000, "HF_Basilisk": 4120000, "HF_Cockatrice": 5450000, - "HF_Domovoi": 5570000, - "HF_Echidna": 5570001 + "HF_Domovoi": 5570000 }, "InitialGasDistribution": 5200000000000000, "ValidatorsCount": 7, diff --git a/src/Neo.CLI/config.testnet.json b/src/Neo.CLI/config.testnet.json index e838bf08c8..ecd0a8e65c 100644 --- a/src/Neo.CLI/config.testnet.json +++ b/src/Neo.CLI/config.testnet.json @@ -39,8 +39,7 @@ "HF_Aspidochelone": 210000, "HF_Basilisk": 2680000, "HF_Cockatrice": 3967000, - "HF_Domovoi": 4144000, - "HF_Echidna": 4144001 + "HF_Domovoi": 4144000 }, "InitialGasDistribution": 5200000000000000, "ValidatorsCount": 7, From 38ae1a641fbb38453fbb875acadb57b4dac55bee Mon Sep 17 00:00:00 2001 From: Fernando Diaz Toledano Date: Tue, 21 Jan 2025 10:05:04 +0100 Subject: [PATCH 6/7] Revert getTransaction --- src/Neo/SmartContract/Native/LedgerContract.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Neo/SmartContract/Native/LedgerContract.cs b/src/Neo/SmartContract/Native/LedgerContract.cs index 758cb4d324..88e9243dd1 100644 --- a/src/Neo/SmartContract/Native/LedgerContract.cs +++ b/src/Neo/SmartContract/Native/LedgerContract.cs @@ -310,7 +310,7 @@ public Transaction GetTransaction(DataCache snapshot, UInt256 hash) return GetTransactionState(snapshot, hash)?.Transaction; } - [ContractMethod(CpuFee = 1 << 15, RequiredCallFlags = CallFlags.ReadStates, Name = nameof(GetTransaction))] + [ContractMethod(CpuFee = 1 << 15, RequiredCallFlags = CallFlags.ReadStates, Name = "getTransaction")] private Transaction GetTransactionForContract(ApplicationEngine engine, UInt256 hash) { TransactionState state = GetTransactionState(engine.SnapshotCache, hash); From e8178b1684f87767f6faebf214e0ec5f3b54eed8 Mon Sep 17 00:00:00 2001 From: Fernando Diaz Toledano Date: Tue, 21 Jan 2025 10:05:59 +0100 Subject: [PATCH 7/7] Revert verifyWithECDsa --- src/Neo/SmartContract/Native/CryptoLib.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Neo/SmartContract/Native/CryptoLib.cs b/src/Neo/SmartContract/Native/CryptoLib.cs index 3f7aaa95dc..219b19f657 100644 --- a/src/Neo/SmartContract/Native/CryptoLib.cs +++ b/src/Neo/SmartContract/Native/CryptoLib.cs @@ -102,7 +102,7 @@ public static bool VerifyWithECDsa(byte[] message, byte[] pubkey, byte[] signatu } // This is for solving the hardfork issue in https://github.com/neo-project/neo/pull/3209 - [ContractMethod(true, Hardfork.HF_Cockatrice, CpuFee = 1 << 15, Name = nameof(VerifyWithECDsa))] + [ContractMethod(true, Hardfork.HF_Cockatrice, CpuFee = 1 << 15, Name = "verifyWithECDsa")] public static bool VerifyWithECDsaV0(byte[] message, byte[] pubkey, byte[] signature, NamedCurveHash curve) { if (curve != NamedCurveHash.secp256k1SHA256 && curve != NamedCurveHash.secp256r1SHA256)