snapshot-labs / sx-monorepo

Snapshot monorepo
https://snapshot.box
MIT License
11 stars 10 forks source link

feat: add STARKNET_FEE_ESTIMATE_OVERRIDE env to hardcode fee #321

Closed Sekhmet closed 3 months ago

Sekhmet commented 3 months ago

Summary

This PR adds VITE_FEE_ESTIMATE_OVERRIDE that can be used to override fees in starknet-tx and herodotus clients. The fees are pretty high on Sepolia right now, over $4 to just propose on Sepolia. We could hardcode it to 10000000000000000 to be safe.

How to test

  1. Uncomment mana filter from yarn dev script.
  2. Run STARKNET_SEPOLIA_FEE_ESTIMATE_OVERRIDE=10000000000000000 VITE_MANA_URL=http://localhost:3001 yarn dev
  3. You can propose/vote on Starknet spaces with EthSig/StarkSig.
  4. Max fee is hardcoded in transaction.
bonustrack commented 3 months ago

I don't understand why it use a VITE_ config var, this is only for UI but the fee estimate happen on Mana, how would this work?

Sekhmet commented 3 months ago

Good point, VITE_ doesn't matter for non-vite projects (so it still works on mana), but it doesn't have to be prefixed with VITE_ if we don't use it in UI.

The prefix ended up there because I was testing it on UI, removed it now.

bonustrack commented 3 months ago

Also does that config var apply for both SN sepolia and mainnet?

Sekhmet commented 3 months ago

Also does that config var apply for both SN sepolia and mainnet?

It will and it might not be ideal (fees used shouldn't be affected as long as we have enough for max fee) - I can make it per-network though.

bonustrack commented 3 months ago

Per network would be nice