https://github.com/alloy-rs/alloy/pull/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
https://github.com/alloy-rs/core/pull/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
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
Motivation
Bumps alloy, alloy-core and alloy-eip7702.
Code changes:
rlp
,eip2718
ornetwork
. I've updatedTxDeposit
to have methods following this patternhttps://github.com/alloy-rs/core/pull/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 constructSigned<TxLegacy>
where transaction chain_id isSome
, but the parity would not follow EIP-155.This required a few changes to
SpanBatchTransactions
type:encode_y_parity_bits
andencode_tx_sigs_rs
are merged into singleencode_tx_sigs
which firstly encodes parity bits and thenrs
values. Same was done for decoding methodsrecover_v
method is removed. instead, we now pass theis_protected
flag down toSpanBatchLegacyTransactionData
and only setchain_id
toSome
whenis_protected
is trueBlocked by minor releases for alloy, core and revm
Solution
PR Checklist