Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
23 changes: 20 additions & 3 deletions src/evm/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand All @@ -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<Bytes, Token>) -> Self {
self.decoder.set_tokens(tokens).await;
self
Expand Down
Loading