-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from ralexstokes/test-bid-sig
fix bug with hash tree root in underlying dep
- Loading branch information
Showing
7 changed files
with
133 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "mev-utils" | ||
version.workspace = true | ||
edition = "2021" | ||
license = "MIT OR Apache-2.0" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
tokio = { version = "1.0", features = ["full"] } | ||
url = { version = "2.2.2", default-features = false } | ||
|
||
mev-rs = { path = "../../mev-rs" } | ||
|
||
serde = { version = "1.0", features = ["derive"] } | ||
serde_json = { version = "1.0.92" } | ||
|
||
ethereum-consensus = { workspace = true } | ||
beacon-api-client = { workspace = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../mev/LICENSE-APACHE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../mev/LICENSE-MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use beacon_api_client::{mainnet::Client, BlockId}; | ||
use mev_rs::{types::BidRequest, BlindedBlockRelayer, Relay, RelayEndpoint}; | ||
use url::Url; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
let endpoint = Url::parse("http://localhost:5052").unwrap(); | ||
let beacon_node = Client::new(endpoint); | ||
let id = BlockId::Head; | ||
let signed_block = beacon_node.get_beacon_block(id).await.unwrap(); | ||
let slot = signed_block.message().slot() + 1; | ||
let parent_hash = | ||
signed_block.message().body().execution_payload().unwrap().block_hash().clone(); | ||
|
||
let url = Url::parse("https://0x845bd072b7cd566f02faeb0a4033ce9399e42839ced64e8b2adcfc859ed1e8e1a5a293336a49feac6d9a5edb779be53a@boost-relay-sepolia.flashbots.net/").unwrap(); | ||
let relay_endpoint = RelayEndpoint::try_from(url).unwrap(); | ||
let relay = Relay::try_from(relay_endpoint).unwrap(); | ||
let schedules = relay.get_proposal_schedule().await.unwrap(); | ||
for schedule in schedules { | ||
if schedule.slot == slot { | ||
let public_key = schedule.entry.message.public_key; | ||
let bid_request = BidRequest { slot, parent_hash: parent_hash.clone(), public_key }; | ||
let signed_bid = relay.fetch_best_bid(&bid_request).await.unwrap(); | ||
let signed_bid_str = serde_json::to_string_pretty(&signed_bid).unwrap(); | ||
println!("{signed_bid_str}"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters