Skip to content

Commit

Permalink
refactor: rebrand to 'evangelion' (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobkaufmann authored Jul 26, 2023
1 parent b77b89c commit b5317b2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
30 changes: 15 additions & 15 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "dark-builder"
name = "evangelion"
version = "0.1.0"
edition = "2021"

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# dark-builder
# evangelion

a prototype for a block builder with "dark" order flow
a prototype block builder for ethereum
18 changes: 9 additions & 9 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ pub struct Builder<Client> {
chain: Arc<ChainSpec>,
client: Arc<Client>,
extra_data: u128,
darkpool: Arc<Mutex<BundlePool>>,
bundle_pool: Arc<Mutex<BundlePool>>,
incoming: broadcast::Sender<(BundleId, BlockNumber, BundleCompact)>,
invalidated: broadcast::Sender<BundleId>,
}
Expand All @@ -478,14 +478,14 @@ where
let (incoming, _) = broadcast::channel(256);
let (invalidated, _) = broadcast::channel(256);

let darkpool = BundlePool::default();
let darkpool = Arc::new(Mutex::new(darkpool));
let bundle_pool = BundlePool::default();
let bundle_pool = Arc::new(Mutex::new(bundle_pool));

Self {
chain,
client,
extra_data,
darkpool,
bundle_pool,
incoming,
invalidated,
}
Expand All @@ -497,7 +497,7 @@ where
mut bundle_flow: mpsc::UnboundedReceiver<Bundle>,
mut state_events: mpsc::UnboundedReceiver<CanonStateNotification>,
) {
let darkpool = Arc::clone(&self.darkpool);
let bundle_pool = Arc::clone(&self.bundle_pool);
let invalidated = self.invalidated.clone();
let incoming = self.incoming.clone();

Expand All @@ -511,7 +511,7 @@ where
loop {
tokio::select! {
_ = interval.tick() => {
darkpool.lock().unwrap().tick(SystemTime::now());
bundle_pool.lock().unwrap().tick(SystemTime::now());
}
Some(bundle) = bundle_flow.recv() => {
let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs();
Expand All @@ -525,7 +525,7 @@ where
let timeout = Duration::from_secs(bundle.eligibility.end() - now);
bundle_expirations.insert(bundle.id, timeout);

darkpool.lock().unwrap().0.insert(bundle.clone());
bundle_pool.lock().unwrap().0.insert(bundle.clone());

// notify jobs about new bundle
//
Expand All @@ -539,7 +539,7 @@ where
let _ = invalidated.send(expired.into_inner());
}
Some(event) = state_events.recv() => {
darkpool.lock().unwrap().maintain(event);
bundle_pool.lock().unwrap().maintain(event);
}
}
}
Expand Down Expand Up @@ -582,7 +582,7 @@ where
//
// NOTE: it may make more sense to use `attributes.timestamp` here in call to `eligible`
let bundles = self
.darkpool
.bundle_pool
.lock()
.unwrap()
.eligible(config.parent.number, SystemTime::now());
Expand Down

0 comments on commit b5317b2

Please sign in to comment.