Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eon key publishing gas limit estimation error #480

Open
jannikluhn opened this issue Jul 2, 2024 · 1 comment
Open

Eon key publishing gas limit estimation error #480

jannikluhn opened this issue Jul 2, 2024 · 1 comment

Comments

@jannikluhn
Copy link
Contributor

Here's a used eon key publishing contract: https://gnosis-chiado.blockscout.com/address/0x92b3cAFc417483deBcC1ECDC1d00C476D1638D77

In the first block, three keypers try to vote on a new key, but only one succeeds. In the second, the two remaining keypers try again. This time again only one succeeds. The threshold here is two.

The issue seems to be that the first t - 1 transactions take a small amount of gas (just recording a vote). Transaction t will be more expensive since it will store the key in the broadcasting contract. When keypers estimate the gas for their transaction, usually 0 votes have been submitted so far, so all keypers think they need little gas. This turns out to be wrong for the last ones. In the next block, gas estimation succeeds again.

A possible solution might be to hardcode the gas limit. However, I'm not sure if the required gas amount depends on the number of keypers. It might be safer to multiply the estimated gas amount by a certain factor.

However, all of this is not critical. Eventually, the broadcast succeeds, we just have a few failed transactions.

@konradkonrad
Copy link
Contributor

For a gas optimized version, we could also have a responsibility coordination algorithm:

  1. order the keypers by proximity of their address to the eon key (probably needs some projection from key space to address space)
  2. closest keyper will publish immediately at block X (when the key is available)
  3. second closest will publish with n blocks delay at X + n
  4. rest will publish later at X + 2 * n if not yet published

Granted, this is way more complicated and probably overkill, since the current scheme, albeit wasteful, just works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants