- 11 Nov, 2021 40 commits
-
-
Mark Tyneway authored
Add test coverage for new fee scheme and refactor old tests to work with new scheme
-
Mark Tyneway authored
Add a helper function for computing the L1 cost. It looks byte by byte and sums how much the calldata would cost given the calldata costs for 0 or non 0 bytes.
-
Mark Tyneway authored
Previously, the L1 gas price was being fetched from a remote node and being held in memory. Now the L1 gas price is in a smart contract and the `SyncService` will periodically update the L1 gas price in an in memory cache to ensure that users that are sending transactions are paying enough. This also reads the overhead from the `OVM_GasPriceOracle` and rejects transactions with too low of a fee. The `tx.gasPrice` can now be variable, it no longer will reject transactions if the gas price isn't exactly the hardcoded number. The cache is now updated when the sender of a transaction included in the chain is from the current gas price oracle owner address. This depends on the cache being initialized at startup.
-
Mark Tyneway authored
The `gas-oracle` will now periodically ping L1 asking for the latest header and will update the `l1BaseFee` value in the `OVM_GasPriceOracle` oracle predeploy when the base fee changes more than a configurable amount. This is very similar to the way that the `gas-oracle` sets the L2 gas price based on the amount of gas that has been used in an amount of time. Note that this is a breaking change when it comes to config. Some config options are renamed and some config options are added. `--ethereum-http-url` now corresponds to the L1 URL and `--layer-two-http-url` corresponds to the L2 URL. Previously, only an L2 URL was provided and it was called `--ethereum-http-url`. Now there are flags for `--l1-chain-id` and `--l2-chain-id` when previously `--chain-id` corresponded to the L2 chain id. There are also now flags for turning on and off functionality. `--enable-l1-base-fee` and `--enable-l2-gas-price` are used to turn on updating of the corresponding values. They are on by default. The `--l1-base-fee-significant-factor` is expected to be a decimal and determines how much the base fee on L1 must change before the `gas-oracle` will consider updating the base fee by sending a transaction to the `OVM_GasPriceOracle`.
-
Mark Tyneway authored
Add a setter for L1 base fee. The trusted oracle can update it over time. Eventually this will become trustless, but this is a quick and easy approach for now. Also add a setter/getter for the per batch overhead and the scalar. Also emit events for when the values are updated. This will make it much easier to track historical gas prices over time. Add tests for new functionality. L2 geth will consume the new value in the `OVM_GasPriceOracle` Add getters that make it easy for users to know the L1 costs. - `getL1Fee` returns the L1 fee given the current L1 base fee known by the L2 node - `getL1GasUsed` counts the bytes and creates a sum for the gas cost of submitting the data to L1
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
elenadimitrova authored
-
Kelvin Fichter authored
-
Kelvin Fichter authored
-
Maurelian authored
It is generated by yarn build, and listed in the .gitignore file in this package, presumably it was added by mistake
-
Maurelian authored
-
Maurelian authored
-
Maurelian authored
-
Maurelian authored
-
Kelvin Fichter authored
-
Kelvin Fichter authored
-
Kelvin Fichter authored
-