Skip to content

Feat/remove engine builder providers #255

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
411 changes: 179 additions & 232 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
[workspace]
members = [
"crates/bundle_provider",
"crates/cli/",
"crates/core/",
"crates/engine_provider",
"crates/sqlite_db/",
"crates/testfile/",
]
Expand All @@ -22,8 +20,6 @@ repository = "https://github.com/flashbots/contender"
contender_core = { path = "crates/core/" }
contender_sqlite = { path = "crates/sqlite_db/" }
contender_testfile = { path = "crates/testfile/" }
contender_bundle_provider = { path = "crates/bundle_provider/" }
contender_engine_provider = { path = "crates/engine_provider/" }

eyre = "0.6.12"
tokio = { version = "1.40.0" }
Expand Down
22 changes: 0 additions & 22 deletions crates/bundle_provider/CHANGELOG.md

This file was deleted.

13 changes: 0 additions & 13 deletions crates/bundle_provider/Cargo.toml

This file was deleted.

2 changes: 0 additions & 2 deletions crates/bundle_provider/src/lib.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ path = "src/main.rs"
contender_core = { workspace = true }
contender_sqlite = { workspace = true }
contender_testfile = { workspace = true }
contender_engine_provider = { workspace = true }

ansi_term = { workspace = true }
serde = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion crates/cli/src/commands/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ use alloy::{
use contender_core::generator::PlanConfig;
use contender_core::{
agent_controller::{AgentStore, SignerStore},
engine_provider::DEFAULT_BLOCK_TIME,
error::ContenderError,
generator::RandSeed,
test_scenario::{TestScenario, TestScenarioParams},
};
use contender_engine_provider::DEFAULT_BLOCK_TIME;

use std::{
str::FromStr,
sync::{
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/commands/spam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ use alloy::{
use contender_core::{
agent_controller::AgentStore,
db::{DbOps, SpamDuration, SpamRunRequest},
engine_provider::{AdvanceChain, AuthProvider},
error::ContenderError,
generator::{seeder::Seeder, templater::Templater, PlanConfig, RandSeed},
spammer::{BlockwiseSpammer, Spammer, TimedSpammer},
test_scenario::{TestScenario, TestScenarioParams},
};
use contender_engine_provider::{AdvanceChain, AuthProvider};
use contender_testfile::TestConfig;
use op_alloy_network::Optimism;
use std::{path::PathBuf, sync::atomic::AtomicBool};
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/util/provider.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Contains a wrapper for auth_provider to handle errors in the cli context.

use async_trait::async_trait;
use contender_engine_provider::{error::AuthProviderError, AdvanceChain, AuthResult};
use contender_core::engine_provider::{error::AuthProviderError, AdvanceChain, AuthResult};
use tracing::warn;

pub struct AuthClient {
Expand All @@ -23,7 +23,7 @@ impl AdvanceChain for AuthClient {
.map_err(|e| {
match e {
AuthProviderError::InternalError(_, _) => {
warn!("AuthClient encountered an internal error. Please check contender_engine_provider debug logs for more details.");
warn!("AuthClient encountered an internal error. Please check contender_core::engine_provider debug logs for more details.");
}
AuthProviderError::ConnectionFailed(_) => {
warn!("Please check the auth provider connection.");
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/util/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ use alloy::{
use ansi_term::Color;
use contender_core::{
db::RunTx,
engine_provider::{AdvanceChain, DEFAULT_BLOCK_TIME},
generator::{
types::{AnyProvider, FunctionCallDefinition, SpamRequest},
util::complete_tx_request,
},
spammer::{LogCallback, NilCallback},
};
use contender_engine_provider::{AdvanceChain, DEFAULT_BLOCK_TIME};
use contender_testfile::TestConfig;
use csv::Writer;
use std::{str::FromStr, sync::Arc, time::Duration};
Expand Down
23 changes: 19 additions & 4 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ repository.workspace = true
description = "Contender core library"

[dependencies]
contender_bundle_provider = { workspace = true }
contender_engine_provider = { workspace = true }

alloy = { workspace = true, features = ["full", "node-bindings"] }
alloy = { workspace = true, features = [
"full",
"node-bindings",
"rpc-types-mev",
"json-rpc",
"provider-engine-api",
] }
alloy-rpc-types-engine = { workspace = true, features = ["std", "jwt"] }
alloy-json-rpc = { workspace = true }
async-trait.workspace = true
eyre = { workspace = true }
futures = { workspace = true }
Expand All @@ -26,3 +31,13 @@ tokio-util = { workspace = true }
tower = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter", "fmt"] }

thiserror = { workspace = true }
reth-node-api = { workspace = true }
reth-rpc-layer = { workspace = true }
reth-optimism-node = { workspace = true }
reth-optimism-primitives = { workspace = true }
op-alloy-consensus = { workspace = true }
op-alloy-network = { workspace = true }
op-alloy-rpc-types = { workspace = true }
secp256k1 = { version = "0.30" }
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use reth_optimism_node::OpPayloadAttributes;
use std::path::PathBuf;
use tracing::{debug, info};

use crate::{engine::Signer, read_jwt_file};
use crate::{error::AuthProviderError, valid_payload::EngineApiValidWaitExt};
use crate::engine_provider::{engine::Signer, read_jwt_file};
use crate::engine_provider::{error::AuthProviderError, valid_payload::EngineApiValidWaitExt};

use super::{auth_transport::AuthenticatedTransportConnect, AdvanceChain};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use op_alloy_consensus::OpTypedTransaction;
use reth_optimism_primitives::OpTransactionSigned;
use secp256k1::{Message, SecretKey, SECP256K1};

use crate::auth_provider::NetworkAttributes;
use crate::engine_provider::auth_provider::NetworkAttributes;

/// Extension trait that gives access to engine API RPC methods.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use async_trait::async_trait;

use crate::auth_provider::AuthResult;
use crate::engine_provider::auth_provider::AuthResult;

#[async_trait]
pub trait AdvanceChain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! response. This is useful for benchmarking, as it allows us to wait for a payload to be valid
//! before sending additional calls.

use crate::{auth_provider::NetworkAttributes, engine::EngineApi};
use crate::engine_provider::{auth_provider::NetworkAttributes, engine::EngineApi};
use alloy::primitives::B256;
use alloy::providers::Network;
use alloy::transports::TransportResult;
Expand Down
2 changes: 2 additions & 0 deletions crates/core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
pub mod agent_controller;
pub mod buckets;
pub mod bundle_provider;
pub mod db;
pub mod engine_provider;
pub mod error;
pub mod generator;
pub mod provider;
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/spammer/spammer_trait.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::sync::atomic::AtomicBool;
use std::{pin::Pin, sync::Arc};

use crate::engine_provider::DEFAULT_BLOCK_TIME;
use alloy::providers::Provider;
use contender_engine_provider::DEFAULT_BLOCK_TIME;
use futures::Stream;
use futures::StreamExt;
use tracing::{info, warn};
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/spammer/tx_callback.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::tx_actor::{CacheTx, TxActorHandle};
use crate::engine_provider::{AdvanceChain, DEFAULT_BLOCK_TIME};
use crate::generator::{types::AnyProvider, NamedTxRequest};
use alloy::providers::PendingTransactionConfig;
use contender_engine_provider::{AdvanceChain, DEFAULT_BLOCK_TIME};
use std::{collections::HashMap, sync::Arc};
use tokio::task::JoinHandle;
use tracing::debug;
Expand Down
6 changes: 3 additions & 3 deletions crates/core/src/test_scenario.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use crate::agent_controller::AgentStore;
use crate::buckets::Bucket;
use crate::bundle_provider::new_basic_bundle;
use crate::bundle_provider::BundleClient;
use crate::db::{DbOps, NamedTx};
use crate::engine_provider::AdvanceChain;
use crate::error::ContenderError;
use crate::generator::named_txs::ExecutionRequest;
use crate::generator::templater::Templater;
Expand All @@ -25,9 +28,6 @@ use alloy::rpc::types::TransactionRequest;
use alloy::serde::WithOtherFields;
use alloy::signers::local::{LocalSigner, PrivateKeySigner};
use alloy::transports::http::reqwest::Url;
use contender_bundle_provider::bundle_provider::new_basic_bundle;
use contender_bundle_provider::BundleClient;
use contender_engine_provider::AdvanceChain;
use futures::{Stream, StreamExt};
use std::collections::{BTreeMap, HashMap};
use std::ops::Deref;
Expand Down
15 changes: 0 additions & 15 deletions crates/engine_provider/CHANGELOG.md

This file was deleted.

42 changes: 0 additions & 42 deletions crates/engine_provider/Cargo.toml

This file was deleted.

5 changes: 0 additions & 5 deletions crates/engine_provider/README.md

This file was deleted.

Loading