From addcd2a9880b9d50e09e63ccc6f51b800e021957 Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Wed, 18 Oct 2023 17:17:30 -0600 Subject: [PATCH] update latest `ethereum-consensus` --- Cargo.lock | 8 ++++---- Cargo.toml | 4 ++-- mev-rs/src/blinded_block_provider/api/client.rs | 2 +- mev-rs/src/relay.rs | 3 ++- mev-rs/src/serde.rs | 2 +- mev-rs/src/types/bid_request.rs | 2 +- mev-rs/src/types/block_submission.rs | 6 +++--- mev-rs/src/types/proposer_schedule.rs | 4 ++-- 8 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e22a4c3a..c8c380e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -610,7 +610,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "beacon-api-client" version = "0.1.0" -source = "git+https://github.com/ralexstokes/ethereum-consensus?rev=766aca6c5d10ee8dac015fbe705667f60097149d#766aca6c5d10ee8dac015fbe705667f60097149d" +source = "git+https://github.com/ralexstokes/ethereum-consensus?rev=c84f44ee7ec04613adf5f2be845df35e05de1efc#c84f44ee7ec04613adf5f2be845df35e05de1efc" dependencies = [ "clap", "ethereum-consensus", @@ -2271,7 +2271,7 @@ dependencies = [ [[package]] name = "ethereum-consensus" version = "0.1.1" -source = "git+https://github.com/ralexstokes/ethereum-consensus?rev=766aca6c5d10ee8dac015fbe705667f60097149d#766aca6c5d10ee8dac015fbe705667f60097149d" +source = "git+https://github.com/ralexstokes/ethereum-consensus?rev=c84f44ee7ec04613adf5f2be845df35e05de1efc#c84f44ee7ec04613adf5f2be845df35e05de1efc" dependencies = [ "async-stream", "blst", @@ -7359,7 +7359,7 @@ checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" [[package]] name = "ssz_rs" version = "0.9.0" -source = "git+https://github.com/ralexstokes/ssz-rs?rev=20829edcaa48e5f5f39939a69928debc477be4e2#20829edcaa48e5f5f39939a69928debc477be4e2" +source = "git+https://github.com/ralexstokes/ssz-rs?rev=6755022b7727e3392bfbc2b9c683cb7bf9caa4ce#6755022b7727e3392bfbc2b9c683cb7bf9caa4ce" dependencies = [ "bitvec", "hex", @@ -7372,7 +7372,7 @@ dependencies = [ [[package]] name = "ssz_rs_derive" version = "0.9.0" -source = "git+https://github.com/ralexstokes/ssz-rs?rev=20829edcaa48e5f5f39939a69928debc477be4e2#20829edcaa48e5f5f39939a69928debc477be4e2" +source = "git+https://github.com/ralexstokes/ssz-rs?rev=6755022b7727e3392bfbc2b9c683cb7bf9caa4ce#6755022b7727e3392bfbc2b9c683cb7bf9caa4ce" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index eebd6bcf..053b5b6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,8 +7,8 @@ default-members = ["bin/mev"] version = "0.3.0" [workspace.dependencies] -ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "766aca6c5d10ee8dac015fbe705667f60097149d" } -beacon-api-client = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "766aca6c5d10ee8dac015fbe705667f60097149d" } +ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "c84f44ee7ec04613adf5f2be845df35e05de1efc" } +beacon-api-client = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "c84f44ee7ec04613adf5f2be845df35e05de1efc" } reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "1b16d804ef01f4ec3c25e7986381c22739c105b9" } reth-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "1b16d804ef01f4ec3c25e7986381c22739c105b9" } diff --git a/mev-rs/src/blinded_block_provider/api/client.rs b/mev-rs/src/blinded_block_provider/api/client.rs index 8ae9179c..f33a345e 100644 --- a/mev-rs/src/blinded_block_provider/api/client.rs +++ b/mev-rs/src/blinded_block_provider/api/client.rs @@ -43,7 +43,7 @@ impl Client { bid_request: &BidRequest, ) -> Result { let target = format!( - "/eth/v1/builder/header/{}/{}/{}", + "/eth/v1/builder/header/{}/{:?}/{:?}", bid_request.slot, bid_request.parent_hash, bid_request.public_key ); let response = self.api.http_get(&target).await?; diff --git a/mev-rs/src/relay.rs b/mev-rs/src/relay.rs index 8cf90d4f..495cf697 100644 --- a/mev-rs/src/relay.rs +++ b/mev-rs/src/relay.rs @@ -103,7 +103,8 @@ mod tests { let public_key = sk.public_key(); let mut url = Url::parse(URL).unwrap(); - url.set_username(&public_key.to_string()).unwrap(); + let public_key_str = format!("{public_key:?}"); + url.set_username(&public_key_str).unwrap(); let endpoint = RelayEndpoint::try_from(url.clone()).unwrap(); assert_eq!(endpoint.url, url); diff --git a/mev-rs/src/serde.rs b/mev-rs/src/serde.rs index 20830e92..4c4ca5e7 100644 --- a/mev-rs/src/serde.rs +++ b/mev-rs/src/serde.rs @@ -1 +1 @@ -pub(crate) use ethereum_consensus::serde::as_string; +pub(crate) use ethereum_consensus::serde::as_str; diff --git a/mev-rs/src/types/bid_request.rs b/mev-rs/src/types/bid_request.rs index 8fd706fe..3ffff95c 100644 --- a/mev-rs/src/types/bid_request.rs +++ b/mev-rs/src/types/bid_request.rs @@ -3,7 +3,7 @@ use ethereum_consensus::primitives::{BlsPublicKey, Hash32, Slot}; #[derive(Debug, Default, Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct BidRequest { - #[serde(with = "crate::serde::as_string")] + #[serde(with = "crate::serde::as_str")] pub slot: Slot, pub parent_hash: Hash32, pub public_key: BlsPublicKey, diff --git a/mev-rs/src/types/block_submission.rs b/mev-rs/src/types/block_submission.rs index 2977b5df..7645f8da 100644 --- a/mev-rs/src/types/block_submission.rs +++ b/mev-rs/src/types/block_submission.rs @@ -7,7 +7,7 @@ use ethereum_consensus::{ #[derive(Debug, Default, Clone, SimpleSerialize)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct BidTrace { - #[serde(with = "crate::serde::as_string")] + #[serde(with = "crate::serde::as_str")] pub slot: Slot, pub parent_hash: Hash32, pub block_hash: Hash32, @@ -16,9 +16,9 @@ pub struct BidTrace { #[serde(rename = "proposer_pubkey")] pub proposer_public_key: BlsPublicKey, pub proposer_fee_recipient: ExecutionAddress, - #[serde(with = "crate::serde::as_string")] + #[serde(with = "crate::serde::as_str")] pub gas_limit: u64, - #[serde(with = "crate::serde::as_string")] + #[serde(with = "crate::serde::as_str")] pub gas_used: u64, pub value: U256, } diff --git a/mev-rs/src/types/proposer_schedule.rs b/mev-rs/src/types/proposer_schedule.rs index 82e5b5e5..c0e34cf5 100644 --- a/mev-rs/src/types/proposer_schedule.rs +++ b/mev-rs/src/types/proposer_schedule.rs @@ -4,9 +4,9 @@ use ethereum_consensus::primitives::{Slot, ValidatorIndex}; #[derive(Debug, Default, Clone)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct ProposerSchedule { - #[serde(with = "crate::serde::as_string")] + #[serde(with = "crate::serde::as_str")] pub slot: Slot, - #[serde(with = "crate::serde::as_string")] + #[serde(with = "crate::serde::as_str")] pub validator_index: ValidatorIndex, pub entry: SignedValidatorRegistration, }