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

Update IntrinsicGasForAlternativeFeeCurrency #71

Open
palango opened this issue Nov 7, 2023 · 5 comments
Open

Update IntrinsicGasForAlternativeFeeCurrency #71

palango opened this issue Nov 7, 2023 · 5 comments
Labels
type:enhancement New feature or request

Comments

@palango
Copy link

palango commented Nov 7, 2023

Part of celo-org/optimism#6

See also https://www.notion.so/clabsco/ERC20-fee-currencies-for-CEL2-7fbf7c53e52c4cacab6e8e61d290fe93?pvs=4#4cdc12efd82247ca9f7a17cd0182caa7

@karlb
Copy link

karlb commented Apr 15, 2024

We log the gas usage for debit and credit on the trace log level. Once we have the fee currency directory and imported L1 state, we can check that output to choose good intrinsic gas values for each fee currency.

@ezdac
Copy link

ezdac commented Aug 1, 2024

My current findings:

Those have been gathered by filtering our Dango live-logs for the "Gas usage for debit+credit exceeds intrinsic gas!" info
log message and exporting those structured log-lines with json formatting.
The condition that this log message has been triggered is that at least one fee-currency transaction for this fee-currency has to be included in a block, that the gas usage surpasses the intrinsic gas deduted for fee-currency transactions 50000.

Then jq can help to (somewhat) combine the results:

cat Explore-logs-2024-07-09\ 16_27_02.json | jq 'group_by(.fields.feeCurrency)| map(unique_by(.fields.gasUsed))|map(map(.fields.gasUsed, .fields.feeCurrency))'

Log results as of 9th of July 2024

TetherToken:

  • address: 0xC4f86E9B4A588D501c1c3e25628dFd50Bc8D615e
  • logged gas usages: none (TODO, fee-currency tx has to be sent, but nobody seems to have balance)

USDC:

  • address: 0x4822e58de6f5e485eF90df51C41CE01721331dC0
  • logged gas usages: 122445, 125330, 139545
  • comments:
// 0x4822e58de6f5e485eF90df51C41CE01721331dC0 is a proxy for the FeeCurrencyAdapter 0x5dcadc7fdedfe713683f1bb3d72095fb7feb8fb3.
// That has the adaptedToken() 0x2F25deB3848C207fc8E0c34035B3Ba7fC157602B
//
// The FiatTokenProxy at 0x2F25deB3848C207fc8E0c34035B3Ba7fC157602B (USDC)
// (implementation at 0x7eDc367A34D81aEDAfC79a85ad6A1531D1e1bf86)

Celo Euro

  • address: 0x10c892A6EC43a53E45D0B916B4b7D383B1b78C0F
  • logged gas usages: 56840

Wrapped Ether

  • address: 0x13bD995ab709504e7FA9eF1E6155eE8FCAB2D697
  • logged gas usages: 64780

Celo Dollar

  • address: 0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1
  • logged gas usages: 56840

StableTest

  • address: 0xDB93874fE111F5a87Acc11Ff09Ee9450Ac6509AE
  • logged gas usages: 127745, 144845
  • comment:
adapted: 0x780c1551C2Be3ea3B1f8b1E4CeDc9C3CE40da24E 

Celo Brazilian Real

  • address: 0xE4D517785D091D3c54818832dB6094bcc2744545
  • logged gas usages: 56840

@ezdac
Copy link

ezdac commented Sep 25, 2024

To add some updates, the FeeCurrencyDirectory has been recently redeployed on Alfajores, and the intrinsic gas costs have been adapted:

This can be checked with the following fish script:

directory=0x9212Fb72ae65367A7c887eC4Ad9bE310BAC611BF ETH_RPC_URL=https://alfajores-forno.celo-testnet.org for currency in (cast call  "$directory" "getCurrencies() (address[] memory)" | string trim --chars="[]" | string split ', ');
      echo "currency: $currency"; cast call "$directory"  "getCurrencyConfig(address) (address, uint256)" $currency;end

Output:

currency: 0x03d3daB843e6c03b3d271eff9178e6A96c28D25f
0xFdd8bD58115FfBf04e47411c1d228eCC45E93075
50000 [5e4]
currency: 0x10c892A6EC43a53E45D0B916B4b7D383B1b78C0F
0xFdd8bD58115FfBf04e47411c1d228eCC45E93075
60000 [6e4]
currency: 0x1E0433C1769271ECcF4CFF9FDdD515eefE6CdF92
0xFdd8bD58115FfBf04e47411c1d228eCC45E93075
50000 [5e4]
currency: 0x1aD7b617cB6c5156A6dea6E47514D16476b99F38
0xFdd8bD58115FfBf04e47411c1d228eCC45E93075
50000 [5e4]
currency: 0x4822e58de6f5e485eF90df51C41CE01721331dC0
0xFdd8bD58115FfBf04e47411c1d228eCC45E93075
150000 [1.5e5]
currency: 0x7d027790998f714B294c96Fda9E27AF586d1EbB5
0xFdd8bD58115FfBf04e47411c1d228eCC45E93075
50000 [5e4]
currency: 0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1
0xFdd8bD58115FfBf04e47411c1d228eCC45E93075
60000 [6e4]
currency: 0xB0FA15e002516d0301884059c0aaC0F0C72b019D
0xFdd8bD58115FfBf04e47411c1d228eCC45E93075
60000 [6e4]
currency: 0xC4f86E9B4A588D501c1c3e25628dFd50Bc8D615e
0xFdd8bD58115FfBf04e47411c1d228eCC45E93075
50000 [5e4]
currency: 0xDB93874fE111F5a87Acc11Ff09Ee9450Ac6509AE
0xFdd8bD58115FfBf04e47411c1d228eCC45E93075
150000 [1.5e5]
currency: 0xE4D517785D091D3c54818832dB6094bcc2744545
0xFdd8bD58115FfBf04e47411c1d228eCC45E93075
60000 [6e4]
currency: 0xc9cce1e51F1393CE39EB722E3e59eDE6faBf89fD
0xFdd8bD58115FfBf04e47411c1d228eCC45E93075
50000 [5e4]

@lvpeschke
Copy link

@ezdac what's left to do here?

@ezdac
Copy link

ezdac commented Oct 22, 2024

@ezdac what's left to do here?

@lvpeschke For Alfajores there currently is nothing to do, but updating the values has to be done for the FeeCurrencyDirectory on mainnet as well.
I could not find any information on wether this has been done or how it will be done on Mainnet.
@pahor167 can we close this issue?

@ezdac ezdac removed their assignment Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants