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

Layer2 Reporting #10

Closed
sambacha opened this issue Feb 15, 2022 · 2 comments · Fixed by #22
Closed

Layer2 Reporting #10

sambacha opened this issue Feb 15, 2022 · 2 comments · Fixed by #22
Assignees
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@sambacha
Copy link
Owner

Add support for L2s

Arbitrum

Arbitrum gas units are different: opcodes are priced differently, so swaps as an example, cost different amounts.
Arbitrum has 2 separate gas meters- one for compute and one for storage
On Arb its not clear if we capture everything we need by querying eth_gasPrice (also unclear if we need to capture both when estimating gas)

Optimism

Optimism charges a fee based on the size of the calldata that would need to be sent to L1
On Optimism for example eth_gasPrice always return 1000000

@sambacha sambacha self-assigned this Feb 15, 2022
@sambacha sambacha added documentation Improvements or additions to documentation question Further information is requested labels Feb 15, 2022
@sambacha sambacha linked a pull request Jun 17, 2022 that will close this issue
@sambacha
Copy link
Owner Author

sambacha commented Sep 7, 2022

Add support for L2s

Arbitrum

Arbitrum gas units are different: opcodes are priced differently, so swaps as an example, cost different amounts. Arbitrum has 2 separate gas meters- one for compute and one for storage On Arb its not clear if we capture everything we need by querying eth_gasPrice (also unclear if we need to capture both when estimating gas)

Optimism

Optimism charges a fee based on the size of the calldata that would need to be sent to L1 On Optimism for example eth_gasPrice always return 1000000

yea this is no longer true with nitro which is now live, opcode gas usage is now the same as L1. eth_estimateGas returns different values (and therefore gas limits are different) though because it adds additional gas to account for L1 costs

  • via matt solomon

@sambacha
Copy link
Owner Author

Optimism, which calculates the transaction size (distinguishing between zero and non-zero bytes, leading to different costs akin to Ethereum) along with associated gas costs. In contrast, Arbitrum dynamically computes the L1 fee based on an estimated transaction size (without distinguishing between zero and non-zero bytes, but charging a uniform 16 gas per byte) and gas cost, incorporating dynamic and flexible additional components. Furthermore, in Arbitrum, a transaction incurs L1 gas fees only if it is part of a sequencer batch and not sent directly to the L2 contract on the L1, whereas this distinction does not seem to apply to Optimism.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant