Skip to content

feat(consensus): impl SignableTx for TxDeposit#152

Merged
emhane merged 5 commits intomainfrom
yash/signable-tx-deposit
Oct 7, 2024
Merged

feat(consensus): impl SignableTx for TxDeposit#152
emhane merged 5 commits intomainfrom
yash/signable-tx-deposit

Conversation

@yash-atreya
Copy link
Copy Markdown
Contributor

Motivation

Ref: foundry-rs/foundry#9047

Solution

impl SignableTransaction<alloy_primitives::Signature> for TxDeposit

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

yash-atreya and others added 2 commits October 7, 2024 18:50
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
@emhane emhane added this pull request to the merge queue Oct 7, 2024
Merged via the queue into main with commit 13d0c23 Oct 7, 2024
@emhane emhane deleted the yash/signable-tx-deposit branch October 7, 2024 13:35
Copy link
Copy Markdown
Member

@klkvr klkvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deposit transactions are not "signable" and do not carry a signature, why do we need this?

Comment on lines +259 to +262
let mut out = Vec::with_capacity(payload_length);
self.encode_inner(&mut out, false);
signature.write_rlp_vrs(&mut out);
let hash = keccak256(out);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will produce invalid hash. deposit transaction rlp encoding does not include a signature

@klkvr
Copy link
Copy Markdown
Member

klkvr commented Oct 7, 2024

I see, we migrated this from anvil

I don't think we need this for it because signature is always getting dropped when converting to envelope https://github.com/foundry-rs/foundry/blob/47f1ecb9c6f7e251c5bf2452c1f327d5508481a9/crates/anvil/src/eth/sign.rs#L143

imo even if it's needed in anvil we shouldn't introduce trait implementations which produce off-spec encodings

@yash-atreya
Copy link
Copy Markdown
Contributor Author

Yeah @klkvr, my mistake.

Revert PR: #153

theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 21, 2026
…oy#152)

<!--
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: foundry-rs/foundry#9047 

<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->

## Solution

impl `SignableTransaction<alloy_primitives::Signature>` for `TxDeposit`


<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->

## PR Checklist

- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes

---------

Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
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.

3 participants