stonecoldpat / anonymousvoting

Anonymous voting on Ethereum without a tally authority. Protocol from this paper http://homepages.cs.ncl.ac.uk/feng.hao/files/OpenVote_IET.pdf
340 stars 88 forks source link

Browser-solidity : callback contain no result Gas required exceeds block gas limit: 4294967295 #6

Closed descampsk closed 7 years ago

descampsk commented 7 years ago

Hello,

I tried to compile the two contracts with the browser solidity but when i try to create the contract AnonymousVoting.sol:AnonymousVoting, I receive the following error : callback contain no result Gas required exceeds block gas limit: 4294967295

In your paper, you write about the cost of gas when the number of voters increased; but i didn't expect i couldn't even create the Contract on my private Blockchain.

For information, here is my genesis.json : { "config": { "chainId": 15, "homesteadBlock": 0, "eip155Block": 0, "eip158Block": 0 }, "nonce": "0x0000000000000042", "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", "difficulty": "0x4000", "alloc": {}, "coinbase": "0x0000000000000000000000000000000000000000", "timestamp": "0x00", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0xffffffff", "extraData": "0x00" } Do you have an idea of this problem ?

Thanks you for your work !

stonecoldpat commented 7 years ago

That is weird. I haven't used the online compiler for it. I just use the Ethereum wallet to deploy the code - seems to handle it ok. I'm uploading a tutorial on how to deploy it - so will post link here soon.

stonecoldpat commented 7 years ago

Hey. I made a video https://www.youtube.com/watch?v=5wch2_WhPvg&feature=youtu.be

Let me know if this helps.

descampsk commented 7 years ago

Not totally seen your video but thank you.

I tried to use the Ethereum Wallet but i got a compilation error : Unused local variable uint bit = 2 ** 255; This error is at the line 50 of the AnonymousVoting.sol.

If i delete this line, because it is apparently not used, I got the following error : Identifier not found. jumpi(end, iszero(bit)) The variable bit is used but not regognize as a used variable.

Do you know why i get this error ?

Thanks !

stonecoldpat commented 7 years ago

Yeah. Solidity doesn't seem to recognise that it is being used in the assembly block.

Easy fix. After that declaration just do:

bit = bit;

descampsk commented 7 years ago

Your fix works !

I could put the contract AnonymousVoting.sol by adding two lines : At line 50: uint bit = 2 ** 255; bit = bit //ADD

At line 345: uint dwPtr; // points to array of NAF coefficients. dwPtr = dwPtr //ADD

But I got an compilation error for the second contract LocalCrypto.sol :

At line 890 :

function verifyEqualityProof(uint r1, uint r2, uint r3, uint n, uint[2] c1, uint[2] c2, uint[2] t) returns (bool)

r1, r2 and r3 are unused in the function.

And // Time to start trying to verify it... will be moved to another function uint[2] memory temp; is unused too.

Can I just remove these variables ? What was the reason of these variables ?

stonecoldpat commented 7 years ago

Yeah just remove those variables :)

If you could do a pull request with these changes it would be much appreciated! I am near a laptop for awhile to do it myself!

descampsk commented 7 years ago

Ok i will do that :).

A bit later, I got problems to push from my location. Will do it at home :)

descampsk commented 7 years ago

I'm not a pro with git, but i tried to create a new branch and push on it, to do a pull request, but i couldn't do that : remote: Permission to stonecoldpat/anonymousvoting.git denied to descampsk. Is the repository restricted ?

stonecoldpat commented 7 years ago

Ah. It shouldn't be restricted. I've had a few pull requests already. (I'm not a pro either!)

stonecoldpat commented 7 years ago

I updated code to fix this :)

stonecoldpat commented 7 years ago