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

Gas consumption is too high to create AnonymousVoting contract! #22

Closed tkddn204 closed 6 years ago

tkddn204 commented 6 years ago

Hi, I'm studying your contract code, and I've cloned your code. I'm using ganache as testrpc, then deployed contract codes to ganache. But it occurred an out of gas error. So I raised the gas limit, stillthe same error occurs! So I raised the gas limit to 10000000000000000. Here is my ganache's block status page.

image

The transaction in block 4 is the creation transaction of the AnonymousVoting contract (the transaction in block 3 is the creation transaction of the LocalCrypto contract) The transaction also failed with out of gas error. I was amazed at this. On another issue, I could see its contract consumes the completion of the contract under 5 million gas. But I consumed a very very high gas! What is this problem???

stonecoldpat commented 6 years ago

Hey, it is great to see you looking at this contract!

For awhile now, either due to the Byzantium hard-fork or updates to the solidity compiler, the anonymous voting contract has been broken. The way to fix it is to adopt the new native ecadd/ecmul and incorporate it into the contract. Unfortunately no one has time to do this :( me included.

So really, the best way to run the anonymous voting contract is to download Geth 1.7.2, compile and deploy it. I'm not confident if this will work on the test/mainnet (if you test and it does; let me know!) but it certainly works on a private -dev network, which I normally use.

tkddn204 commented 6 years ago

I downloaded geth 1.7.2, then try to deploy... but mining out of memory error is ocurred. :( So I seem like getting headache... I'll try later. Thanks to your answer!