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 / OP Stack Transaction Receipt Fields #446

Merged
merged 21 commits into from
Aug 2, 2023

Conversation

MSilb7
Copy link
Contributor

@MSilb7 MSilb7 commented May 25, 2023

This adds in fields in the Optimism transaction receipt, used for calculating transaction gas fees and expected L1 data usage. These changes will apply for OP Mainnet as well as other OP Stack chains (i.e. Base).

l1_fee: The total amount of ETH paid in a user's transaction for the L1 data fee
l1_gas_used: The amount of gas that the calldata (input data) and overhead of a transaction used.
l1_gas_price: The price for L1 gas charged for a transaction.
l1_fee_scalar: The fee scalar applied to l1_gas_used.

For more information see: Optimism Docs - Transaction Fees on L2

Definitely let me know if there's a better spot to make these adds!

@MSilb7
Copy link
Contributor Author

MSilb7 commented May 26, 2023

Hi, wondering if there's any insight in to why the test is failing?

@medvedev1088
Copy link
Member

There was an issue with urllib3 version. After fixing it #447 there are still failed tests e.g. new columns need to be added in the tests https://github.com/blockchain-etl/ethereum-etl/blob/develop/tests/resources/test_export_receipts_job/receipts_with_logs/expected_receipts.csv

@MSilb7
Copy link
Contributor Author

MSilb7 commented Jun 1, 2023

There was an issue with urllib3 version. After fixing it #447 there are still failed tests e.g. new columns need to be added in the tests https://github.com/blockchain-etl/ethereum-etl/blob/develop/tests/resources/test_export_receipts_job/receipts_with_logs/expected_receipts.csv

Got it, made the updates!

To clarify, these are OP Stack Chain - specific fields, so hopefully it's not too annoying for people pulling other chains.

@MSilb7
Copy link
Contributor Author

MSilb7 commented Jun 1, 2023

Added the fields to the streaming functions.

A note that once this gets merged, we also need to update the schema here: https://github.com/blockchain-etl/ethereum-etl-postgres

@MSilb7
Copy link
Contributor Author

MSilb7 commented Jun 1, 2023

One remaining thing I'm trying to track down.

In streaming, receipt_l1_fee, receipt_l1_gas_used, etc are coming through as null. They return values on non-streaming receipt exports.

Edit: never mind this was an issue due to my local package being inconsistent. All good!

@MSilb7
Copy link
Contributor Author

MSilb7 commented Jun 22, 2023

Hi @medvedev1088 - bumping this! May be useful now that Zora's chain is live as well.

@medvedev1088
Copy link
Member

@MSilb7 sorry for the delay. I'll try to test and merge it on the weekend

fee scalar to decimal
@medvedev1088
Copy link
Member

Included in version 2.3.0 https://pypi.org/project/ethereum-etl/2.3.0/

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.

2 participants