Git Product home page Git Product logo

neo's People

Contributors

annashaleva avatar ashrolls avatar ashuaidehao avatar belane avatar bettybao1209 avatar canesin avatar chenquanyu avatar cloud8little avatar cschuchardt88 avatar dahongfei avatar devhawk avatar doubiliu avatar erikzhang avatar eryeer avatar igormcoelho avatar ixje avatar jim8y avatar joeqian10 avatar jsolman avatar localhuman avatar lock9 avatar qiao-jin avatar roman-khimov avatar shargon avatar shawnyun avatar superboyiii avatar tommo-l avatar vncoelho avatar yongjiema avatar zhangtao1596 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neo's Issues

Cannot transfer NEO from a contract to wallet

I just following the documentations, generated a transfer body from the first node, and when signing in the second node, neo-gui says: 'The private key that can sign the data is not found'

image

Set 1 NEO to equal 1 vote

TLTR version here:

  1. Create a Slack group and have NEO holders join.
  2. Discuss how much shares you own together.
  3. Wait until you have a large enough group so that your shares totals to 5%.
  4. Split up all your shares so that there is only 500 shares in each node. You will have 10 000 nodes.
  5. Accumulate 10% of all coins so that you can nominate all 10 000 nodes for bookkeeeping.
  6. Have all your 10 000 nominees vote for each other.
  7. You will now have 10 000 nominees, each of the nominees will get 5% votes guaranteed.
  8. If 5% is above the bookkeeping threshold, the 5% consortium will now have 10 000 bookkeepers.

Above can be adjusted, the only expense is to buy coins for nomination. The only way to prevent this with current system is that NEO consortium realize this problem and split all their shares in a multitude on wallets and cross-vote to get majority consensus nodes. Even then it's not "secure", because you don't know how many bookkeepers that the minority consortium will split up into.

It's a risk, currently disregarded as an "assumption" and "not likely". Arguments that were used against people warning Coindash that not posting their address in advance is a bad idea and inviting for attacks. Not changing the vote system is also inviting for minority consortium attacks.

Long version:
It is known that bookkeepers will be voted by the NEO shareholders. There was a big confusion about that, especially this row from the old Whitepaper 1.0: 1份小蚁股投给一个候选记账人,计1票;1份小蚁股投给多个候选记账人,各个候选记账人各计得1票。

Literally, it means that one antshare equals one vote, and it is allowed to vote for multiple bookkeepers. If one antshare vote for one multiple bookkeepers, then each bookkeeper get one vote each.

Here is where the confusion starts. By allowing one share to vote for multiple bookkeepers, it opens up for "Stake attacks", that is buying up a lot of shares, creating for example 70 bookkeepers and then have them all vote for each other to secure >1/3 of bookkeeper nodes. This was previously argued against by saying it would be "too expensive" to be a real concern.

Game theory part: The biggest concern in such system is actually not one person with evil intent, but instead a consortium of smaller owners who go together to vote for each other since they all hold multiple votes. Thus, they don't even have to spend any money to gain enough shares, they can just agree to vote for each other beforehand. In fact, this would be the most beneficial strategy in such a system, guaranteeing that it would very quickly turn up a cartel who would control the bookkeeping nodes for eternity. A bit similar as current bitcoin situation, perhaps even worse.

The most straightforward suggestion would perhaps be "just allow one vote per wallet", but then you run into the problem that everyone votes for the most honest bookkeeper, and several dishonest bookkeepers can sneak in with minor votes (for example if 90% of the users vote for same bookkeeper, then the other 10% decide the rest of the bookkeepers, which is obviously not an optimal scenario)

Solution:

The solution is to split the votes, such as 1 ANS (NEO) is always equal to 1 vote, and if a shareholder votes for two different bookkeepers, then the shares he is holding will be split among these two bookkeepers. This solution will (1) prevent the "stake attack" mentioned by one attacker who creates multiple bookkeepers, (2) prevent the previously optimal cartel-strategy mentioned above, and (3) still allow for bigger stakeholders to vote for themselves (as we already acknowledge that there are players with different interests in the network).

The split can be done in two ways, one that allows fractional votes and one that does not allow fractional votes.
x = Voter's total number of ANS (NEO)

Allow fractional votes:

  1. Voter chooses n bookkeepers to vote for.
  2. Each bookkeeper receives x / n votes.

Do not allow fractional votes:

  1. Voter chooses n bookkeepers to vote for.
  2. Each bookkeeper receives (x - (x mod n) ) / n) votes. This mean that they will all get the same amount of votes, but there will be a remainder of votes that are not distributed since fractions are not allowed.
  3. The remainder votes will either be allowed to be distributed following step 1 again, or the remainder votes will be counted as abstained votes.

RPC documentation

Hi,
where is the detail documentation for each new rpc method .. the existing doc on docs.neo.org has only the old methods doesn't cover new ones.

Also , how can you supply rpcuser/pwd as command line switches ?

do we have a docker file ?

I'm trying to run server in daemon mode but there don't seem to be an option.

Wanted to check if anyone is working on dockerfile. The links in doc were pointing to a download portal. Would be great if there is a direct link that can be downloaded via wget (docker_image_antsharesdaemon.tar)

RPC: getrawmempool error

similar issue as #7

curl -d '{"jsonrpc":"2.0","id":"1","method":"getrawmempool","params":[]}' http://127.0.0.1:20332
{"jsonrpc":"2.0","id":"1","error":{"code":-32601,"message":"Method not found","data":"   at AntShares.Network.RPC.RpcServer.InternalCall(String method, JArray _params)\n   at AntShares.Network.RPC.RpcServer.ProcessRequest(JObject request)"}}

sys_fee should be an integer

When I sync block datas on Neo testnet,I found block 209913 and 210035's sys_fee are decimal,I think there is a bug,cause if it's a decimal, it divided by 100 million will have more than 8 decimal places.

CentOS: Unhandled Exception

Trying to launch a miner node in CentOS 7.2 following wiki guid, but failed with exception:

-> dotnet ./Miner.dll /rpc

Unhandled Exception: AntShares.Implementations.Blockchains.LevelDB.LevelDBException: Corruption: corrupted compressed block contents
   at AntShares.Implementations.Blockchains.LevelDB.NativeHelper.CheckError(IntPtr error)
   at AntShares.Implementations.Blockchains.LevelDB.Iterator.CheckError()
   at AntShares.Implementations.Blockchains.LevelDB.Iterator.Key()
   at AntShares.Implementations.Blockchains.LevelDB.Helper.<Find>d__0`1.MoveNext()
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source, Int32& length)
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__3.MoveNext()
   at System.Linq.Enumerable.<SelectManyIterator>d__157`2.MoveNext()
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source, Int32& length)
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
   at AntShares.Implementations.Blockchains.LevelDB.LevelDBBlockchain..ctor(String path)
   at AntShares.Shell.MainService.OnStart(String[] args)
   at AntShares.Services.ConsoleServiceBase.Run(String[] args)
   at AntShares.Program.Main(String[] args)
Aborted

Seems LevelDB related, please advise how to proceed.

Simulate and evaluate how number of consensus nodes can be used to improve performance and security

Issue background:
We want to avoid non-honest consortiums to gain majority as consensus nodes, which could be a bit tricky if the threshold for being a consensus node is the weighted average of mid-50 %.

We want NEO consortium to control the consensus nodes, and if number of total consensus node is set after voting (all nominees above weighted average of mid-50%), then it can be tricky for NEO consortium to know how many nominees they should spread out their votes on.

To investigate:

  1. If total number of consensus nodes is decided after voting, is there a risk for smaller consortiums to gain majority consensus nodes if NEO consortium spread out on too few nominees?

  2. If shareholders decide total number of consensus nodes before voting instead, would that make it easier for NEO consortium to guarantee that they have 2/3 of consensus nodes?

  3. If the answer on question 2 is yes, would that reduce number of iterations needed to reach consensus and speed up the block generation?

  4. If the answer on question 2 and 3 is yes, would it be an advantage or disadvantage for the NEO consortium to have an algorithm that decides number of votes that would guarantee a seat as consensus node?
    For example 150 000 votes, then he is guaranteed a seat and can't be voted on again. This way the number of seats can't be manipulated by attacks and major share holders know how to split their votes

White paper grammer?

Reading through the whitepaper I can see that there is no consistency regarding the term "Bitcoin". In some instances its refered to with a lower case "b" and other instances it begins with an upper case "B".

Neo android wallet- can't withdraw funds!!

Hi Neo, I downloaded and transferred neo coins into the Android mobile wallet but it wont allow you to transfer funds out. Many others have this problem. Please advise

EnrollmentTransaction.cs checking PK

in EnrollmentTransaction.cs the publickKey is not checked as part of DeserializeExclusiveData.

in contrast, in RegisterTransaction.cs you do check and throw a FormatException.

compare RegisterTransaction.DeserializeExclusiveData line 70-72
Owner = ECPoint.DeserializeFrom(reader, ECCurve.Secp256r1);
if (Owner.IsInfinity && AssetType != AssetType.SystemShare && AssetType != AssetType.SystemCoin)
throw new FormatException();

to EnrollmentTransaction.DeserializeExclusiveData line 47
PublicKey = ECPoint.DeserializeFrom(reader, ECCurve.Secp256r1);

Transaction negativity check

in Transaction, line 346, in the Verify function, the value of output.Value.GetData() could be negative.

The check for negativity is done in RpcServerWithWallet.cs, which is in the neo-cli project, rather than in Transaction.cs in the neo project.

Neo coins do not show in wallet while they are in my address

Today I transferred 10 neo into my neo wallet. However they do not show, while they are in my address.

The receiver address is: AXmAcTbCGJ14ww2E4e2J3LLgryToAFepZQ
Tx is: 916098048af68dad91a32de63a9074768ea244be815628035006fe5b2a4d0b38

I am using the web wallet

创建项目后,代码报错的问题及解决方案

根据文档(http://docs.neo.org/zh-cn/sc/getting-started-csharp.html)配置开发环境,在创建项目后,发现代码报错,如下图所示:

image

解决办法:
1、移除引用中的Neo.SmartContract.Framework重新添加;
2、点击项目,右键添加引用,找到Neo.SmartContract.Framework并添加;
image

image
3、完成后,还剩下一行代码报错;
image
4、直接把Framework删掉即可,代码终于不报错了。
image

5、接下来的步骤再继续按照文档走就好了。

TestNet Request Page Broken

A few of us have been trying to get TestNet funds through: https://www.antshares.org/Testnet/Create

Unfortunately, the form rejects public keys generated by MainNet wallets. Is there another way to generate public keys that work on the TestNet? If not, perhaps there is a bug?

Specifically, the error message we are getting is (in English) "Incorrect little ant public key"

(Apologies if this is not the correct place to post this error, wasn't sure where else to do it.)

How can we run NEO Node(neo-cli) as deamon

Hi.

In order to make RPC calls to neo node it is important for us to keep running a neo node in background so how can we achieve it with neo cli? I have tried it with tools like nohup and screen but can not make it. Please help me to run a node as deamon.

Import/Export blocks command?

Hello,

I see that there is an export blocks command on Neo-CLI but no import blocks.
Is this a feature that will be created later and should we not expect an import feature?

Thanks for the work.

public key

When I open wallet in NEO-GUI and view private keys , above there is Address and Public Key in upper window . In bottom window thee are private keys , HEX and WIF .
My question is - what for is there a Public Key ?
What is its function and how to use this key .
So far this is what I find about .
(4) Public key: Each private key has a matching public key (Note: Public key, and private key information can be viewed by right clicking on the address.)
Thanks for any help .

Translation

Hello,

I just bought my first NEO shares and I believe in this project.

Please be kind enough to PM me if you need translation for portuguese and brazilian portuguese.

Official NEO repo ?

I have been 'watching' this code repo for NEO for past few months, and by looking at the very low volume of commits I am wondering if I am subscribed to the official NEO repo or not ? I have subscribed to other projects as well and comparatively this seems very less active. Can I get pointed to the future road map of NEO ?

English README

Hi! A suggestion would be to have the readme in english. I know a lot of people speak chinese but if you want to reach out beyond china it can be difficult. You could also consider having two readmes, one in chinese and one in english.

Please add getaddr to JSON-RPC

Please add the getaddr functionality to JSON-RPC.

I'd like to be able to display a map of all the NEO nodes and their current NEO version by geocoding their IP addresses, but that information is only available via the binary port 10333.

This will also allow me to display and debug network splits and versioning inconsistencies. For example some seeds are currently on 2.0.1 and some on 2.0.0.

I'd love to show the same information, for all nodes, but to do that currently requires me to make a custom neo-cli RPC. (sending getaddr through port 10333 without doing the verack handshake just gives back the version response from neo-cli 2.0.1).

host:seed1.neo.org; label:version; userAgent:/NEO:2.0.0/; port:10333; startHeight:1198745; timestamp:1501323224; services:1;
host:seed2.neo.org; label:version; userAgent:/NEO:2.0.0/; port:10333; startHeight:1198745; timestamp:1501323225; services:1;

host:seed3.neo.org; label:version; userAgent:/NEO:2.0.1/; port:10333; startHeight:1198745; timestamp:1501323226; services:1;
host:seed4.neo.org; label:version; userAgent:/NEO:2.0.1/; port:10333; startHeight:1198326; timestamp:1501323229; services:1;
host:seed5.neo.org; label:version; userAgent:/NEO:2.0.1/; port:10333; startHeight:1198115; timestamp:1501323237; services:1;

Transaction.cs verify, case falthrough.

in Transaction.cs line 360, in the function Verify, the case statement for TransactionType.MinerTransaction falls through to TransactionType.ClaimTransaction.

Unless I misunderstood the whitepaper, this is incorrect as MinerTransaction does not issue SystemCoin Assets, so it should fail verification if any SystemCoin assets are issued as part of a MinerTransaction

当 json-rpc 传入的数组中有回车时,Json格式化错误

当 json-rpc 请求的数组中有回车或换行时,服务器会返回错误(-32700 Parse error)。

{
  "jsonrpc": "2.0",
  "method": "sendmany",
  "params": [[
  	{"asset": "025d82f7b00a9ff1cfe709abe3c4741a105d067178e645bc3ebad9bc79af47d4","value": 1,"address": "AbRTHXb9zqdqn5sVh4EYpQHGZ536FgwCx2"},{"asset": "025d82f7b00a9ff1cfe709abe3c4741a105d067178e645bc3ebad9bc79af47d4","value": 1,"address": "AbRTHXb9zqdqn5sVh4EYpQHGZ536FgwCx2"}]],
  "id": 1
}

将数组中的回车删掉,服务器会返回正确结果

{
  "jsonrpc": "2.0",
  "method": "sendmany",
  "params": [[{"asset": "025d82f7b00a9ff1cfe709abe3c4741a105d067178e645bc3ebad9bc79af47d4","value": 1,"address": "AbRTHXb9zqdqn5sVh4EYpQHGZ536FgwCx2"},{"asset": "025d82f7b00a9ff1cfe709abe3c4741a105d067178e645bc3ebad9bc79af47d4","value": 1,"address": "AbRTHXb9zqdqn5sVh4EYpQHGZ536FgwCx2"}]],
  "id": 1
}

估计是 JSON 解析的时候出错的,当用 Newtonsoft Json.NET 解析时不会出错。

更简单的测试用例:

{
  "jsonrpc": "2.0",
  "method": "getblockcount",
  "params": [
  	],
  "id": 1
}

JSON 解析错误

{
  "jsonrpc": "2.0",
  "method": "getblockcount",
  "params": [],
  "id": 1
}

JSON 解析正确

Unhandled exception when sending assets from contract address

Using the following test contract:

using Neo.SmartContract.Framework.Services.Neo;

namespace Neo.SmartContract
{
    public class Lock : Framework.SmartContract
    {
        public static bool Main()
        {
            return true;
        }
    }
}

If I understand correctly, this should allow anyone to spend from the contract address. But a transfer attempt fails on actual execution - the GUI always crashes with an exception "Index was outside the bounds of the array" in Neo.SmartContract.ContractParametersContext.Add.

Develop smart contracts on Linux/macOS

Is it possible to develop NEO smart contracts using .NET Core instead of .NET Framework? It is stated that NEO supports .NET Core, but the docs are only for Windows and examples do not compile on macOS

Our Own Chain

Is it possible to fork your project and start our own parallel blockchain based on your technology?

Have public address, lost private key

https://antchain.xyz/search?q=AavSSqSm2o1Zq2hvYFAwGS8s5MWtQ2LdiN

Hello, I reached out to the dev team via email, tweeted and reached out to fabwa on reddit. While I just reached out, i also wanted to reach out here.

Here's my situation. When I became an investor originally of anthsares, I stored my coins on the exchange. At the end of June, I downloaded the wallet and create an address. At the time I thought once I sent over my coins from the exchange to my wallet address I would have to resave the wallet file with the old one. i did this, and my coins disappeared (it erased the original file, since I renamed the new wallet file the same name). I hadn't saved the private key and now am unable to access my coins.

I can verify the transaction occurred under my name through my bittrex account which would match whats on the explorer website above.

While reading the whitepaper for antshares it states, "For the sake of lost private keys, Antshares has an asset-retrieving mechanism in place, i.e. even if you lose the private key to a certain address, assets within it are still retrievable without helps from a third party."

Please help me get my coins back. I've attached screenshots of my the transfers from my exchange account and then verify this is in fact mine through antchain.xyz.

bittrex neo transfers

RPC: getblock <index>

curl -d '{"jsonrpc":"2.0","id":"1","method":"getblock","params":[222]}' http://127.0.0.1:20332
{"jsonrpc":"2.0","id":"1","error":{"code":-2146233033,"message":"\u5B57\u7B26\u4E32\u0022333\u0022\u65E0\u6CD5\u8BC6\u522B\u4E3A\u6B63\u786E\u7684UInt256\u3002","data":"   at AntShares.UInt256.Parse(String s)\n   at AntShares.Network.RPC.RpcServer.InternalCall(String method, JArray _params)\n   at AntShares.Network.RPC.RpcServer.ProcessRequest(JObject request)"}}

The error says "字符串"333"无法识别为正确的UInt256。". getblock is supposed to support block hash or height as parameter.

RpcServer invokefunction reading wrong param

Have been playing with invokefunction and realised that it cannot work with any methods that accepts arguments.

This is an example of the POST i am sending to a v2.3.3 node. It is the BalanceOf method shown in the tutorial for SC in neo docs.

{"jsonrpc": "2.0", "method": "invokefunction", "params": ["dc675afc61a7c0f7b3d2682bf6e1d8ed865a0e5f", "balanceOf", "5fe459481de7b82f0636542ffe5445072f9357a1261515d6d3173c07c762743b"], "id": 3}

Upon closer inspection, it seems like the invokefunction case reads the args wrongly. It should be reading _params[2] instead of _params[1]

ContractParameter[] args = _params.Count >= 3 ? ((JArray)_params[1]).Select(p => ContractParameter.FromJson(p)).ToArray() : new ContractParameter[0];

case "invokefunction":
    {
        UInt160 script_hash = UInt160.Parse(_params[0].AsString());
        string operation = _params[1].AsString();
        // This line should be reading _params[2] instead
        ContractParameter[] args = _params.Count >= 3 ? ((JArray)_params[1]).Select(p => ContractParameter.FromJson(p)).ToArray() : new ContractParameter[0];
        byte[] script;
        using (ScriptBuilder sb = new ScriptBuilder())
        {
            script = sb.EmitAppCall(script_hash, operation, args).ToArray();
        }
        return GetInvokeResult(script);
    }

Issue in calling the contract in c#

Hey, I have problem in calling the contract which has the parameter of type array. Anybody help me to get out of this.

Contract.cs
public static int Main(string str, int[] arr)
{
int a = arr[0];
int b = arr[1];
if (str == "add")
{
return a + b;
}
else
{
return a - b;
}

    }

And I am calling like this in console App.
Program.cs
class Program
{
static void Main(string[] args)
{

    var engine = new ExecutionEngine(null, Crypto.Default);
        engine.LoadScript(File.ReadAllBytes(@"Path to .avm file"));

        using (ScriptBuilder sb = new ScriptBuilder())
        {

            int[] arr = { 1,2};
            byte[] bytes = arr.Select(x => (byte)x).ToArray();
            sb.EmitPush(bytes);
            sb.EmitPush("add"); 
            engine.LoadScript(sb.ToArray());
        }

        engine.Execute(); // start execution

        var result = engine.EvaluationStack.Peek().GetBigInteger(); // set the return value here
        Console.WriteLine($"Execution result {result}");

}
}

Incorrect GAS balance from "getaccountstate" of JSON-RPC API

The output of getaccountstate appears to have provide imprecise value for GAS with decimals.

Examples:

result: {
  version: 0,
  script_hash: '0x8751c9a9aad30f4bed5569eab42c53b7d6ac5096',
  frozen: false,
  votes: [],
  balances:
    [{
        asset: '0xc56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b',
        value: '598'
      },
      {
        asset: '0x602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7',
        value: '3000'
      }
    ]
}

getpeers fails with "Object reference not set to an instance of an object."

when I call getpeers on the RPC service http://test1.cityofzion.io:8880 i get an error response.

{"method":"getpeers","id":1,"jsonrpc":"2.0","params":[]}

I get a error response pointing to RpcServer.cs:line 283
peerJson["port"] = node.ListenerEndpoint.Port;

{"id":1,"jsonrpc":"2.0","error":{"code":-2147467261,"data":"   at Neo.Network.RPC.RpcServer.Process(String method, JArray _params) in C:\\Users\\me\\NEO\\neo\\neo\\Network\\RPC\\RpcServer.cs:line 283\n   at Neo.Network.RPC.RpcServerWithWallet.Process(String method, JArray _params)\n   at Neo.Network.RPC.RpcServer.ProcessRequest(JObject request) in C:\\Users\\me\\NEO\\neo\\neo\\Network\\RPC\\RpcServer.cs:line 371","message":"Object reference not set to an instance of an object."}}

some nodes do not give that response.
http://test5.cityofzion.io:8880

{"result":"a really long set of addresses"}

RPC: getconnectioncount error

curl -d '{"jsonrpc":"2.0","id":"1","method":"getconnectioncount","params":[]}' http://127.0.0.1:20332
{"jsonrpc":"2.0","id":"1","error":{"code":-32601,"message":"Method not found","data":"   at AntShares.Network.RPC.RpcServer.InternalCall(String method, JArray _params)\n   at AntShares.Network.RPC.RpcServer.ProcessRequest(JObject request)"}}

Developer Tool: when enter invalid json chars, errors happens

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.FormatException: One of the identified items was in an invalid format.
at AntShares.IO.Json.JObject.Parse(TextReader reader) in C:\Users\Erik\Documents\Visual Studio 2015\Projects\AntShares\AntSharesCore\IO\Json\JObject.cs:line 117
at AntShares.IO.Json.JObject.Parse(String value) in C:\Users\Erik\Documents\Visual Studio 2015\Projects\AntShares\AntSharesCore\IO\Json\JObject.cs:line 138
at AntShares.Core.SignatureContext.Parse(String value) in C:\Users\Erik\Documents\Visual Studio 2015\Projects\AntShares\AntSharesCore\Core\SignatureContext.cs:line 145
at AntShares.UI.DeveloperToolsForm.button1_Click(Object sender, EventArgs e) in C:\Users\Erik\Documents\Visual Studio 2015\Projects\AntShares\AntSharesUI\UI\DeveloperToolsForm.cs:line 27
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

LevelDBBlockchain.cs Persist Negativity Check

on line 512 in LevelDBBlockchain.cs, in the function Persist, in the case for IssueTransaction, the subtraction is not checked for overflow. this would allow you to issue more aassets than the available assets.

case TransactionType.IssueTransaction
assets.GetAndChange(result.AssetId).Available -= result.Amount;

Compilation failed

branch: testnet-coreclr
commit: head (ed35261)

[vagrant@localhost Miner]$ dotnet run /rpc
Project AntSharesCore (.NETStandard,Version=v1.6) will be compiled because inputs were modified
Compiling AntSharesCore for .NETStandard,Version=v1.6
/opt/dotnet/dotnet compile-csc @/home/vagrant/src/AntShares/AntSharesCore/obj/Debug/netstandard1.6/dotnet-compile.rsp returned Exit Code 1
/home/vagrant/src/AntShares/AntSharesCore/Network/RemoteNode.cs(191,66): error CS0103: The name 'hash' does not exist in the current context

Compilation failed.
    0 Warning(s)
    1 Error(s)

Time elapsed 00:00:06.5898629

coreclr branch with 6dee267 works fine

小蚁客户端领取小蚁币程序奔溃,再次运行打开钱包数据库就崩溃。。。

领取小蚁币时点一次全部领取按钮,弹出来一个窗口,里边一个文本框显示交易编号还是什么来着,我关闭窗口后,再点一次全部领取,然后程序就崩溃了。
崩溃后我重新运行程序,能正常运行,在打开钱包数据库操作时,选择钱包文件,输入密码,点确定,这时候程序再崩溃,再怎么重复都是这样崩溃。。。
以下是错误窗口的日志
`See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.FormatException: One of the identified items was in an invalid format.
at AntShares.Core.ClaimTransaction.DeserializeExclusiveData(BinaryReader reader) in C:\Users\Erik\Documents\Visual Studio 2015\Projects\AntShares\AntSharesCore\Core\ClaimTransaction.cs:line 34
at AntShares.Core.Transaction.DeserializeUnsignedWithoutType(BinaryReader reader) in C:\Users\Erik\Documents\Visual Studio 2015\Projects\AntShares\AntSharesCore\Core\Transaction.cs:line 170
at AntShares.Core.Transaction.DeserializeFrom(BinaryReader reader) in C:\Users\Erik\Documents\Visual Studio 2015\Projects\AntShares\AntSharesCore\Core\Transaction.cs:line 154
at AntShares.Core.Transaction.DeserializeFrom(Byte[] value, Int32 offset) in C:\Users\Erik\Documents\Visual Studio 2015\Projects\AntShares\AntSharesCore\Core\Transaction.cs:line 138
at AntShares.Implementations.Wallets.EntityFramework.UserWallet.<>c.b__15_0(Transaction p) in C:\Users\Erik\Documents\Visual Studio 2015\Projects\AntShares\AntSharesCore\Implementations\Wallets\EntityFramework\UserWallet.cs:line 130
at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at AntShares.UI.MainForm.CurrentWallet_TransactionsChanged(Object sender, IEnumerable1 transactions) in C:\Users\Erik\Documents\Visual Studio 2015\Projects\AntShares\AntSharesUI\UI\MainForm.cs:line 95
at AntShares.UI.MainForm.ChangeWallet(UserWallet wallet) in C:\Users\Erik\Documents\Visual Studio 2015\Projects\AntShares\AntSharesUI\UI\MainForm.cs:line 60
at AntShares.UI.MainForm.打开钱包数据库OToolStripMenuItem_Click(Object sender, EventArgs e) in C:\Users\Erik\Documents\Visual Studio 2015\Projects\AntShares\AntSharesUI\UI\MainForm.cs:line 305
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0 built by: NETFXREL1

CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll

AntSharesUI
Assembly Version: 1.0.6134.21697
Win32 Version: 1.0.6134.21697

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/AntSharesUI.exe

System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0 built by: NETFXREL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0 built by: NETFXREL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0 built by: NETFXREL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

AntSharesCore
Assembly Version: 1.0.6134.21696
Win32 Version: 1.0.6134.21696

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/AntSharesCore.DLL

System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0 built by: NETFXREL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0 built by: NETFXREL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0 built by: NETFXREL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

AntSharesUI.resources
Assembly Version: 1.0.6134.21697
Win32 Version: 1.0.6134.21697

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/zh-Hans/AntSharesUI.resources.DLL

System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0 built by: NETFXREL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll

Microsoft.GeneratedCode
Assembly Version: 1.0.0.0
Win32 Version: 4.6.2001.0 built by: NETFXREL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0 built by: NETFXREL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll

EntityFramework.Core
Assembly Version: 7.0.0.0
Win32 Version: 7.0.0.11116

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/EntityFramework.Core.DLL

System.Interactive.Async
Assembly Version: 1.2.0.0
Win32 Version: 1.2.50730

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/System.Interactive.Async.DLL

Microsoft.Extensions.DependencyInjection.Abstractions
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.11116

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/Microsoft.Extensions.DependencyInjection.Abstractions.DLL

Microsoft.Extensions.DependencyInjection
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.11116

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/Microsoft.Extensions.DependencyInjection.DLL

Microsoft.Extensions.OptionsModel
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.11116

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/Microsoft.Extensions.OptionsModel.DLL

Microsoft.Extensions.Logging
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.11116

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/Microsoft.Extensions.Logging.DLL

Microsoft.Extensions.Caching.Abstractions
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.11116

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/Microsoft.Extensions.Caching.Abstractions.DLL

Microsoft.Extensions.Caching.Memory
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.11116

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/Microsoft.Extensions.Caching.Memory.DLL

Remotion.Linq
Assembly Version: 2.0.0.0
Win32 Version: 2.0.1.0

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/Remotion.Linq.DLL

System.Runtime
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Runtime.dll

System.Linq.Expressions
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Linq.Expressions/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Linq.Expressions.dll

Microsoft.Extensions.Logging.Abstractions
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.11116

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/Microsoft.Extensions.Logging.Abstractions.DLL

Microsoft.Data.Sqlite
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.11116

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/Microsoft.Data.Sqlite.DLL

EntityFramework.Sqlite
Assembly Version: 7.0.0.0
Win32 Version: 7.0.0.11116

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/EntityFramework.Sqlite.DLL

EntityFramework.Relational
Assembly Version: 7.0.0.0
Win32 Version: 7.0.0.11116

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/EntityFramework.Relational.DLL

System.Diagnostics.DiagnosticSource
Assembly Version: 4.0.0.0
Win32 Version: 4.6.23516.01

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/System.Diagnostics.DiagnosticSource.DLL

Anonymously Hosted DynamicMethods Assembly
Assembly Version: 0.0.0.0
Win32 Version: 4.6.2001.0 built by: NETFXREL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll

System.ComponentModel.DataAnnotations
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.DataAnnotations/v4.0_4.0.0.0__31bf3856ad364e35/System.ComponentModel.DataAnnotations.dll

System.Threading
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Threading/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Threading.dll

System.Diagnostics.Tracing
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Diagnostics.Tracing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Diagnostics.Tracing.dll

System.Reflection
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Reflection/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Reflection.dll

System.Collections
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Collections/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Collections.dll

System.Linq
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Linq/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Linq.dll

System.Reflection.Extensions
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Reflection.Extensions/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Reflection.Extensions.dll

System.Linq.Queryable
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Linq.Queryable/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Linq.Queryable.dll

System.Runtime.Extensions
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Extensions/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Runtime.Extensions.dll

Microsoft.Extensions.Primitives
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.11116

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/Microsoft.Extensions.Primitives.DLL

System.ObjectModel
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ObjectModel/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.ObjectModel.dll

System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0 built by: NETFXREL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll

System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0 built by: NETFXREL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll

Microsoft.Extensions.PlatformAbstractions
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.11116

CodeBase: file:///C:/%E8%99%9A%E6%8B%9F%E5%B8%81/AntShares/Microsoft.Extensions.PlatformAbstractions.DLL

Microsoft.CSharp
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.CSharp/v4.0_4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll

System.Dynamic
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Dynamic/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Dynamic.dll

System.Security
Assembly Version: 4.0.0.0
Win32 Version: 4.6.2001.0 built by: NETFXREL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Security/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Security.dll

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

`

Group up extension methods by source type and comment them.

There are many extension methods in use by the neo project.

I would like the group them up into individual static classes based on their type. During this process I would also comment the extension methods to explain what they are doing. This will improve the codebase for future development and documentation.

For example:

internal static BigInteger Mod(this BigInteger x, BigInteger y)
{
	x %= y;
	if (x.Sign < 0)
		x += y;
	return x;
}

Would become

/// <summary>
/// Divides the value of the source BigInteger by the division parameter, and returns the remainder.
/// See: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/modulus-operator
/// </summary>
internal static BigInteger Mod(this BigInteger source, BigInteger division)
{
	source %= division;
	if (source.Sign < 0)
		source += division;
	return source;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.