blockparty icon indicating copy to clipboard operation
blockparty copied to clipboard

Do not default gasLimit to 1M

Open makoto opened this issue 6 years ago • 5 comments

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 )

makoto avatar Jul 18 '18 09:07 makoto

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:

  • 165K gas: https://etherscan.io/tx/0xd07103c83c76ad7fcbda80097de2510370a722eca28a16704b007007bbc14f0d
  • 159K gas: https://etherscan.io/tx/0x3591682938b0ffae18f8cf8b7d80de347abaca8cb70c3d64ef12987e6e50d92d

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

vietlq avatar Jul 18 '18 09:07 vietlq

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

makoto avatar Jul 18 '18 09:07 makoto

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

vietlq avatar Jul 18 '18 09:07 vietlq

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

makoto avatar Jul 18 '18 10:07 makoto

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

vietlq avatar Jul 18 '18 10:07 vietlq