-
Notifications
You must be signed in to change notification settings - Fork 175
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
feat: katana gas oracle #2558
Comments
Hi, I would love to work on this issue. I have experience with Rust and also contributing to Kakarot with Cairo. I will make sure to communicate if I encounter any issues along the way |
@augustin-v assigned :). you can take a look at madara's implementation for some reference. |
@augustin-v i've added a very simple skeleton code for the gas oracle in #2643. its only supporting fixed gas prices as we already have today. |
Problem
Right now, Katana hardcoded the gas prices value. These gas prices are then used for computing the fees that transactions has to pay.
Though it works fine when using Katana just for testing/dev environment but for actual production setting we want to properly sample the L1 gas prices. Refer to the doc below for how starknet sample the l1 gas price:
https://docs.starknet.io/architecture-and-concepts/network-architecture/fee-mechanism/#calculation_of_gas_costs
Implementation for the gas oracle component should be able to (1) perform actual sampling on the underlying L1, (2) hardcoded value when katana is not run with an L1 (ie testing env).
On every new block, we'd then need to update the gas price values that have been sampled, in the block env:
dojo/crates/katana/core/src/backend/mod.rs
Lines 101 to 117 in e6bab2d
The text was updated successfully, but these errors were encountered: