Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
74b6f33
feat(op-angstrom): initial exploration, wip
mempirate Jul 25, 2025
ef456bd
feat(op-angstrom): more progress on op-angstrom
mempirate Jul 25, 2025
1f3b232
feat(op-angstrom): generic amm-quoter
mempirate Jul 25, 2025
780e44d
docs(op-angstrom): add rollup ADR
mempirate Jul 25, 2025
410e867
docs(op-angstrom): add to ADR
mempirate Jul 25, 2025
4612e42
docs(op-angstrom): add to ADR
mempirate Jul 25, 2025
5800008
docs(op-angstrom): fix ADR link
mempirate Jul 25, 2025
0295ae2
feat(op-angstrom): uniswap-v4 crate generics
mempirate Jul 25, 2025
c74d465
feat(op-angstrom): integrate generic uniswap-v4
mempirate Jul 25, 2025
5b42ce4
feat(op-angstrom): amm-quoter consensus implementation
mempirate Jul 25, 2025
d1b5e40
feat(op-angstrom): extract shared methods to generic amm-quoter
mempirate Jul 25, 2025
2cf0e56
feat(op-angstrom): amm-quoter rollup mode, clean up
mempirate Jul 25, 2025
9305845
feat(op-angstrom): integrate amm-quoter in op-angstrom
mempirate Jul 25, 2025
4aecaa1
chore(op-angstrom): fmt
mempirate Jul 28, 2025
45ec7c3
feat(op-angstrom): better QuoterManager API
mempirate Jul 28, 2025
f803c7e
docs(op-angstrom): update
mempirate Jul 28, 2025
1d644e0
feat(op-angstrom): make testing-tools compile again
mempirate Jul 28, 2025
dca4187
feat(cli): extract cli functionality to angstrom-cli crate
mempirate Jul 28, 2025
e2da8a0
chore: update deps
mempirate Jul 28, 2025
3e8e2ba
feat(cli): use angstrom-cli in angstrom/main
mempirate Jul 28, 2025
3308019
chore(op-angstrom): extract pool manager
estensen Jul 28, 2025
1f3616b
chore(op-angstrom): move shared types
estensen Jul 28, 2025
deb2b88
chore(op-angstrom): remove moved cache
estensen Jul 28, 2025
98ef2b4
chore(op-angstrom): re-add cache tests
estensen Jul 28, 2025
04093ce
chore(op-angstrom): use type state pattern for pool manager
estensen Jul 28, 2025
55608fe
chore(op-angstrom): refactor type state pattern for pool manager
estensen Jul 28, 2025
032a81a
chore(op-angstrom): use static dispatch in pool manager
estensen Jul 28, 2025
a503925
chore(pool-manager): address PR feedback for clean crate boundaries
estensen Jul 28, 2025
98999d3
chore(pool-manager): address PR feedback for improved API design
estensen Jul 28, 2025
207b47b
feat(cli): checkpoint
mempirate Jul 28, 2025
c555223
refactor(pool-manager): decouple types from Tokio and clean up depend…
estensen Jul 29, 2025
7f4b6fe
fix(pool-manager): resolve remaining extraction issues
estensen Jul 29, 2025
99196f4
fix(pool-manager): use workspace dependencies and apply formatting
estensen Jul 29, 2025
1713c07
chore(op-angstrom): fmt, clippy and test
estensen Jul 29, 2025
69f1495
chore(op-angstrom): nightly fmt
estensen Jul 29, 2025
131d6a9
chore(op-angstrom): simplify import
estensen Jul 29, 2025
a644693
chore(op-angstrom): fix lints
estensen Jul 29, 2025
99ff841
chore(op-angstrom): nightly fmt
estensen Jul 29, 2025
bb4ca44
fix(op-angstrom/cli): smol issue
mempirate Aug 1, 2025
b41ce1e
chore(op-angstrom): only poll in consensus mode
estensen Aug 1, 2025
a6ccc8a
chore(op-angstrom): prefer RollupPoolManager::new over PoolManagerBui…
estensen Aug 1, 2025
6c4a743
chore(op-angstrom): remove aliases
estensen Aug 1, 2025
e3ba648
refactor(pool-manager): remove network requirement for rollup mode
estensen Aug 1, 2025
1d79f84
fix(pool-manager): move network order polling to ConsensusMode only
estensen Aug 1, 2025
6f3c8c8
fix(pool-manager): move network polling to ConsensusMode and refactor…
estensen Aug 1, 2025
5f49669
refactor(pool-manager): simplify generic params
estensen Aug 1, 2025
9fb4e19
refactor(pool-manager): remove generic builder pattern and fix Future…
estensen Aug 1, 2025
a06a1f3
refactor(pool-manager): add poll_mode_specific trait method for clean…
estensen Aug 1, 2025
e4f91fb
chore(pool-manager): standardize type aliases and public API
estensen Aug 1, 2025
984f449
refactor(pool-manager): remove placeholder code and improve rollup ef…
estensen Aug 1, 2025
bb4e542
feat(cli): new approach, checkpoint
mempirate Aug 1, 2025
f69505d
feat(cli): more wip
mempirate Aug 1, 2025
e74d881
chore(pool-manager): remove redundant import
estensen Aug 4, 2025
5f2daba
chore(pool-manager): remove M::REQUIRES_NETWORKING
estensen Aug 4, 2025
3b1be5e
chore(pool-manager): cleanup comments
estensen Aug 4, 2025
4a4c2a9
chore(pool-manager): nightly fmt
estensen Aug 4, 2025
dd0b956
chore(pool-manager): remove dummy NoNetwork struct
estensen Aug 4, 2025
1ca0388
chore(pool-manager): simplify macro
estensen Aug 4, 2025
558c7ca
fix(pool-manager): busy poll loop
estensen Aug 4, 2025
9fcf353
chore(pool-manager): remove redundant qualifiers
estensen Aug 4, 2025
0327d8c
fix(pool-manager): deduplicate consensus on_pool_events via shared ha…
estensen Aug 8, 2025
5150b71
fix(pool-manager): correct LruCache eviction condition
estensen Aug 8, 2025
5756a83
chore(pool-manager): mirror type state pattern in amm-quoter
estensen Aug 13, 2025
cbf714d
refactor(pool-manager): deduplicate common logic across consensus and…
estensen Aug 13, 2025
c244c5a
fix(pool-manager): origin passthrough
estensen Aug 13, 2025
5bd1711
fix: ensure to use proper key for uni-pool
estensen Aug 13, 2025
8cc32f7
checkpoint
mempirate Aug 14, 2025
3a098d0
feat(cli): refactor op-angstrom
mempirate Aug 14, 2025
c23e7f4
feat(cli): finalize launch() for rollup mode
mempirate Aug 14, 2025
a74144c
Merge pull request #596 from SorellaLabs/uni-pool
mempirate Aug 14, 2025
38ee681
feat(test): make tests compile
mempirate Aug 14, 2025
a470c8a
Merge pull request #577 from SorellaLabs/jonas/feat/cli-crate
mempirate Aug 18, 2025
79edd26
feat(op-angstrom): integrate rollup flags
mempirate Aug 18, 2025
7d81165
feat(pool-manager): update common trait
mempirate Aug 18, 2025
8d18960
refactor(pool-manager): move stuff around
mempirate Aug 18, 2025
d1fdf6a
refactor(pool-manager): move stuff around, rm unused
mempirate Aug 18, 2025
1e41118
refactor(pool-manager): more refactoring
mempirate Aug 18, 2025
b3cf302
feat: merge
mempirate Aug 18, 2025
b7d17a0
Merge pull request #578 from SorellaLabs/havard/pool-manager
mempirate Aug 18, 2025
50286c7
feat(op-angstrom): wip on rollup driver
mempirate Aug 19, 2025
76fd566
fix(op-angstrom): fix rollup driver poll
mempirate Aug 19, 2025
43e90ed
feat(op-angstrom): continue rollup driver
mempirate Aug 19, 2025
443d19e
feat: add rollup support for SubmissionHandler
estensen Aug 20, 2025
57ccb09
feat(op-angstrom): finalize rollup driver
mempirate Aug 20, 2025
647b7dc
chore: fmt
mempirate Aug 20, 2025
d5ef2ff
refactor: simplify SubmissionHandler with MEV boost builder pattern
estensen Aug 20, 2025
80ac318
feat(op-angstrom): rename, address PR review
mempirate Aug 20, 2025
5a50ce9
feat(op-angstrom): add mo logs
mempirate Aug 20, 2025
a91c9e9
docs(op-angstrom): comments
mempirate Aug 20, 2025
e554ad8
refactor(op-angstrom): add util function
mempirate Aug 20, 2025
4774e50
docs(op-angstrom): comments
mempirate Aug 20, 2025
7dfbd2e
feat(op-angstrom): add CLI param for block time:
mempirate Aug 20, 2025
445e982
chore: make anstrom submitter optional
estensen Aug 20, 2025
2678314
chore: fix lints
estensen Aug 20, 2025
7b59fc5
nit
mempirate Aug 20, 2025
5aab5ab
fix(op-angstrom): use correct canon state stream
mempirate Aug 20, 2025
64f6cf7
Merge pull request #601 from SorellaLabs/jonas/feat/rollup-driver
mempirate Aug 20, 2025
0b4bb92
Merge pull request #602 from SorellaLabs/havard/submission
estensen Aug 21, 2025
6bd8e93
feat(order-pool): make chain timing parameters explicit
estensen Aug 6, 2025
943c92a
test(order-pool): add OP Angstrom timing test for cancel deadline
estensen Aug 8, 2025
f759913
chore(order-pool): set max_order_delay_propagation to 0
estensen Aug 19, 2025
48ccb9e
chore: remove test
estensen Aug 19, 2025
57a90c6
chore: clean up import
estensen Aug 19, 2025
fcbf05b
refactor: move ChainConfig to types crate
estensen Aug 20, 2025
7467c40
chore: fix lints
estensen Aug 20, 2025
e9be35c
chore: get block time from config
estensen Aug 22, 2025
23da210
refactor(op-angstrom): rm old dep
mempirate Aug 22, 2025
c20e0e2
Merge pull request #591 from SorellaLabs/havard/order-tracker-conf
estensen Aug 22, 2025
2b6d7c4
fix(op-angstrom): fmt
mempirate Aug 22, 2025
2ef64ba
chore(cli): add sequencer endpoint configuration for rollup mode
estensen Aug 22, 2025
1e454fa
fix(cli): check that args.rollup.sequencer exist before transforming
estensen Aug 22, 2025
30dc8f3
fix(cli): don't allow empty normal_nodes
estensen Aug 22, 2025
c0c0d91
Merge branch 'main' into feat/rollup-compat
estensen Aug 22, 2025
c8d1247
refactor(cli): map to url in get_normal_nodes()
estensen Aug 22, 2025
639bbb8
feat(op-angstrom): use get_all_orders_with_ingoing_cancellations, fix…
mempirate Aug 22, 2025
543fd26
chore(cli): simplify with let else
estensen Aug 22, 2025
11ed706
chore(cli): don't allow websocket sequencer endpoint
estensen Aug 22, 2025
e1bb0e2
chore(cli): add l2 sequencer endpoint instead of overwriting
estensen Aug 22, 2025
f64355b
chore(cli): make url parsing more robust
estensen Aug 22, 2025
148c991
chore(cli): don't add endpoint if it's already in the list
estensen Aug 22, 2025
308d0c2
Merge pull request #604 from SorellaLabs/havard/sequencer-endpoint
estensen Aug 22, 2025
c43a5f2
Merge branch 'main' into feat/rollup-compat
estensen Aug 25, 2025
68d149a
chore: extract and test helpers
estensen Aug 25, 2025
eccc7c1
fix: reject invalid urls
estensen Aug 25, 2025
05403a7
refactor: tests to table-driven style
estensen Aug 25, 2025
25ab2af
chore: add amm quoter tests
estensen Aug 25, 2025
601e5cd
chore: remove outdated todo
estensen Aug 25, 2025
2caebd2
chore: add amm quoter tests
estensen Aug 25, 2025
6e4e2e7
chore: remove outdated todo
estensen Aug 25, 2025
8bcd64f
chore: add amm quoter tests
estensen Aug 25, 2025
4ef34ba
chore: remove redunant amm quoter tests
estensen Aug 25, 2025
89fe907
chore: remove outdated todo
estensen Aug 25, 2025
b9c9722
chore: test cli parsing and config validation
estensen Aug 25, 2025
4bbc69c
chore: lint and avoid brittle comparison
estensen Aug 25, 2025
545842d
Merge branch 'main' into feat/rollup-compat
mempirate Aug 26, 2025
9f75bfb
Merge pull request #608 from SorellaLabs/havard/todos
estensen Aug 26, 2025
878f70e
Merge pull request #609 from SorellaLabs/havard/amm-test
estensen Aug 26, 2025
c4c9edc
chore: move add_sequencer function to AngstromConfig
estensen Aug 26, 2025
dee6d1a
chore: move validate_sequencer_url() to AngstromConfig
estensen Aug 26, 2025
91635f6
chore: add helper to add validated sequencer
estensen Aug 26, 2025
7d689ab
Merge pull request #607 from SorellaLabs/havard/url-val
mempirate Sep 15, 2025
9d0b5aa
Merge pull request #610 from SorellaLabs/havard/cli-test
mempirate Sep 15, 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
757 changes: 667 additions & 90 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ alloy-transport-ws = { version = "1.0.23", default-features = false }
alloy-trie = { version = "0.9.0", default-features = false }
angstrom = { path = "./bin/angstrom/" }
angstrom-amm-quoter = { path = "./crates/amm-quoter/" }
angstrom-cli = { path = "./crates/cli/" }
angstrom-eth = { path = "./crates/eth/" }
angstrom-metrics = { path = "./crates/metrics/" }
angstrom-network = { path = "./crates/angstrom-net/" }
Expand All @@ -98,6 +99,7 @@ angstrom-utils = { path = "./crates/utils/" }
anyhow = "1"
aquamarine = "0"
arbitrary = "1"
arraydeque = "0"
assert_matches = "1"
async-trait = "0"
auto_impl = "1"
Expand All @@ -117,7 +119,9 @@ divan = "0"
enr = { version = "0", default-features = false, features = ["k256"] }
eyre = "0"
futures = "0"
futures-core = "0"
futures-util = "0"
hex = "0.4.3"
hex-literal = "0"
homedir = "0"
hsm-signer = { git = "https://github.com/SorellaLabs/hsm-signer" }
Expand All @@ -127,6 +131,7 @@ jsonrpsee-core = "0.25.1"
jsonrpsee-http-client = "0.25.1"
jsonrpsee-types = "0.25.1"
k256 = { version = "0", default-features = false }
linked_hash_set = "0"
malachite = "0.4"
malachite-q = "0.4"
matching-engine = { path = "./crates/matching-engine/" }
Expand All @@ -137,6 +142,7 @@ once_cell = "1"
order-pool = { path = "./crates/order-pool/" }
pade = { git = "https://github.com/SorellaLabs/pade", version = "0.1.0" }
pade-macro = { git = "https://github.com/SorellaLabs/pade", version = "0.1.0" }
pool-manager = { path = "./crates/pool-manager/" }
parking_lot = "0"
pin-project = "1"
pprof = "0"
Expand Down Expand Up @@ -216,3 +222,9 @@ uniswap-v4 = { path = "./crates/uniswap-v4/" }
uniswap_v3_math = { git = "https://github.com/SorellaLabs/v3-math", branch = "main" }
url = "2"
validation = { path = "./crates/validation/" }

# OP-stack support
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth", version = "1.6.0", tag = "v1.6.0" }
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth", version = "1.6.0", tag = "v1.6.0" }
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth", version = "1.6.0", tag = "v1.6.0" }
reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth", version = "1.6.0", tag = "v1.6.0" }
35 changes: 1 addition & 34 deletions bin/angstrom/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,7 @@ Angstrom Sidecar implementation
"""

[dependencies]
alloy.workspace = true
alloy-chains.workspace = true
alloy-primitives.workspace = true
angstrom-amm-quoter.workspace = true
angstrom-eth.workspace = true
angstrom-metrics.workspace = true
angstrom-network.workspace = true
angstrom-rpc.workspace = true
angstrom-types.workspace = true
clap.workspace = true
consensus.workspace = true
eyre.workspace = true
futures.workspace = true
hsm-signer.workspace = true
matching-engine.workspace = true
order-pool.workspace = true
parking_lot.workspace = true
rayon = "1"
reth.workspace = true
reth-db.workspace = true
reth-metrics.workspace = true
reth-network.workspace = true
reth-node-builder.workspace = true
reth-node-ethereum.workspace = true
reth-node-metrics.workspace = true
reth-provider.workspace = true
serde.workspace = true
telemetry.workspace = true
tokio.workspace = true
toml.workspace = true
tracing.workspace = true
uniswap-v4.workspace = true
url.workspace = true
validation.workspace = true
angstrom-cli.workspace = true

[target.'cfg(unix)'.dependencies]
tikv-jemallocator = { version = "0.6.0", optional = true }
Expand Down
92 changes: 0 additions & 92 deletions bin/angstrom/src/cli.rs

This file was deleted.

2 changes: 1 addition & 1 deletion bin/angstrom/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

fn main() {
if let Err(err) = angstrom::run() {
if let Err(err) = angstrom_cli::angstrom::run() {
eprintln!("Error: {err:?}");
std::process::exit(1);
}
Expand Down
26 changes: 26 additions & 0 deletions bin/op-angstrom/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "op-angstrom"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
description = """
Angstrom Sidecar implementation
"""

[dependencies]
angstrom-cli.workspace = true

[target.'cfg(unix)'.dependencies]
tikv-jemallocator = { version = "0.6.0", optional = true }

[features]
default = ["jemalloc"]
jemalloc = ["dep:tikv-jemallocator"]
jemalloc-prof = ["jemalloc", "tikv-jemallocator?/profiling"]

[[bin]]
name = "op-angstrom"
path = "src/main.rs"
11 changes: 11 additions & 0 deletions bin/op-angstrom/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// We use jemalloc for performance reasons
#[cfg(all(feature = "jemalloc", unix))]
#[global_allocator]
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

fn main() {
if let Err(err) = angstrom_cli::op_angstrom::run() {
eprintln!("Error: {err:?}");
std::process::exit(1);
}
}
1 change: 0 additions & 1 deletion bin/testnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ alloy.workspace = true
alloy-primitives.workspace = true
alloy-rpc-types.workspace = true
alloy-signer-local.workspace = true
angstrom.workspace = true
angstrom-metrics.workspace = true
angstrom-rpc.workspace = true
angstrom-types = { workspace = true }
Expand Down
4 changes: 4 additions & 0 deletions crates/amm-quoter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ serde.workspace = true
tokio.workspace = true
tokio-stream.workspace = true
uniswap-v4.workspace = true

[dev-dependencies]
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "time"] }
alloy-primitives.workspace = true
144 changes: 144 additions & 0 deletions crates/amm-quoter/src/consensus.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
//! This module implements consensus-based quoter mode.
use std::{
collections::{HashMap, HashSet},
pin::Pin,
sync::Arc,
task::Poll,
time::Duration
};

use angstrom_types::{
block_sync::BlockSyncConsumer,
consensus::{ConsensusRoundEvent, ConsensusRoundOrderHashes},
orders::OrderSet,
primitive::PoolId,
sol_bindings::{grouped_orders::AllOrders, rpc_orders::TopOfBlockOrder}
};
use futures::{Stream, StreamExt, stream::FuturesUnordered};
use order_pool::order_storage::OrderStorage;
use rayon::ThreadPool;
use tokio::{sync::mpsc, time::interval};
use uniswap_v4::uniswap::pool_manager::SyncedUniswapPools;

use crate::{QuoterManager, Slot0Update, book_snapshots_from_amms};

/// A type alias for the consensus quoter manager.
pub type ConsensusQuoterManager<BlockSync> = QuoterManager<BlockSync, ConsensusMode>;

/// Mode for consensus-based order book building.
pub struct ConsensusMode {
consensus_stream: Pin<Box<dyn Stream<Item = ConsensusRoundOrderHashes> + Send>>,
/// The unique order hashes of the current PreProposalAggregate consensus
/// round. Used to build the book for the slot0 stream, so that all
/// orders are valid, and the subscription can't be manipulated by orders
/// submitted after this round and between the next block
active_pre_proposal_aggr_order_hashes: Option<ConsensusRoundOrderHashes>
}

impl<BlockSync: BlockSyncConsumer> QuoterManager<BlockSync, ConsensusMode> {
/// ensure that we haven't registered on the BlockSync.
/// We just want to ensure that we don't access during a update period
pub fn new(
block_sync: BlockSync,
orders: Arc<OrderStorage>,
recv: mpsc::Receiver<(HashSet<PoolId>, mpsc::Sender<Slot0Update>)>,
amms: SyncedUniswapPools,
threadpool: ThreadPool,
update_interval: Duration,
consensus_stream: Pin<Box<dyn Stream<Item = ConsensusRoundOrderHashes> + Send>>
) -> Self {
let cur_block = block_sync.current_block_number();
let book_snapshots = book_snapshots_from_amms(&amms);

assert!(
update_interval > Duration::from_millis(10),
"cannot update quicker than every 10ms"
);

let mode = ConsensusMode { consensus_stream, active_pre_proposal_aggr_order_hashes: None };

Self {
seq_id: 0,
block_sync,
orders,
amms,
recv,
cur_block,
book_snapshots,
threadpool,
pending_tasks: FuturesUnordered::new(),
pool_to_subscribers: HashMap::default(),
execution_interval: interval(update_interval),
mode
}
}

pub(crate) fn all_orders_with_consensus(&self) -> OrderSet<AllOrders, TopOfBlockOrder> {
if let Some(hashes) = self.mode.active_pre_proposal_aggr_order_hashes.as_ref() {
self.orders
.get_all_orders_with_hashes(&hashes.limit, &hashes.searcher)
} else {
self.orders.get_all_orders()
}
}

fn update_consensus_state(&mut self, round: ConsensusRoundOrderHashes) {
if matches!(round.round, ConsensusRoundEvent::PropagatePreProposalAgg) {
self.mode.active_pre_proposal_aggr_order_hashes = Some(round)
}
}
}

impl<BlockSync: BlockSyncConsumer> Future for QuoterManager<BlockSync, ConsensusMode> {
type Output = ();

fn poll(
mut self: Pin<&mut Self>,
cx: &mut std::task::Context<'_>
) -> std::task::Poll<Self::Output> {
while let Poll::Ready(Some((pools, subscriber))) = self.recv.poll_recv(cx) {
self.handle_new_subscription(pools, subscriber);
}

while let Poll::Ready(Some(consensus_update)) =
self.mode.consensus_stream.poll_next_unpin(cx)
{
self.update_consensus_state(consensus_update);
}

while let Poll::Ready(Some(Ok(slot_update))) = self.pending_tasks.poll_next_unpin(cx) {
self.send_out_result(slot_update);
}

while self.execution_interval.poll_tick(cx).is_ready() {
// cycle through if we can't do any processing
if !self.block_sync.can_operate() {
cx.waker().wake_by_ref();
return Poll::Pending;
}

// update block number, amm snapshot and reset seq id
if self.cur_block != self.block_sync.current_block_number() {
self.update_book_state();
self.cur_block = self.block_sync.current_block_number();

self.mode.active_pre_proposal_aggr_order_hashes = None;

self.seq_id = 0;
}

// inc seq_id
let seq_id = self.seq_id;
// given that we have a max update speed of 10ms, the max
// this should reach is 1200 before a new block update
// occurs. Becuase of this, there is no need to check for overflow
// as 65535 is more than enough
self.seq_id += 1;

let orders = self.all_orders_with_consensus();
self.spawn_book_solvers(seq_id, orders);
}

Poll::Pending
}
}
Loading