Skip to content

Commit

Permalink
feat: initial relay ssz support (#5568)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Nov 25, 2023
1 parent 7de2582 commit 1308b67
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
50 changes: 50 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions crates/rpc/rpc-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ repository.workspace = true
description = "Reth RPC types"

[dependencies]
# # ethereum
# ethereum
alloy-rlp = { workspace = true, features = ["arrayvec", "derive"] }
alloy-primitives = { workspace = true, features = ["rand", "rlp", "serde"] }
ethereum_ssz_derive = { version = "0.5", optional = true }
ethereum_ssz = { version = "0.5", optional = true }

# misc
thiserror.workspace = true
Expand All @@ -19,22 +22,24 @@ serde = { workspace = true, features = ["derive"] }
serde_with = "3.3"
serde_json.workspace = true
jsonrpsee-types = { workspace = true, optional = true }
alloy-primitives = { workspace = true, features = ["rand", "rlp", "serde"] }
url = "2.3"
# necessary so we don't hit a "undeclared 'std'":
# https://github.com/paradigmxyz/reth/pull/177#discussion_r1021172198
secp256k1.workspace = true
bytes.workspace = true

# arbitrary
arbitrary = { workspace = true, features = ["derive"], optional = true }
proptest = { workspace = true, optional = true }
proptest-derive = { workspace = true, optional = true }

[features]
default = ["jsonrpsee-types"]
arbitrary = ["dep:arbitrary", "dep:proptest-derive", "dep:proptest", "alloy-primitives/arbitrary"]
ssz = ["dep:ethereum_ssz" ,"dep:ethereum_ssz_derive", "alloy-primitives/ssz"]
optimism = []


[dev-dependencies]
# misc
alloy-primitives = { workspace = true, features = ["rand", "rlp", "serde", "arbitrary"] }
Expand Down
2 changes: 2 additions & 0 deletions crates/rpc/rpc-types/src/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub struct ValidatorRegistrationMessage {
/// (not necessarily a value confirmed by the relay).
#[serde_as]
#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "ssz", derive(ssz_derive::Encode, ssz_derive::Decode))]
pub struct BidTrace {
#[serde_as(as = "DisplayFromStr")]
pub slot: u64,
Expand All @@ -64,6 +65,7 @@ pub struct BidTrace {

/// SignedBidTrace is a BidTrace with a signature
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "ssz", derive(ssz_derive::Encode, ssz_derive::Decode))]
pub struct SignedBidTrace {
pub message: BidTrace,
pub signature: BlsSignature,
Expand Down

0 comments on commit 1308b67

Please sign in to comment.