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

Implement alloy Encodable2718 and Decodable2718 for reth transaction types #11153

Closed
Tracked by #11239
mattsse opened this issue Sep 24, 2024 · 0 comments · Fixed by #11482
Closed
Tracked by #11239

Implement alloy Encodable2718 and Decodable2718 for reth transaction types #11153

mattsse opened this issue Sep 24, 2024 · 0 comments · Fixed by #11482
Assignees
Labels
A-sdk Related to reth's use as a library C-enhancement New feature or request

Comments

@mattsse
Copy link
Collaborator

mattsse commented Sep 24, 2024

Describe the feature

currently we use our own native functions for:

/// Returns the enveloped encoded transactions.
///
/// See also [`TransactionSigned::encode_enveloped`]
pub fn envelope_encoded(&self) -> Bytes {
let mut buf = Vec::new();
self.encode_enveloped(&mut buf);
buf.into()
}
/// Encodes the transaction into the "raw" format (e.g. `eth_sendRawTransaction`).
/// This format is also referred to as "binary" encoding.
///
/// For legacy transactions, it encodes the RLP of the transaction into the buffer:
/// `rlp(tx-data)`
/// For EIP-2718 typed it encodes the type of the transaction followed by the rlp of the
/// transaction: `tx-type || rlp(tx-data)`
pub fn encode_enveloped(&self, out: &mut dyn bytes::BufMut) {
self.encode_inner(out, false)
}

we will move more things to alloy traits and encoding is one thing so we should transition this already to alloy's traits

TODO:

  • replace reth envelope functions with trait impl

easiest way to update this across the codebase is to first rename the reth function, then impl the trait and remove reth function, then import trait where this is called

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request S-needs-triage This issue needs to be labelled labels Sep 24, 2024
@mattsse mattsse added A-sdk Related to reth's use as a library and removed S-needs-triage This issue needs to be labelled labels Sep 24, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Reth Tracker Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sdk Related to reth's use as a library C-enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants