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

[wip] feat: bump alloy #205

Merged
merged 22 commits into from
Nov 6, 2024
Merged

[wip] feat: bump alloy #205

merged 22 commits into from
Nov 6, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Oct 30, 2024

Motivation

Bumps alloy, alloy-core and alloy-eip7702.

Code changes:

  • fix: make a sensible encoding api alloy#1496 changed transaction encoding API, encoding functions are now prefixed with rlp,eip2718 or network. I've updated TxDeposit to have methods following this pattern

  • refactor: use simple boolean for parity in signature core#776 updated signature type to avoid using Parity generic and instead just keep a boolean for parity byte. The motivation is to have more correctness in encoding and data structure. Before that it was possible to construct Signed<TxLegacy> where transaction chain_id is Some, but the parity would not follow EIP-155.

    This required a few changes to SpanBatchTransactions type:

    • encode_y_parity_bits and encode_tx_sigs_rs are merged into single encode_tx_sigs which firstly encodes parity bits and then rs values. Same was done for decoding methods
    • recover_v method is removed. instead, we now pass the is_protected flag down to SpanBatchLegacyTransactionData and only set chain_id to Some when is_protected is true

Blocked by minor releases for alloy, core and revm

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@klkvr
Copy link
Member Author

klkvr commented Oct 30, 2024

I've removed test_span_batch_transactions_add_invalid_legacy_parity_decoding test cc @refcell. Unsure what exactly it was asserting but with this PR legacy tx parity is always correctly encoded

Cargo.toml Outdated
Comment on lines 119 to 134
[patch.crates-io]
alloy-sol-types = { git = "https://github.com/alloy-rs/core", rev = "17ae00a" }
alloy-primitives = { git = "https://github.com/alloy-rs/core", rev = "17ae00a" }

revm-primitives = { git = "https://github.com/klkvr/revm", rev = "82b99a0" }

alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "d99f09c" }
alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "d99f09c" }
alloy-network-primitives = { git = "https://github.com/alloy-rs/alloy", rev = "d99f09c" }
alloy-rpc-types-eth = { git = "https://github.com/alloy-rs/alloy", rev = "d99f09c" }
alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "d99f09c" }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "d99f09c" }
alloy-serde = { git = "https://github.com/alloy-rs/alloy", rev = "d99f09c" }
alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "d99f09c" }
alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "d99f09c" }
alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "d99f09c" }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Calling this out in a comment so we don't forget to remove these patches.

Copy link
Collaborator

@refcell refcell left a comment

Choose a reason for hiding this comment

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

This is very nice work @klkvr

@mattsse mattsse marked this pull request as ready for review November 6, 2024 12:16
@mattsse mattsse requested a review from clabby as a code owner November 6, 2024 12:16
@klkvr klkvr added this pull request to the merge queue Nov 6, 2024
Merged via the queue into main with commit 666124c Nov 6, 2024
19 checks passed
@klkvr klkvr deleted the klkvr/bump-alloy branch November 6, 2024 12:27
mattsse added a commit that referenced this pull request Nov 6, 2024
~~blocked by #205~~

ported from reth
@refcell refcell mentioned this pull request Nov 12, 2024
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