Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ef6b734
updates the tx-poller to stream transactions
dylanlott Mar 7, 2025
1ad6e14
refactors
dylanlott Mar 17, 2025
b5a5cf4
Fix: various updates to the tx poller (#67)
prestwich Apr 8, 2025
3117b85
updates bundler to streaming actor pattern
dylanlott Mar 17, 2025
96dce04
refactors
dylanlott Mar 17, 2025
5cfbdc9
fmt
dylanlott Mar 19, 2025
c4522ee
fix: remove eq/partial eq
prestwich Apr 7, 2025
01a11e6
fix: various improvements to bundler tasks (#68)
prestwich Apr 8, 2025
6374238
chore: update to alloy@0.11
dylanlott Mar 17, 2025
b1324b0
refactors to account for init4 bin base in builder craate
dylanlott Mar 17, 2025
976dd03
use signet-sdk
dylanlott Mar 27, 2025
b229996
fix: update bin-base import
dylanlott Mar 27, 2025
bafe07f
nits: doc updates
prestwich Apr 7, 2025
e0c79f7
lint: fmt
prestwich Apr 7, 2025
785172b
feat: implements simulation for block building
dylanlott Apr 15, 2025
ff5cb31
lint: fmt
dylanlott Apr 15, 2025
a142314
cleanup
dylanlott Apr 15, 2025
9d812ce
WIP: adding a block builder loop test
dylanlott Apr 17, 2025
bf75913
tests are passing now
dylanlott Apr 18, 2025
55b2193
adds slot calculator to block builder
dylanlott Apr 19, 2025
fd4bdcd
refactors test utils across tasks
dylanlott Apr 19, 2025
dd4b377
fmt
dylanlott Apr 19, 2025
1ee991f
fixup clippy and fmt
dylanlott Apr 19, 2025
50162b7
update cargo paths to sdk
dylanlott Apr 19, 2025
14a0a62
mark block builder test as integration test
dylanlott Apr 23, 2025
1125f4d
cleanup
dylanlott Apr 23, 2025
acb3d42
clippy + fmt
dylanlott Apr 23, 2025
4639365
cleanup
dylanlott Apr 23, 2025
9e1bc74
adds basefee checker to sim cache handling
dylanlott Apr 24, 2025
06da0b5
fix pointer changes
dylanlott Apr 24, 2025
70fdac1
ignore test spawn
dylanlott Apr 24, 2025
6b59e39
update signet-sim deps to main branch
dylanlott Apr 28, 2025
09fc552
try_join the setup of host, rollup, and sequencer services
dylanlott Apr 28, 2025
830f297
removes unused error from ConfigError
dylanlott Apr 28, 2025
1ad4974
use AtomicU64 instead of RwLock in cache task handler
dylanlott Apr 28, 2025
b4c64da
cleanup & refactors
dylanlott Apr 28, 2025
8300f03
removes unnecessary `SimItem` usage from cache updater
dylanlott Apr 28, 2025
f27dde8
makes tx-pool hold a `Client` reference for reuse
dylanlott Apr 28, 2025
f63fe6b
update comment
dylanlott Apr 28, 2025
79977bd
sets concurrency limit by calling `available_parallelism` or overridi…
dylanlott Apr 28, 2025
c8deba9
refactors the rollup provider type
dylanlott Apr 28, 2025
8980e23
creates mod consts
dylanlott Apr 28, 2025
4e97d89
pulls chain configs out into constants module
dylanlott Apr 29, 2025
31d62d6
clippy + fmt
dylanlott Apr 29, 2025
83c80f8
WIP filler bin
anna-carroll May 2, 2025
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
24 changes: 21 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,29 @@ path = "bin/builder.rs"
name = "transaction-submitter"
path = "bin/submit_transaction.rs"

[[bin]]
name = "fill-order"
path = "bin/fill_order.rs"

[dependencies]
init4-bin-base = "0.1.0"
init4-bin-base = { git = "https://github.com/init4tech/bin-base.git" }

zenith-types = "0.13"
signet-zenith = { git = "https://github.com/init4tech/signet-sdk", branch = "main" }
signet-types = { git = "https://github.com/init4tech/signet-sdk", branch = "main" }
signet-bundle = { git = "https://github.com/init4tech/signet-sdk", branch = "main" }
signet-sim = { git = "https://github.com/init4tech/signet-sdk", branch = "main" }

alloy = { version = "0.7.3", features = ["full", "json-rpc", "signer-aws", "rpc-types-mev", "rlp"] }
trevm = { version = "0.20.10", features = ["concurrent-db", "test-utils"] }

alloy = { version = "0.12.6", features = [
"full",
"json-rpc",
"signer-aws",
"rpc-types-mev",
"rlp",
"node-bindings",
"serde",
] }

aws-config = "1.1.7"
aws-sdk-kms = "1.15.0"
Expand All @@ -48,3 +65,4 @@ tokio = { version = "1.36.0", features = ["full", "macros", "rt-multi-thread"] }

async-trait = "0.1.80"
oauth2 = "4.4.2"
tracing-subscriber = "0.3.19"
62 changes: 47 additions & 15 deletions bin/builder.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#![allow(dead_code)]

use builder::config::BuilderConfig;
use builder::service::serve_builder_with_span;
use builder::tasks::block::BlockBuilder;
use builder::tasks::metrics::MetricsTask;
use builder::tasks::oauth::Authenticator;
use builder::tasks::submit::SubmitTask;

use builder::{
config::BuilderConfig,
service::serve_builder_with_span,
tasks::{
block::Simulator, bundler, metrics::MetricsTask, oauth::Authenticator, submit::SubmitTask,
tx_poller,
},
};
use signet_sim::SimCache;
use signet_types::SlotCalculator;
use std::sync::Arc;
use tokio::select;

#[tokio::main]
Expand All @@ -16,19 +18,20 @@ async fn main() -> eyre::Result<()> {
let span = tracing::info_span!("zenith-builder");

let config = BuilderConfig::load_from_env()?.clone();
let host_provider = config.connect_host_provider().await?;
let ru_provider = config.connect_ru_provider().await?;
let constants = config.load_pecorino_constants();
let authenticator = Authenticator::new(&config);

tracing::debug!(rpc_url = config.host_rpc_url.as_ref(), "instantiated provider");
let (host_provider, ru_provider, sequencer_signer) = tokio::try_join!(
config.connect_host_provider(),
config.connect_ru_provider(),
config.connect_sequencer_signer(),
)?;

let sequencer_signer = config.connect_sequencer_signer().await?;
let zenith = config.connect_zenith(host_provider.clone());

let metrics = MetricsTask { host_provider: host_provider.clone() };
let (tx_channel, metrics_jh) = metrics.spawn();

let builder = BlockBuilder::new(&config, authenticator.clone(), ru_provider.clone());
let submit = SubmitTask {
authenticator: authenticator.clone(),
host_provider,
Expand All @@ -39,14 +42,43 @@ async fn main() -> eyre::Result<()> {
outbound_tx_channel: tx_channel,
};

let tx_poller = tx_poller::TxPoller::new(&config);
let (tx_receiver, tx_poller_jh) = tx_poller.spawn();

let bundle_poller = bundler::BundlePoller::new(&config, authenticator.clone());
let (bundle_receiver, bundle_poller_jh) = bundle_poller.spawn();

let authenticator_jh = authenticator.spawn();

let (submit_channel, submit_jh) = submit.spawn();
let build_jh = builder.spawn(submit_channel);

let sim_items = SimCache::new();
let slot_calculator =
SlotCalculator::new(config.start_timestamp, config.chain_offset, config.target_slot_time);

let sim = Arc::new(Simulator::new(&config, ru_provider.clone(), slot_calculator));

let (basefee_jh, sim_cache_jh) =
sim.clone().spawn_cache_task(tx_receiver, bundle_receiver, sim_items.clone());

let build_jh = sim.clone().spawn_simulator_task(constants, sim_items.clone(), submit_channel);

let port = config.builder_port;
let server = serve_builder_with_span(([0, 0, 0, 0], port), span);

select! {
_ = tx_poller_jh => {
tracing::info!("tx_poller finished");
},
_ = bundle_poller_jh => {
tracing::info!("bundle_poller finished");
},
_ = sim_cache_jh => {
tracing::info!("sim cache task finished");
}
_ = basefee_jh => {
tracing::info!("basefee task finished");
}
_ = submit_jh => {
tracing::info!("submit finished");
},
Expand Down
Loading
Loading