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

chore: only fetch deposit info for deposit tx #12474

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Nov 12, 2024

we only have to fetch this for deposit tx

there is one more issue for #11708 because currently we can't easily set the nonce field for deposit txs

should we introduce this as additional field on op-alloy's tx type @klkvr ?

@mattsse mattsse added the A-op-reth Related to Optimism and op-reth label Nov 12, 2024
@klkvr
Copy link
Collaborator

klkvr commented Nov 12, 2024

should we introduce this as additional field on op-alloy's tx type @klkvr ?

yeah, this would have to be a separate field with another serde hack. would we just fetch the nonce from historical state to account for that?

@mattsse
Copy link
Collaborator Author

mattsse commented Nov 12, 2024

for rpc the nonce is fetched from the receipt...

.and_then(|receipt| receipt.deposit_receipt_version.zip(receipt.deposit_nonce));

just like the deposit_version

@klkvr
Copy link
Collaborator

klkvr commented Nov 12, 2024

ah right there's deposit_nonce in there too

@mattsse mattsse added this pull request to the merge queue Nov 12, 2024
Merged via the queue into main with commit e6a6fc4 Nov 12, 2024
41 checks passed
@mattsse mattsse deleted the matt/only-fetch-receipt-for-deposit branch November 12, 2024 15:56
github-merge-queue bot pushed a commit to alloy-rs/op-alloy that referenced this pull request Nov 12, 2024
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.

Bug fixes and new features should include tests.

Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md

The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->

<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->

## Motivation

ref paradigmxyz/reth#12474

We need a separate `deposit_nonce` to account for deposit transaction
responses which have it while it's not present in inner envelope.

## Solution

Adds `nonce` field to `OptionalFields` helper. It would get deserialized
only if envelope did not consume it and serialized only if present and
inner envelope is a deposit

## PR Checklist

- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-op-reth Related to Optimism and op-reth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants