From 8e8cf7f2ec26ee119e173148cbbfb87301fd5aed Mon Sep 17 00:00:00 2001 From: Shuai Date: Mon, 6 Jun 2022 15:01:20 +0800 Subject: [PATCH] update to v3.3.0 --- neo | 2 +- .../Analyzers/ExecuteResultLogTracker.cs | 18 +++++- .../neo3-gui/Common/Consoles/MainService.cs | 8 +-- .../Common/Utility/OpCodeConverter.cs | 13 ++++- neo3-gui/neo3-gui/Helpers.cs | 52 +++++++++++++++++- .../Models/Contracts/ContractModel.cs | 2 +- .../Models/Transactions/TransactionModel.cs | 6 +- .../Models/Transactions/WitnessModel.cs | 4 +- neo3-gui/neo3-gui/Plugins/LevelDBStore.dll | Bin 19968 -> 18944 bytes .../ApiServices/ContractApiService.cs | 13 +++-- .../Services/ApiServices/WalletApiService.cs | 3 +- neo3-gui/neo3-gui/config.private.json | 4 +- neo3-gui/neo3-gui/neo3-gui.csproj | 4 +- 13 files changed, 98 insertions(+), 31 deletions(-) diff --git a/neo b/neo index 26e9b6df..7d7c5955 160000 --- a/neo +++ b/neo @@ -1 +1 @@ -Subproject commit 26e9b6df252678aefdb8ab625b0817a96dfa9732 +Subproject commit 7d7c59554466e7ee6bdbc09f478ba4c0cbeb604f diff --git a/neo3-gui/neo3-gui/Common/Analyzers/ExecuteResultLogTracker.cs b/neo3-gui/neo3-gui/Common/Analyzers/ExecuteResultLogTracker.cs index c856f1be..6c269573 100644 --- a/neo3-gui/neo3-gui/Common/Analyzers/ExecuteResultLogTracker.cs +++ b/neo3-gui/neo3-gui/Common/Analyzers/ExecuteResultLogTracker.cs @@ -11,13 +11,25 @@ namespace Neo.Common.Analyzers { - public class ExecuteResultLogTracker : Plugin, IPersistencePlugin + public class ExecuteResultLogTracker : Plugin { private readonly LevelDbContext _levelDb = new LevelDbContext(); private readonly HashSet _cachedAssets = new HashSet(); - void IPersistencePlugin.OnPersist(NeoSystem system, Block block, DataCache snapshot, IReadOnlyList applicationExecutedList) + public ExecuteResultLogTracker() + { + Blockchain.Committing += OnCommitting; + Blockchain.Committed += OnCommitted; + } + + public override void Dispose() + { + Blockchain.Committing -= OnCommitting; + Blockchain.Committed -= OnCommitted; + } + + void OnCommitting(NeoSystem system, Block block, DataCache snapshot, IReadOnlyList applicationExecutedList) { Header header = snapshot.GetCurrentHeader(); var analyzer = new BlockAnalyzer(snapshot, header, applicationExecutedList); @@ -59,7 +71,7 @@ void IPersistencePlugin.OnPersist(NeoSystem system, Block block, DataCache snaps } - void IPersistencePlugin.OnCommit(NeoSystem system, Block block, DataCache snapshot) + void OnCommitted(NeoSystem system, Block block) { _levelDb.Commit(); } diff --git a/neo3-gui/neo3-gui/Common/Consoles/MainService.cs b/neo3-gui/neo3-gui/Common/Consoles/MainService.cs index 6bcc07d6..f129beae 100644 --- a/neo3-gui/neo3-gui/Common/Consoles/MainService.cs +++ b/neo3-gui/neo3-gui/Common/Consoles/MainService.cs @@ -148,8 +148,7 @@ public void CreateWallet(string path, string password) break; case ".json": { - NEP6Wallet wallet = new NEP6Wallet(path, CliSettings.Default.Protocol); - wallet.Unlock(password); + NEP6Wallet wallet = new NEP6Wallet(path, password, CliSettings.Default.Protocol); WalletAccount account = wallet.CreateAccount(); wallet.Save(); Console.WriteLine($"address: {account.Address}"); @@ -306,7 +305,7 @@ private bool OnInvokeCommand(string[] args) { scriptBuilder.EmitDynamicCall(scriptHash, args[2], contractParameters.ToArray()); tx.Script = scriptBuilder.ToArray(); - Console.WriteLine($"Invoking script with: '{tx.Script.ToHexString()}'"); + Console.WriteLine($"Invoking script with: '{tx.Script.ToArray().ToHexString()}'"); } using (ApplicationEngine engine = tx.Script.RunTestMode(null, tx)) @@ -1261,8 +1260,7 @@ public void OpenWallet(string path, string password) } else { - NEP6Wallet nep6wallet = new NEP6Wallet(path, CliSettings.Default.Protocol); - nep6wallet.Unlock(password); + NEP6Wallet nep6wallet = new NEP6Wallet(path, password, CliSettings.Default.Protocol); CurrentWallet = nep6wallet; } } diff --git a/neo3-gui/neo3-gui/Common/Utility/OpCodeConverter.cs b/neo3-gui/neo3-gui/Common/Utility/OpCodeConverter.cs index 4fa70ac5..1ba85197 100644 --- a/neo3-gui/neo3-gui/Common/Utility/OpCodeConverter.cs +++ b/neo3-gui/neo3-gui/Common/Utility/OpCodeConverter.cs @@ -22,7 +22,7 @@ public class OpCodeConverter static OpCodeConverter() { //初始化所有 InteropService Method - _interopServiceMap = ApplicationEngine.Services.ToDictionary(s=>s.Key,s=>s.Value.Name); + _interopServiceMap = ApplicationEngine.Services.ToDictionary(s => s.Key, s => s.Value.Name); //初始化所有 OpCode OperandSize foreach (FieldInfo field in typeof(OpCode).GetFields(BindingFlags.Public | BindingFlags.Static)) { @@ -39,6 +39,13 @@ public static string ToAsciiString(byte[] byteArray) if (output.Any(p => p < '0' || p > 'z')) return byteArray.ToHexString(); return output; } + + + public static List Parse(ReadOnlyMemory scripts) + { + return Parse(scripts.ToArray()); + } + public static List Parse(byte[] scripts) { var result = new List(); @@ -50,7 +57,7 @@ public static List Parse(byte[] scripts) var instruction = s.GetInstruction(ip); var instructionInfo = new InstructionInfo() - {OpCode = instruction.OpCode, Position = ip, OpData = instruction.Operand.ToArray()}; + { OpCode = instruction.OpCode, Position = ip, OpData = instruction.Operand.ToArray() }; if (instruction.OpCode == OpCode.SYSCALL) { @@ -68,7 +75,7 @@ public static List Parse(byte[] scripts) { Console.WriteLine($"{scripts.ToHexString()}:{e}"); } - + return result; } diff --git a/neo3-gui/neo3-gui/Helpers.cs b/neo3-gui/neo3-gui/Helpers.cs index f961be92..0fe41598 100644 --- a/neo3-gui/neo3-gui/Helpers.cs +++ b/neo3-gui/neo3-gui/Helpers.cs @@ -46,6 +46,7 @@ using VmArray = Neo.VM.Types.Array; using JsonSerializer = System.Text.Json.JsonSerializer; using Pointer = Neo.VM.Types.Pointer; +using Neo.SmartContract.Iterators; namespace Neo { @@ -55,7 +56,7 @@ public static class Helpers public static readonly JsonSerializerOptions SerializeOptions = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase, - IgnoreNullValues = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, PropertyNameCaseInsensitive = true, Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, Converters = @@ -628,7 +629,7 @@ public static AccountType GetAccountType(this WalletAccount account, DataCache s { if (account.Contract != null) { - if (account.Contract.Script.IsMultiSigContract(out _, out int _)) + if (account.Contract.Script.IsMultiSigContract()) { return AccountType.MultiSignature; } @@ -1179,6 +1180,12 @@ public static NotificationInfo ToNotificationInfo(this NotifyEventArgs notify) return notification; } + public static ApplicationEngine RunTestMode(this ReadOnlyMemory script, DataCache snapshot, IVerifiable container = null) + { + return ApplicationEngine.Run(script, snapshot ?? GetDefaultSnapshot(), container, settings: CliSettings.Default.Protocol, gas: Constant.TestMode); + } + + public static ApplicationEngine RunTestMode(this byte[] script, DataCache snapshot, IVerifiable container = null) { return ApplicationEngine.Run(script, snapshot ?? GetDefaultSnapshot(), container, settings: CliSettings.Default.Protocol, gas: Constant.TestMode); @@ -1427,5 +1434,46 @@ public static string ToBase64String(this ReadOnlySpan data) { return data.ToArray().ToBase64String(); } + + public static string ToBase64String(this Memory data) + { + return data.ToArray().ToBase64String(); + } + + + public static bool IsSignatureContract(this byte[] script) + { + return Neo.SmartContract.Helper.IsSignatureContract(script); + } + + public static bool IsMultiSigContract(this byte[] script) + { + return Neo.SmartContract.Helper.IsMultiSigContract(script); + } + + + public static (ECPoint PublicKey, BigInteger Votes)[] GetCandidates(this DataCache snapshot) + { + var sb = new ScriptBuilder(); + sb.EmitDynamicCall(NativeContract.NEO.Hash, "getCandidates"); + var engine = sb.ToArray().RunTestMode(snapshot); + var array = engine.ResultStack.Pop() as VmArray; + var list = new List<(ECPoint PublicKey, BigInteger Votes)>(); + if (array.Count > 0) + { + foreach (Struct item in array) + { + list.Add((ECPoint.FromBytes(item[0].GetSpan().ToArray(), ECCurve.Secp256r1), item[1].GetInteger())); + } + + } + //var iterator = iop.GetInterface(); + //var first = iterator.Value; + //while (iterator.Next()) + //{ + // var val = iterator.Value; + //} + return list.ToArray(); + } } } diff --git a/neo3-gui/neo3-gui/Models/Contracts/ContractModel.cs b/neo3-gui/neo3-gui/Models/Contracts/ContractModel.cs index 57c732c3..d53de2e1 100644 --- a/neo3-gui/neo3-gui/Models/Contracts/ContractModel.cs +++ b/neo3-gui/neo3-gui/Models/Contracts/ContractModel.cs @@ -12,7 +12,7 @@ public class ContractModel public ContractModel(ContractState contract) { ContractId = contract.Id; - Script = contract.Script; + Script = contract.Script.ToArray(); Manifest = new ManifestModel(contract.Manifest); } diff --git a/neo3-gui/neo3-gui/Models/Transactions/TransactionModel.cs b/neo3-gui/neo3-gui/Models/Transactions/TransactionModel.cs index 29245e86..ee300abc 100644 --- a/neo3-gui/neo3-gui/Models/Transactions/TransactionModel.cs +++ b/neo3-gui/neo3-gui/Models/Transactions/TransactionModel.cs @@ -19,8 +19,8 @@ public TransactionModel(Transaction tx) TxId = tx.Hash; NetworkFee = new BigDecimal((BigInteger)tx.NetworkFee, NativeContract.GAS.Decimals); Nonce = tx.Nonce; - Script = tx.Script; - + Script = tx.Script.ToArray(); + Sender = tx.Sender; SystemFee = new BigDecimal((BigInteger)tx.SystemFee, NativeContract.GAS.Decimals); ValidUntilBlock = tx.ValidUntilBlock; @@ -34,7 +34,7 @@ public TransactionModel(Transaction tx) Witnesses = tx.Witnesses?.Select(w => new WitnessModel(w) ).ToList(); - if (tx.Script != null) + if (tx.Script.Length > 0) { ScriptCode = OpCodeConverter.Parse(tx.Script); } diff --git a/neo3-gui/neo3-gui/Models/Transactions/WitnessModel.cs b/neo3-gui/neo3-gui/Models/Transactions/WitnessModel.cs index fbbe637c..4c9f450b 100644 --- a/neo3-gui/neo3-gui/Models/Transactions/WitnessModel.cs +++ b/neo3-gui/neo3-gui/Models/Transactions/WitnessModel.cs @@ -12,8 +12,8 @@ public WitnessModel(Witness witness) { if (witness != null) { - InvocationScript = witness.InvocationScript; - VerificationScript = witness.VerificationScript; + InvocationScript = witness.InvocationScript.ToArray(); + VerificationScript = witness.VerificationScript.ToArray(); ScriptHash = witness.ScriptHash; InvocationOpCode = OpCodeConverter.Parse(witness.InvocationScript); VerificationOpCode = OpCodeConverter.Parse(witness.VerificationScript); diff --git a/neo3-gui/neo3-gui/Plugins/LevelDBStore.dll b/neo3-gui/neo3-gui/Plugins/LevelDBStore.dll index 2e1a4e6264b8054941c93c81b1f2e70f44741968..be67fdddf253a969a3e5837a32258a1c86605bfa 100644 GIT binary patch literal 18944 zcmeHvd3;;dmH&B*7R$D5%W>k6P1!(k9K|6{8bU~uSXm6&h#er5BFoaVqeRwIBsqyO z28XaO1xld9hnBU4GL)sju!ORdEoE95=nv9gr_chOp|mrfC&jOO69gF$+*;>GEY zDC=LG-nl(p2hBv|iEZ zuFL1X>S%kDW`rx17NS+4crEHf36xj$wHQBtm{lbY zMWPtzu|$ec|MTFeJbLDu7ORm-L;*E28L$ar>RU9zRLdta1;lCL@#a*N=ZwdgX3v{& z^f?WveCqugro1o>4YP;2B?57Cn=7?*Dj5l*Q7d4KUQ4Dw>azoSYG_HuLH5%oy`CSO?oMH(x4o-#_isLIk$XR)^+rp$$P%V75LqmkZBOGZ#U9 zXdcQYW`^<1Jf90~2pb49FW|y6gq$YK7&Rv(wgX}~oz__aB$3ywj%(65ssdM_pAt~L z<1I9T(FVL_f$2kEk)z5aTk*z3jNzox7!bNlESpb+E>j|_z+{JRnJo4pmKNf~metN| z9Jufy#~rV2>A%)(a7jqwHgD7E7MG?u6Ba>~OBRsMv2tW}Inu@m`$v`e9AV3eXd7Y6 z3{~UB6lgln_8}rL(2VthSw!;Z6;Z%6c+cV_%E6~aHnMyd!`54doy-^#qHtQPHPSJH zqjL<7Q$}!{Is!Xw1a>-OM3Y(+!e%2MOIc(CT7KzMBXEDS)yR7A z46$iea%zf7CLZREi3h~XP>Y;tE3~jUW0)|(29Xx@NEeev+raISucGD8*>DDUhM3#6 z;apILIlngTaFb>YGiZ^e%*;xgo=`=3SrkrI2ZhTr>UeP4u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ZB2vA)X{?FA}`}y zP&1H{@8dEG!B+cbo&2o+)%NS%Z=YX_k4-BL4Z218C z%zX>sK3jBcvFPkw)@ApXG1F6jkIt3iE7OB DeployContract(string nefPath, string manifestPath = n // Read manifest ContractManifest manifest = ReadManifestFile(manifestPath); // Basic script checks - await CheckBadOpcode(nefFile.Script); + await CheckBadOpcode(nefFile.Script.ToArray()); // Build script using ScriptBuilder sb = new ScriptBuilder(); @@ -168,7 +168,7 @@ public async Task UpdateContract(UInt160 contractHash, string nefPath, s // Read manifest ContractManifest manifest = ReadManifestFile(manifestPath); // Basic script checks - await CheckBadOpcode(nefFile.Script); + await CheckBadOpcode(nefFile.Script.ToArray()); // Build script using ScriptBuilder sb = new ScriptBuilder(); @@ -456,7 +456,8 @@ public async Task GetValidators() { var snapshot = Helpers.GetDefaultSnapshot(); var validators = NativeContract.NEO.GetCommittee(snapshot); - var candidates = NativeContract.NEO.GetCandidates(snapshot); + //var candidates = NativeContract.NEO.GetCandidates(snapshot); + var candidates = snapshot.GetCandidates(); return candidates.OrderByDescending(v => v.Votes).Select(p => new ValidatorModel { Publickey = p.PublicKey.ToString(), @@ -468,6 +469,7 @@ public async Task GetValidators() + /// /// apply for new validator /// @@ -493,7 +495,8 @@ public async Task ApplyForValidator(string pubkey) return Error(ErrorCode.InvalidPara); } var snapshot = Helpers.GetDefaultSnapshot(); - var candidates = NativeContract.NEO.GetCandidates(snapshot); + //var candidates = NativeContract.NEO.GetCandidates(snapshot); + var candidates = snapshot.GetCandidates(); if (candidates.Any(v => v.PublicKey.Equals(publicKey))) { return Error(ErrorCode.ValidatorAlreadyExist); @@ -573,7 +576,7 @@ private NefFile ReadNefFile(string nefPath) { throw new WsException(ErrorCode.ExceedMaxTransactionSize); } - using var stream = new BinaryReader(File.OpenRead(nefPath), Encoding.UTF8, false); + var stream = new MemoryReader(File.ReadAllBytes(nefPath)); try { return stream.ReadSerializable(); diff --git a/neo3-gui/neo3-gui/Services/ApiServices/WalletApiService.cs b/neo3-gui/neo3-gui/Services/ApiServices/WalletApiService.cs index 3ccd53f1..8f092278 100644 --- a/neo3-gui/neo3-gui/Services/ApiServices/WalletApiService.cs +++ b/neo3-gui/neo3-gui/Services/ApiServices/WalletApiService.cs @@ -108,8 +108,7 @@ public async Task CreateWallet(string path, string password, string priv break; case ".json": { - NEP6Wallet wallet = new NEP6Wallet(path, CliSettings.Default.Protocol); - wallet.Unlock(password); + NEP6Wallet wallet = new NEP6Wallet(path, password, CliSettings.Default.Protocol); var account = hexPrivateKey.NotEmpty() ? wallet.CreateAccount(hexPrivateKey) : wallet.CreateAccount(); wallet.Save(); result.Accounts.Add(new AccountModel() diff --git a/neo3-gui/neo3-gui/config.private.json b/neo3-gui/neo3-gui/config.private.json index b0c24ae7..f885d35d 100644 --- a/neo3-gui/neo3-gui/config.private.json +++ b/neo3-gui/neo3-gui/config.private.json @@ -7,7 +7,7 @@ }, "Storage": { "Engine": "LevelDBStore", - "Path": "Data_LevelDB_4444" + "Path": "Data_LevelDB_330" }, "P2P": { "Port": 30333, @@ -16,7 +16,7 @@ "PluginURL": "https://github.com/neo-project/neo-modules/releases/download/v{1}/{0}.zip" }, "ProtocolConfiguration": { - "Network": 4444, + "Network": 330, "MillisecondsPerBlock": 15000, "MaxTraceableBlocks": 2102400, "ValidatorsCount": 1, diff --git a/neo3-gui/neo3-gui/neo3-gui.csproj b/neo3-gui/neo3-gui/neo3-gui.csproj index 06795cbf..74bde1b1 100644 --- a/neo3-gui/neo3-gui/neo3-gui.csproj +++ b/neo3-gui/neo3-gui/neo3-gui.csproj @@ -24,13 +24,13 @@ - + - +