diff --git a/Cargo.lock b/Cargo.lock index 3cbe76261..861805ba0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8411,9 +8411,9 @@ dependencies = [ [[package]] name = "tycho-client" -version = "0.83.4" +version = "0.85.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da113f5301ba1fb8e4441df405afa1e7b728a83017681b94851c5bc36d758dc" +checksum = "37d6f0b9dce98f6837ee2eefdf0ec9f23db4505bd744478326c6ec070a97dc1b" dependencies = [ "anyhow", "async-trait", @@ -8432,7 +8432,7 @@ dependencies = [ "tracing", "tracing-appender", "tracing-subscriber 0.3.19", - "tycho-common", + "tycho-common 0.85.0", "uuid 1.17.0", ] @@ -8461,6 +8461,31 @@ dependencies = [ "uuid 1.17.0", ] +[[package]] +name = "tycho-common" +version = "0.85.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54c02cbce2e31c700a18e73eb5f1b1b6570d3ec9dff7b9ba26dec5cbe16f3f1c" +dependencies = [ + "anyhow", + "async-trait", + "bytes", + "chrono", + "hex", + "num-bigint", + "rand 0.8.5", + "serde", + "serde_json", + "strum 0.25.0", + "strum_macros 0.25.3", + "thiserror 1.0.69", + "tiny-keccak", + "tracing", + "typetag", + "utoipa", + "uuid 1.17.0", +] + [[package]] name = "tycho-execution" version = "0.124.0" @@ -8480,7 +8505,7 @@ dependencies = [ "serde_json", "thiserror 1.0.69", "tokio", - "tycho-common", + "tycho-common 0.83.4", ] [[package]] @@ -8532,7 +8557,7 @@ dependencies = [ "tracing-appender", "tracing-subscriber 0.3.19", "tycho-client", - "tycho-common", + "tycho-common 0.85.0", "tycho-execution", "unicode-width 0.1.14", "uuid 1.17.0", diff --git a/Cargo.toml b/Cargo.toml index d1bb25c57..a95fae636 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,8 +48,8 @@ mini-moka = "0.10" lazy_static = "1.4.0" # Tycho dependencies -tycho-common = "0.83.3" -tycho-client = "0.83.3" +tycho-common = "0.85.0" +tycho-client = "0.85.0" # EVM dependencies foundry-config = { git = "https://github.com/foundry-rs/foundry", rev = "5a552bb0de7126fa35170fd84532bbd3d40cd348", optional = true } @@ -75,7 +75,7 @@ async-stream = { version = "0.3.6", optional = true } http = { version = "1.0", optional = true } prost = { version = "0.13", optional = true } # tycho execution for quickstart -tycho-execution = "0.124.0" +tycho-execution = "0.125.0" [dev-dependencies] tokio-test = "0.4.4" diff --git a/src/evm/stream.rs b/src/evm/stream.rs index a675aca00..ecf85806f 100644 --- a/src/evm/stream.rs +++ b/src/evm/stream.rs @@ -7,6 +7,7 @@ use tycho_client::{ feed::{component_tracker::ComponentFilter, synchronizer::ComponentWithState, BlockHeader}, stream::{StreamError, TychoStreamBuilder}, }; +use tycho_client::stream::RetryConfiguration; use tycho_common::{ models::{token::Token, Chain}, simulation::protocol_sim::ProtocolSim, @@ -108,6 +109,21 @@ impl ProtocolStreamBuilder { self } + pub fn max_missed_blocks(mut self, n: u64) -> Self { + self.stream_builder = self.stream_builder.max_missed_blocks(n); + self + } + + pub fn state_synchronizer_retry_config(mut self, config: &RetryConfiguration) -> Self { + self.stream_builder = self.stream_builder.state_synchronizer_retry_config(config); + self + } + + pub fn websocket_retry_config(mut self, config: &RetryConfiguration) -> Self { + self.stream_builder = self.stream_builder.websockets_retry_config(config); + self + } + /// Configures the client to exclude state updates from the stream. pub fn no_state(mut self, no_state: bool) -> Self { self.stream_builder = self.stream_builder.no_state(no_state); @@ -126,10 +142,11 @@ impl ProtocolStreamBuilder { self } - /// Sets the currently known tokens which to be considered during decoding. + /// Sets the initial list of known tokens used for decoding. /// - /// Protocol components containing tokens which are not included in this initial list, or - /// added when applying deltas, will not be decoded. + /// Tokens not in this list (or added later via deltas) won’t be decoded at startup. + /// After initialization, the list is automatically extended with new tokens + /// received from the server, but only for components that pass the filters. pub async fn set_tokens(self, tokens: HashMap) -> Self { self.decoder.set_tokens(tokens).await; self