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: merge with upstream v0.2.1 #7

Closed
wants to merge 62 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
640509a
chore: add payloadbodies v2 to capabilities set (#1025)
mattsse Jul 9, 2024
92b0e4a
chore: fix unnameable types (#1029)
DaniPopes Jul 9, 2024
902d847
chore: trace output utils (#1027)
DaniPopes Jul 9, 2024
617aec5
feat: add rpc namespace (#994)
SozinM Jul 10, 2024
5d8dce4
fix(eip7702): Add correct rlp decode/encode (#1034)
rakita Jul 11, 2024
678617e
feat: add hash for 7702 (#1037)
mattsse Jul 11, 2024
408ae75
feat(genesis): rm EIP150Hash (#1039)
jsvisa Jul 11, 2024
1f02577
feat: add arbitrary to auth (#1036)
mattsse Jul 11, 2024
d9d9262
chore: remove proptest in all crates and Arbitrary derives (#966)
Rjected Jul 11, 2024
dfb8650
feat: add `rpc-types-mev` feature to meta crate (#1040)
leruaa Jul 11, 2024
594a271
feat: generate valid signed auth signatures (#1041)
Rjected Jul 12, 2024
bec6098
fix: cargo fmt (#1044)
jsvisa Jul 12, 2024
bce4083
chore(deps): bump Trezor client to `=0.1.4` to fix signing bug (#1045)
zerosnacks Jul 12, 2024
8abc607
feat(otterscan): add ots slim block and serialze OperationType to int…
jsvisa Jul 12, 2024
e3cc1ff
fix(admin): id in NodeInfo is string instead of B256 (#1038)
jsvisa Jul 13, 2024
6148d6e
feat(core): update core version (#1049)
0xfourzerofour Jul 13, 2024
e35703d
feat: impl `arbitrary` for tx structs (#1050)
leruaa Jul 14, 2024
ea6a447
chore: make auth mandatory in recovered auth (#1047)
mattsse Jul 14, 2024
c461d68
fix(provider): Do not overflow LRU cache capacity in ChainStreamPolle…
popzxc Jul 15, 2024
7d618ee
feat: add authorization list to rpc transaction and tx receipt types …
PanGan21 Jul 15, 2024
ecea267
feat(rpc-types-eth): serde flatten `BlobTransactionSidecar` in tx req…
yash-atreya Jul 15, 2024
faee716
feat: add 7702 tx type (#1046)
mattsse Jul 15, 2024
008b99d
refactor: replace `U64` with `u64` (#1057)
yash-atreya Jul 15, 2024
1d0c81d
fix: require storageKeys value broken bincode serialization from #955…
jtguibas Jul 16, 2024
0950b03
fix(provider): Prevent panic from having 0 keys when calling `on_anvi…
moricho Jul 16, 2024
4d2d903
feat: expose encoded_len_with_signature() (#1063)
leruaa Jul 16, 2024
bcfecd8
fix: Trim conflicting key `max_fee_per_blob_gas` from Eip1559 tx type…
moricho Jul 16, 2024
dfe60ae
chore: release 0.2.0
mattsse Jul 16, 2024
05eca12
docs: update links to use docs.rs (#1066)
DaniPopes Jul 16, 2024
c715e57
chore: bump jsonrpsee 0.24 (#1067)
mattsse Jul 16, 2024
423a4c5
feat(provider) : introduction to eth_sendRawTransactionConditional R…
DoTheBestToGetTheBest Jul 16, 2024
067cc46
bug: `alloy-consensus` should use `alloy_primitives::Sealable` (#1072)
zerosnacks Jul 18, 2024
0ddad90
Added stages to the sync info rpc type (#1079)
loocapro Jul 19, 2024
062e96e
removing async get account (#1080)
loocapro Jul 19, 2024
a414b4a
fix(node-bindings): backport fix from ethers-rs (#1081)
StackOverflowExcept1on Jul 19, 2024
7f7b665
feat(consensus): add `From<ConsolidationRequest>` for `Request` (#1083)
tcoratger Jul 19, 2024
4520b2c
fix(eips): make SignedAuthorizationList arbitrary less fallible (#1084)
Rjected Jul 19, 2024
2be7dde
chore: export rpc account type (#1075)
mattsse Jul 20, 2024
2dea91e
chore : fix typos (#1087)
nkysg Jul 21, 2024
67f024a
feat(json-rpc): implement `From<u64> for Id` and `From<String> for Id…
tcoratger Jul 22, 2024
7d67e9c
feat(eip): make 7702 auth recovery fallible (#1082)
DoTheBestToGetTheBest Jul 23, 2024
135590e
feat(rpc-type-eth) convert vec TxReq to bundle (#1091)
DoTheBestToGetTheBest Jul 23, 2024
338b5b9
feat(rpc/trace): filter matches with trace (#1090)
jsvisa Jul 23, 2024
24364ac
typo: fix typo in genesis (#1096)
tcoratger Jul 23, 2024
315f9a2
feat: enable more features transitively in meta crate (#1097)
DaniPopes Jul 24, 2024
f2d8003
feat: add helper for decoding custom errors (#1098)
klkvr Jul 24, 2024
8ff415d
Feat: eth_simulateV1 Request / Response types (#1042)
DoTheBestToGetTheBest Jul 25, 2024
2ce8525
feat: use EncodableSignature for tx encoding (#1100)
leruaa Jul 25, 2024
a537f8b
chore: allow override all group (#1104)
mattsse Jul 25, 2024
2de4e23
fix: correctly trim eip7251 bytecode (#1105)
onbjerg Jul 25, 2024
4ba5323
refactor: add network-primitives (#1101)
klkvr Jul 26, 2024
aac27bc
chore: re-export and document network-primitives (#1107)
DaniPopes Jul 26, 2024
fa01c2a
fix: make Parity TraceResults output optional (#1102)
m1stoyanov Jul 26, 2024
b3fdd80
rpc: derive arbitrary for `TransactionRequest` (#1113)
tcoratger Jul 31, 2024
4a0a641
docs: readme fix (#1114)
hbdgr Jul 31, 2024
bad667e
feat(engine-types): `PayloadError::PrePragueBlockWithEip7702Transacti…
rkrasiuk Aug 1, 2024
8e5a9fb
Add `AccessListResult` type (EIP-2930) (#1110)
mvares Aug 1, 2024
74efdec
chore: correctly cfg unused type (#1117)
DaniPopes Aug 1, 2024
a011cc5
chore(rpc): Make `Deserialize` impl for `FilterChanges` generic over …
emhane Aug 1, 2024
3bf3618
chore: release 0.2.1
mattsse Aug 2, 2024
7e92557
Merge branch 'refs/heads/v0.2.1' into merge-v0.2.1
pythonberg1997 Aug 13, 2024
f445b9c
chore: resolve merge conflicts
pythonberg1997 Aug 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.0](https://github.com/alloy-rs/alloy/releases/tag/v0.2.0) - 2024-07-16
## [0.2.1](https://github.com/alloy-rs/alloy/releases/tag/v0.2.1) - 2024-08-02

### Bug Fixes

- Make Parity TraceResults output optional ([#1102](https://github.com/alloy-rs/alloy/issues/1102))
- Correctly trim eip7251 bytecode ([#1105](https://github.com/alloy-rs/alloy/issues/1105))
- [eips] Make SignedAuthorizationList arbitrary less fallible ([#1084](https://github.com/alloy-rs/alloy/issues/1084))
- [node-bindings] Backport fix from ethers-rs ([#1081](https://github.com/alloy-rs/alloy/issues/1081))
- Trim conflicting key `max_fee_per_blob_gas` from Eip1559 tx type ([#1064](https://github.com/alloy-rs/alloy/issues/1064))
- [provider] Prevent panic from having 0 keys when calling `on_anvil_with_wallet_and_config` ([#1055](https://github.com/alloy-rs/alloy/issues/1055))
- Require storageKeys value broken bincode serialization from [#955](https://github.com/alloy-rs/alloy/issues/955) ([#1058](https://github.com/alloy-rs/alloy/issues/1058))
Expand All @@ -19,10 +23,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Dependencies

- Bump jsonrpsee 0.24 ([#1067](https://github.com/alloy-rs/alloy/issues/1067))
- [deps] Bump Trezor client to `=0.1.4` to fix signing bug ([#1045](https://github.com/alloy-rs/alloy/issues/1045))

### Documentation

- Readme fix ([#1114](https://github.com/alloy-rs/alloy/issues/1114))
- Update links to use docs.rs ([#1066](https://github.com/alloy-rs/alloy/issues/1066))

### Features

- [engine-types] `PayloadError::PrePragueBlockWithEip7702Transactions` ([#1116](https://github.com/alloy-rs/alloy/issues/1116))
- Use EncodableSignature for tx encoding ([#1100](https://github.com/alloy-rs/alloy/issues/1100))
- Eth_simulateV1 Request / Response types ([#1042](https://github.com/alloy-rs/alloy/issues/1042))
- Add helper for decoding custom errors ([#1098](https://github.com/alloy-rs/alloy/issues/1098))
- Enable more features transitively in meta crate ([#1097](https://github.com/alloy-rs/alloy/issues/1097))
- [rpc/trace] Filter matches with trace ([#1090](https://github.com/alloy-rs/alloy/issues/1090))
- Feat(rpc-type-eth) convert vec TxReq to bundle ([#1091](https://github.com/alloy-rs/alloy/issues/1091))
- [eip] Make 7702 auth recovery fallible ([#1082](https://github.com/alloy-rs/alloy/issues/1082))
- [json-rpc] Implement `From<u64> for Id` and `From<String> for Id` ([#1088](https://github.com/alloy-rs/alloy/issues/1088))
- [consensus] Add `From<ConsolidationRequest>` for `Request` ([#1083](https://github.com/alloy-rs/alloy/issues/1083))
- Feat(provider) : introduction to eth_sendRawTransactionConditional RPC endpoint type ([#1009](https://github.com/alloy-rs/alloy/issues/1009))
- Expose encoded_len_with_signature() ([#1063](https://github.com/alloy-rs/alloy/issues/1063))
- Add 7702 tx type ([#1046](https://github.com/alloy-rs/alloy/issues/1046))
- [rpc-types-eth] Serde flatten `BlobTransactionSidecar` in tx req ([#1054](https://github.com/alloy-rs/alloy/issues/1054))
Expand All @@ -39,15 +60,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Miscellaneous Tasks

- Release 0.2.0
- Release 0.2.1
- [rpc] Make `Deserialize` impl for `FilterChanges` generic over transaction ([#1118](https://github.com/alloy-rs/alloy/issues/1118))
- Correctly cfg unused type ([#1117](https://github.com/alloy-rs/alloy/issues/1117))
- Re-export and document network-primitives ([#1107](https://github.com/alloy-rs/alloy/issues/1107))
- Allow override all group ([#1104](https://github.com/alloy-rs/alloy/issues/1104))
- Chore : fix typos ([#1087](https://github.com/alloy-rs/alloy/issues/1087))
- Export rpc account type ([#1075](https://github.com/alloy-rs/alloy/issues/1075))
- Release 0.2.0
- Make auth mandatory in recovered auth ([#1047](https://github.com/alloy-rs/alloy/issues/1047))
- Trace output utils ([#1027](https://github.com/alloy-rs/alloy/issues/1027))
- Fix unnameable types ([#1029](https://github.com/alloy-rs/alloy/issues/1029))
- Add payloadbodies v2 to capabilities set ([#1025](https://github.com/alloy-rs/alloy/issues/1025))

### Other

- Add `AccessListResult` type (EIP-2930) ([#1110](https://github.com/alloy-rs/alloy/issues/1110))
- Derive arbitrary for `TransactionRequest` ([#1113](https://github.com/alloy-rs/alloy/issues/1113))
- Fix typo in genesis ([#1096](https://github.com/alloy-rs/alloy/issues/1096))
- Removing async get account ([#1080](https://github.com/alloy-rs/alloy/issues/1080))
- Added stages to the sync info rpc type ([#1079](https://github.com/alloy-rs/alloy/issues/1079))
- `alloy-consensus` should use `alloy_primitives::Sealable` ([#1072](https://github.com/alloy-rs/alloy/issues/1072))

### Refactor

- Add network-primitives ([#1101](https://github.com/alloy-rs/alloy/issues/1101))
- Replace `U64` with `u64` ([#1057](https://github.com/alloy-rs/alloy/issues/1057))

### Styling
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["crates/*"]
resolver = "2"

[workspace.package]
version = "0.2.0"
version = "0.2.1"
edition = "2021"
rust-version = "1.76"
authors = ["Alloy Contributors"]
Expand Down Expand Up @@ -42,6 +42,7 @@ alloy-eip7547 = { version = "0.2", path = "crates/eip7547", default-features = f
alloy-genesis = { version = "0.2", path = "crates/genesis", default-features = false }
alloy-json-rpc = { version = "0.2", path = "crates/json-rpc", default-features = false }
alloy-network = { version = "0.2", path = "crates/network", default-features = false }
alloy-network-primitives = { version = "0.2", path = "crates/network-primitives", default-features = false }
alloy-node-bindings = { version = "0.2", path = "crates/node-bindings", default-features = false }
alloy-provider = { version = "0.2", path = "crates/provider", default-features = false }
alloy-pubsub = { version = "0.2", path = "crates/pubsub", default-features = false }
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Alloy connects applications to blockchains.

Alloy is a rewrite of [`ethers-rs`] from the ground up, with exciting new
features, high performance, and excellent [docs](https://alloy-rs.github.io/alloy/).
features, high performance, and excellent [docs](https://docs.rs/alloy).

We also have a [book](https://alloy.rs/) on all things Alloy and many [examples](https://github.com/alloy-rs/examples) to help you get started.

Expand All @@ -26,7 +26,7 @@ cargo add alloy --features full
Alternatively, you can add the following to your `Cargo.toml` file:

```toml
alloy = { version = "0.1", features = ["full"] }
alloy = { version = "0.2", features = ["full"] }
```

For a more fine-grained control over the features you wish to include, you can add the individual crates to your `Cargo.toml` file, or use the `alloy` crate with the features you need.
Expand All @@ -44,6 +44,7 @@ This repository contains the following crates:
- [`alloy-genesis`] - Ethereum genesis file definitions
- [`alloy-json-rpc`] - Core data types for JSON-RPC 2.0 clients
- [`alloy-network`] - Network abstraction for RPC types
- [`alloy-network-primitives`] - Primitive types for the network abstraction
- [`alloy-node-bindings`] - Ethereum execution-layer client bindings
- [`alloy-provider`] - Interface with an Ethereum blockchain
- [`alloy-pubsub`] - Ethereum JSON-RPC [publish-subscribe] tower service and type definitions
Expand Down Expand Up @@ -77,6 +78,7 @@ This repository contains the following crates:
[`alloy-genesis`]: https://github.com/alloy-rs/alloy/tree/main/crates/genesis
[`alloy-json-rpc`]: https://github.com/alloy-rs/alloy/tree/main/crates/json-rpc
[`alloy-network`]: https://github.com/alloy-rs/alloy/tree/main/crates/network
[`alloy-network-primitives`]: https://github.com/alloy-rs/alloy/tree/main/crates/network-primitives
[`alloy-node-bindings`]: https://github.com/alloy-rs/alloy/tree/main/crates/node-bindings
[`alloy-provider`]: https://github.com/alloy-rs/alloy/tree/main/crates/provider
[`alloy-pubsub`]: https://github.com/alloy-rs/alloy/tree/main/crates/pubsub
Expand Down
5 changes: 3 additions & 2 deletions crates/alloy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.0](https://github.com/alloy-rs/alloy/releases/tag/v0.2.0) - 2024-07-16
## [0.2.1](https://github.com/alloy-rs/alloy/releases/tag/v0.2.1) - 2024-08-02

### Features

- Enable more features transitively in meta crate ([#1097](https://github.com/alloy-rs/alloy/issues/1097))
- Add `rpc-types-mev` feature to meta crate ([#1040](https://github.com/alloy-rs/alloy/issues/1040))

### Miscellaneous Tasks

- Release 0.2.0
- Release 0.2.1
- Release 0.2.0

## [0.1.4](https://github.com/alloy-rs/alloy/releases/tag/v0.1.4) - 2024-07-08
Expand Down
8 changes: 4 additions & 4 deletions crates/alloy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ network = ["dep:alloy-network"]
node-bindings = ["dep:alloy-node-bindings", "alloy-provider?/anvil-node"]

# providers
providers = ["dep:alloy-provider", "rpc-client", "eips"]
providers = ["dep:alloy-provider", "rpc-client", "transports", "eips"]
provider-http = ["providers", "transport-http"]
provider-ws = ["providers", "alloy-provider?/ws", "transport-ws"]
provider-ipc = ["providers", "alloy-provider?/ipc", "transport-ipc"]
Expand Down Expand Up @@ -184,9 +184,9 @@ pubsub = [
# rpc
rpc = []
json-rpc = ["rpc", "dep:alloy-json-rpc"]
rpc-client = ["rpc", "dep:alloy-rpc-client"]
rpc-client-ws = ["rpc-client", "alloy-rpc-client?/ws"]
rpc-client-ipc = ["rpc-client", "alloy-rpc-client?/ipc"]
rpc-client = ["rpc", "transports", "transport-http", "dep:alloy-rpc-client"]
rpc-client-ws = ["rpc-client", "transport-ws", "alloy-rpc-client?/ws"]
rpc-client-ipc = ["rpc-client", "transport-ipc", "alloy-rpc-client?/ipc"]
rpc-types = ["rpc", "dep:alloy-rpc-types", "alloy-rpc-types?/eth"]
rpc-types-admin = [
"rpc-types",
Expand Down
10 changes: 8 additions & 2 deletions crates/consensus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.0](https://github.com/alloy-rs/alloy/releases/tag/v0.2.0) - 2024-07-16
## [0.2.1](https://github.com/alloy-rs/alloy/releases/tag/v0.2.1) - 2024-08-02

### Features

- Use EncodableSignature for tx encoding ([#1100](https://github.com/alloy-rs/alloy/issues/1100))
- [consensus] Add `From<ConsolidationRequest>` for `Request` ([#1083](https://github.com/alloy-rs/alloy/issues/1083))
- Expose encoded_len_with_signature() ([#1063](https://github.com/alloy-rs/alloy/issues/1063))
- Add 7702 tx type ([#1046](https://github.com/alloy-rs/alloy/issues/1046))
- Impl `arbitrary` for tx structs ([#1050](https://github.com/alloy-rs/alloy/issues/1050))

### Miscellaneous Tasks

- Chore : fix typos ([#1087](https://github.com/alloy-rs/alloy/issues/1087))
- Release 0.2.0
- Release 0.2.0

### Other

- `alloy-consensus` should use `alloy_primitives::Sealable` ([#1072](https://github.com/alloy-rs/alloy/issues/1072))

### Styling

Expand Down
2 changes: 1 addition & 1 deletion crates/consensus/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct Account {
}

impl Account {
/// Compute hash as committed to in the MPT trie without memoizing.
/// Compute hash as committed to in the MPT trie without memorizing.
pub fn trie_hash_slow(&self) -> B256 {
keccak256(alloy_rlp::encode(self))
}
Expand Down
108 changes: 108 additions & 0 deletions crates/consensus/src/encodable_signature.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
use alloy_primitives::{Parity, SignatureError, U256};

/// Helper trait used to streamline signatures encoding.
pub trait EncodableSignature: Sized {
/// Instantiate from v, r, s.
fn from_rs_and_parity<P: TryInto<Parity, Error = E>, E: Into<SignatureError>>(
r: U256,
s: U256,
parity: P,
) -> Result<Self, SignatureError>;

/// Returns the `r` component of this signature.
fn r(&self) -> U256;

/// Returns the `s` component of this signature.
fn s(&self) -> U256;

/// Returns the recovery ID as a `u8`.
fn v(&self) -> Parity;

/// Sets the recovery ID by normalizing a `v` value.
fn with_parity<T: Into<Parity>>(self, parity: T) -> Self;

/// Modifies the recovery ID by applying [EIP-155] to a `v` value.
///
/// [EIP-155]: https://eips.ethereum.org/EIPS/eip-155
#[inline]
fn with_chain_id(self, chain_id: u64) -> Self
where
Self: Copy,
{
self.with_parity(self.v().with_chain_id(chain_id))
}

/// Modifies the recovery ID by dropping any [EIP-155] v value, converting
/// to a simple parity bool.
fn with_parity_bool(self) -> Self
where
Self: Copy,
{
self.with_parity(self.v().to_parity_bool())
}

/// Decode an RLP-encoded VRS signature.
fn decode_rlp_vrs(buf: &mut &[u8]) -> Result<Self, alloy_rlp::Error> {
use alloy_rlp::Decodable;

let parity: Parity = Decodable::decode(buf)?;
let r = Decodable::decode(buf)?;
let s = Decodable::decode(buf)?;

Self::from_rs_and_parity(r, s, parity)
.map_err(|_| alloy_rlp::Error::Custom("attempted to decode invalid field element"))
}

/// Length of RLP RS field encoding
fn rlp_rs_len(&self) -> usize {
alloy_rlp::Encodable::length(&self.r()) + alloy_rlp::Encodable::length(&self.s())
}

/// Length of RLP V field encoding
fn rlp_vrs_len(&self) -> usize {
self.rlp_rs_len() + alloy_rlp::Encodable::length(&self.v())
}

/// Write R and S to an RLP buffer in progress.
fn write_rlp_rs(&self, out: &mut dyn alloy_rlp::BufMut) {
alloy_rlp::Encodable::encode(&self.r(), out);
alloy_rlp::Encodable::encode(&self.s(), out);
}

/// Write the V to an RLP buffer without using EIP-155.
fn write_rlp_v(&self, out: &mut dyn alloy_rlp::BufMut) {
alloy_rlp::Encodable::encode(&self.v(), out);
}

/// Write the VRS to the output. The V will always be 27 or 28.
fn write_rlp_vrs(&self, out: &mut dyn alloy_rlp::BufMut) {
self.write_rlp_v(out);
self.write_rlp_rs(out);
}
}

impl EncodableSignature for alloy_primitives::Signature {
fn from_rs_and_parity<P: TryInto<Parity, Error = E>, E: Into<SignatureError>>(
r: U256,
s: U256,
parity: P,
) -> Result<Self, SignatureError> {
Self::from_rs_and_parity(r, s, parity)
}

fn r(&self) -> U256 {
self.r()
}

fn s(&self) -> U256 {
self.s()
}

fn v(&self) -> Parity {
self.v()
}

fn with_parity<T: Into<Parity>>(self, parity: T) -> Self {
self.with_parity(parity)
}
}
7 changes: 4 additions & 3 deletions crates/consensus/src/header.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use crate::Sealable;
use alloy_eips::{
eip1559::{calc_next_block_base_fee, BaseFeeParams},
eip4844::{calc_blob_gasprice, calc_excess_blob_gas},
};
use alloy_primitives::{b256, keccak256, Address, BlockNumber, Bloom, Bytes, B256, B64, U256};
use alloy_primitives::{
b256, keccak256, Address, BlockNumber, Bloom, Bytes, Sealable, B256, B64, U256,
};
use alloy_rlp::{
length_of_length, Buf, BufMut, Decodable, Encodable, EMPTY_LIST_CODE, EMPTY_STRING_CODE,
};
Expand Down Expand Up @@ -161,7 +162,7 @@ impl Default for Header {
}

impl Sealable for Header {
fn hash(&self) -> B256 {
fn hash_slow(&self) -> B256 {
self.hash_slow()
}
}
Expand Down
6 changes: 4 additions & 2 deletions crates/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ pub use account::Account;

pub mod constants;

mod encodable_signature;
pub use encodable_signature::EncodableSignature;

mod header;
pub use header::{Header, EMPTY_OMMER_ROOT_HASH, EMPTY_ROOT_HASH};

Expand Down Expand Up @@ -42,8 +45,7 @@ pub use alloy_eips::eip4844::{
#[cfg(feature = "kzg")]
pub use alloy_eips::eip4844::env_settings::EnvKzgSettings;

mod sealed;
pub use sealed::{Sealable, Sealed};
pub use alloy_primitives::{Sealable, Sealed};

mod signed;
pub use signed::Signed;
2 changes: 1 addition & 1 deletion crates/consensus/src/receipt/receipts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl<T> From<ReceiptWithBloom<T>> for Receipt<T> {
/// This convenience type allows us to lazily calculate the bloom filter for a
/// receipt, similar to [`Sealed`].
///
/// [`Sealed`]: crate::sealed::Sealed
/// [`Sealed`]: crate::Sealed
#[derive(Clone, Debug, Default, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
Expand Down
6 changes: 6 additions & 0 deletions crates/consensus/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ impl From<WithdrawalRequest> for Request {
}
}

impl From<ConsolidationRequest> for Request {
fn from(v: ConsolidationRequest) -> Self {
Self::ConsolidationRequest(v)
}
}

impl Request {
/// Whether this is a [`DepositRequest`].
pub const fn is_deposit_request(&self) -> bool {
Expand Down
Loading