core: handle base fee, l1 availability fee, tx fee#26
core: handle base fee, l1 availability fee, tx fee#26tuxcanfly wants to merge 1 commit intooptimism-prototypefrom
Conversation
|
Ok, I took a look at the math. My suggestion is as follows: Basically the scalar & decimals in the contract must be set relative to each other & we should only use integer math, not floating point math. To get a scalar that is like 1.3, the scalar should be 1.3 * 10^decimals & the decimals should be appropriately set. |
Thanks this works, updated. |
|
This is looking pretty good. I only have these couple comments + a proper PR description is what this needs from my side to get it merged. |
|
Ok, rerunning tests. It looks like the new auth tests are flaky. Once tests go green, I'll approve. |
trianglesphere
left a comment
There was a problem hiding this comment.
LGTM. Please squash this for the merge. Feel free to wait to merge this until testing is all integrated.
This PR depends on ethereum-optimism#26 on reference-optimistic-geth: ethereum-optimism/reference-optimistic-geth#26 A new test TestFees is added, which runs a simple transaction and tests that the L2 fee is redirected to the configured fee recipient and that the L1 availability fee is calculated based the RLP encoded transaction size and also redirected to the configured fee recipient. TestFees is skipped, but can be enabled the above PR is merged into reference-optimistic-geth. NOTE: After ethereum-optimism#26 reference-optimistic-geth is merged, L2 genesis configuration needs to be updated for OptimismConfig to enable special fee handling and to find L1Block, GasPriceOracle contract addresses.
This PR depends on ethereum-optimism#26 on reference-optimistic-geth: ethereum-optimism/reference-optimistic-geth#26 A new test TestFees is added, which runs a simple transaction and tests that the L2 fee is redirected to the configured fee recipient and that the L1 availability fee is calculated based the RLP encoded transaction size and also redirected to the configured fee recipient. TestFees is skipped, but can be enabled the above PR is merged into reference-optimistic-geth. NOTE: After ethereum-optimism#26 reference-optimistic-geth is merged, L2 genesis configuration needs to be updated for OptimismConfig to enable special fee handling and to find L1Block, GasPriceOracle contract addresses.
This PR depends on ethereum-optimism#26 on reference-optimistic-geth: ethereum-optimism/reference-optimistic-geth#26 A new test TestFees is added, which runs a simple transaction and tests that the L2 fee is redirected to the configured fee recipient and that the L1 availability fee is calculated based the RLP encoded transaction size and also redirected to the configured fee recipient. TestFees is skipped, but can be enabled the above PR is merged into reference-optimistic-geth. NOTE: After ethereum-optimism#26 reference-optimistic-geth is merged, L2 genesis configuration needs to be updated for OptimismConfig to enable special fee handling and to find L1Block, GasPriceOracle contract addresses.
This PR depends on ethereum-optimism#26 on reference-optimistic-geth: ethereum-optimism/reference-optimistic-geth#26 A new test TestFees is added, which runs a simple transaction and tests that the L2 fee is redirected to the configured fee recipient and that the L1 availability fee is calculated based the RLP encoded transaction size and also redirected to the configured fee recipient. TestFees is skipped, but can be enabled the above PR is merged into reference-optimistic-geth. NOTE: After ethereum-optimism#26 reference-optimistic-geth is merged, L2 genesis configuration needs to be updated for OptimismConfig to enable special fee handling and to find L1Block, GasPriceOracle contract addresses.
This PR depends on ethereum-optimism#26 on reference-optimistic-geth: ethereum-optimism/reference-optimistic-geth#26 A new test TestFees is added, which runs a simple transaction and tests that the L2 fee is redirected to the configured fee recipient and that the L1 availability fee is calculated based the RLP encoded transaction size and also redirected to the configured fee recipient. TestFees is skipped, but can be enabled the above PR is merged into reference-optimistic-geth. NOTE: After ethereum-optimism#26 reference-optimistic-geth is merged, L2 genesis configuration needs to be updated for OptimismConfig to enable special fee handling and to find L1Block, GasPriceOracle contract addresses.
This PR depends on ethereum-optimism#26 on reference-optimistic-geth: ethereum-optimism/reference-optimistic-geth#26 A new test TestFees is added, which runs a simple transaction and tests that the L2 fee is redirected to the configured fee recipient and that the L1 availability fee is calculated based the RLP encoded transaction size and also redirected to the configured fee recipient. TestFees is skipped, but can be enabled the above PR is merged into reference-optimistic-geth. NOTE: After ethereum-optimism#26 reference-optimistic-geth is merged, L2 genesis configuration needs to be updated for OptimismConfig to enable special fee handling and to find L1Block, GasPriceOracle contract addresses.
trianglesphere
left a comment
There was a problem hiding this comment.
just the switch to MarshallBinary
This PR depends on ethereum-optimism#26 on reference-optimistic-geth: ethereum-optimism/reference-optimistic-geth#26 A new test TestFees is added, which runs a simple transaction and tests that the L2 fee is redirected to the configured fee recipient and that the L1 availability fee is calculated based the RLP encoded transaction size and also redirected to the configured fee recipient. TestFees is skipped, but can be enabled the above PR is merged into reference-optimistic-geth. NOTE: After ethereum-optimism#26 reference-optimistic-geth is merged, L2 genesis configuration needs to be updated for OptimismConfig to enable special fee handling and to find L1Block, GasPriceOracle contract addresses.
base fee and l1 availability fee are redirected to configurable accounts; where as tx fee is redirected as coinbase reward
This PR depends on ethereum-optimism#26 on reference-optimistic-geth: ethereum-optimism/reference-optimistic-geth#26 A new test TestFees is added, which runs a simple transaction and tests that the L2 fee is redirected to the configured fee recipient and that the L1 availability fee is calculated based the RLP encoded transaction size and also redirected to the configured fee recipient. TestFees is skipped, but can be enabled the above PR is merged into reference-optimistic-geth. NOTE: After ethereum-optimism#26 reference-optimistic-geth is merged, L2 genesis configuration needs to be updated for OptimismConfig to enable special fee handling and to find L1Block, GasPriceOracle contract addresses.
|
Followed up in #27 , same commit as the squashed one here (accidentally closed this PR). |
This PR depends on ethereum-optimism#26 on reference-optimistic-geth: ethereum-optimism/reference-optimistic-geth#26 A new test TestFees is added, which runs a simple transaction and tests that the L2 fee is redirected to the configured fee recipient and that the L1 availability fee is calculated based the RLP encoded transaction size and also redirected to the configured fee recipient. TestFees is skipped, but can be enabled the above PR is merged into reference-optimistic-geth. NOTE: After ethereum-optimism#26 reference-optimistic-geth is merged, L2 genesis configuration needs to be updated for OptimismConfig to enable special fee handling and to find L1Block, GasPriceOracle contract addresses.
This PR depends on ethereum-optimism#26 on reference-optimistic-geth: ethereum-optimism/reference-optimistic-geth#26 A new test TestFees is added, which runs a simple transaction and tests that the L2 fee is redirected to the configured fee recipient and that the L1 availability fee is calculated based the RLP encoded transaction size and also redirected to the configured fee recipient. TestFees is skipped, but can be enabled the above PR is merged into reference-optimistic-geth. NOTE: After ethereum-optimism#26 reference-optimistic-geth is merged, L2 genesis configuration needs to be updated for OptimismConfig to enable special fee handling and to find L1Block, GasPriceOracle contract addresses.
This PR depends on ethereum-optimism#26 on reference-optimistic-geth: ethereum-optimism/reference-optimistic-geth#26 A new test TestFees is added, which runs a simple transaction and tests that the L2 fee is redirected to the configured fee recipient and that the L1 availability fee is calculated based the RLP encoded transaction size and also redirected to the configured fee recipient. TestFees is skipped, but can be enabled the above PR is merged into reference-optimistic-geth. NOTE: After ethereum-optimism#26 reference-optimistic-geth is merged, L2 genesis configuration needs to be updated for OptimismConfig to enable special fee handling and to find L1Block, GasPriceOracle contract addresses.
This PR depends on ethereum-optimism#26 on reference-optimistic-geth: ethereum-optimism/reference-optimistic-geth#26 A new test TestFees is added, which runs a simple transaction and tests that the L2 fee is redirected to the configured fee recipient and that the L1 availability fee is calculated based the RLP encoded transaction size and also redirected to the configured fee recipient. TestFees is skipped, but can be enabled the above PR is merged into reference-optimistic-geth. NOTE: After ethereum-optimism#26 reference-optimistic-geth is merged, L2 genesis configuration needs to be updated for OptimismConfig to enable special fee handling and to find L1Block, GasPriceOracle contract addresses.
This PR depends on ethereum-optimism#26 on reference-optimistic-geth: ethereum-optimism/reference-optimistic-geth#26 A new test TestFees is added, which runs a simple transaction and tests that the L2 fee is redirected to the configured fee recipient and that the L1 availability fee is calculated based the RLP encoded transaction size and also redirected to the configured fee recipient. TestFees is skipped, but can be enabled the above PR is merged into reference-optimistic-geth. NOTE: After ethereum-optimism#26 reference-optimistic-geth is merged, L2 genesis configuration needs to be updated for OptimismConfig to enable special fee handling and to find L1Block, GasPriceOracle contract addresses.
This PR depends on ethereum-optimism#26 on reference-optimistic-geth: ethereum-optimism/reference-optimistic-geth#26 A new test TestFees is added, which runs a simple transaction and tests that the L2 fee is redirected to the configured fee recipient and that the L1 availability fee is calculated based the RLP encoded transaction size and also redirected to the configured fee recipient. TestFees is skipped, but can be enabled the above PR is merged into reference-optimistic-geth. NOTE: After ethereum-optimism#26 reference-optimistic-geth is merged, L2 genesis configuration needs to be updated for OptimismConfig to enable special fee handling and to find L1Block, GasPriceOracle contract addresses.
This PR depends on #26 on reference-optimistic-geth: ethereum-optimism/reference-optimistic-geth#26 A new test TestFees is added, which runs a simple transaction and tests that the L2 fee is redirected to the configured fee recipient and that the L1 availability fee is calculated based the RLP encoded transaction size and also redirected to the configured fee recipient. TestFees is skipped, but can be enabled the above PR is merged into reference-optimistic-geth. NOTE: After #26 reference-optimistic-geth is merged, L2 genesis configuration needs to be updated for OptimismConfig to enable special fee handling and to find L1Block, GasPriceOracle contract addresses.
Description:
This PR implements handling of transaction fees for paying the cost of posting the RLP encoded transaction as part of
calldataon L1 and the regular transaction fees on L2. The L1 cost is computed using variables from theGasPriceOracleandL1Blockcontracts on L2. Both the fees from L1 and L2 are transferred to a configurable fee recipient account.Note: The PR aims to keep the client compatible for L1 and minimizes the diff required so as to be easily reviewable / auditable.