makoto / blockparty

NO BLOCK NO PARTY
MIT License
164 stars 41 forks source link

Do not default gasLimit to 1M #169

Open makoto opened 6 years ago

makoto commented 6 years ago

It's currently set here

https://github.com/makoto/blockparty/blob/master/src/index.js#L224

Which gives heart attack to some users.

https://twitter.com/vietlq/status/1019509916321636352

The ideal solution would be to use estimated gas price (unless most wallet dynamically calculate in which case we can completely take out )

vietlq commented 6 years ago

I checked a few block party contracts and found that most of them hang around ~150K gas and can be near 170K in some cases:

It's best to warn users about the gas limit on the web page and suggest limit around 200K.

makoto commented 6 years ago

Some of the admin functions may cost over 1M so the alternative is to hard code gas limit per function.

https://github.com/makoto/blockparty/blob/master/log/stress_0100.log

The inefficiency of admin gas cost is something we are tracking separately https://github.com/makoto/blockparty/issues/160

vietlq commented 6 years ago

The register function actually has fluctuating gas cost, I believe due to the dependency on the input size for name & twitter handle. That should be addressed in https://github.com/makoto/blockparty/issues/171 and https://github.com/makoto/blockparty/issues/170 and remove dependency on input size

register    108685  1   468 0.000108685 0.05086458
makoto commented 6 years ago

I guess I can make it constant if I hash the input. Removing these fields are topic of their own.

vietlq commented 6 years ago

I discussed solution here for constant gas cost: https://github.com/makoto/blockparty/issues/171