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

Add Optimism Ecotone Support #213

Merged
merged 5 commits into from
Mar 14, 2024
Merged

Add Optimism Ecotone Support #213

merged 5 commits into from
Mar 14, 2024

Conversation

cgewecke
Copy link
Owner

@cgewecke cgewecke commented Mar 14, 2024

#214

(Thought this was going live on the 18th per #174 but it was moved ahead at some point.)

Issues

  • eth_blobBaseFee isn't available from the Etherscan API
  • eth_feeHistory from Alchemy does not include baseFeePerBlobGas

The endpoints are being added in a PR at geth: ethereum/go-ethereum#29140 and scheduled for the 1.14.0 release

Test with:

$ curl -k https://eth-mainnet.g.alchemy.com/v2/API_KEY -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_feeHistory","params":[4, "latest", [25, 75]],"id":1}'

Current Response

{
  "jsonrpc":"2.0",
  "id":1,
  "result": {
    "oldestBlock":"0x128880e",
    "reward":[["0x10c8ffa","0x77359400"],["0x10c8ffa","0xb2d05e00"],...["0x59682f00","0x1b42cbece"]],
    "baseFeePerGas":["0xe25844507","0xdc6dc8ce2","0xd31c9b2d7","0xdc3bfa810","0xc90a4c69e"],
    "gasUsedRatio":[0.39545245932653234,0.3309277088658616,0.6728477666666667,0.1513883]
  }
}

Update

  • Have read the scalars from Optimism's GasOracle and updated the constants file with them. (They're nothing like what docs said they'd be couple weeks ago?)
  • The oracle's blobBaseFee is coming back as 1 which results in ~10% inflation of the observed cost on Etherscan - am returning a hardcoded .1 to compensate because there's no other info source atm.
  • When the real price is available from an endpoint, will need to update to fetch it.
  • Pinning viem to 2.7.4 temporarily in this PR because the internal types seem like they have a lot of changes from minor to minor version. We're using their utils.

TODO:

  • Make sure L1 baseFee is changed to L1 blobBaseFee in the tables.
  • Update images for README and release
  • Sanity check numbers on Etherscan

switch(hexToDecimal(_type)) {
case 0: return 'legacy';
case 1: return 'eip2930;'
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smh

@cgewecke cgewecke merged commit 8da66f6 into master Mar 14, 2024
3 checks passed
@cgewecke cgewecke deleted the ecotone branch March 14, 2024 19:40
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

Successfully merging this pull request may close these issues.

None yet

1 participant