blockparty
blockparty copied to clipboard
Do not default gasLimit to 1M
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 )
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.
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
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
I guess I can make it constant if I hash the input. Removing these fields are topic of their own.
I discussed solution here for constant gas cost: https://github.com/makoto/blockparty/issues/171