Skip to content

feat: remove blacklist from fynd#128

Open
Troshchk wants to merge 9 commits intomainfrom
kt/ENG-5580-add-blacklist-filter
Open

feat: remove blacklist from fynd#128
Troshchk wants to merge 9 commits intomainfrom
kt/ENG-5580-add-blacklist-filter

Conversation

@Troshchk
Copy link
Copy Markdown
Contributor

@Troshchk Troshchk commented Mar 23, 2026

  • Move blocklist filtering upstream. Previously, blocklisted components were received from the Tycho stream and filtered out manually in TychoFeed::handle_tycho_message. Now the blocklist is passed directly to ComponentFilter when subscribing, so blocklisted components are never sent to us.
  • Rename blacklist → blocklist across config files, CLI flags, builder methods, and types.
  • Remove blocklist unit tests from TychoFeed since the filtering no longer happens at that layer.

The blocklist filter itself lives in tycho-indexer, but blocklist.toml stays in fynd because it defines which pools fynd user considers problematic.

@Troshchk Troshchk changed the title feat: remove blacklist from fynd-rpc feat: remove blacklist from fynd Mar 23, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 23, 2026

Breaking API Changes (Intentional)

Breaking API changes detected and declared in the PR title.
Ensure the minor version is bumped before merging (breaking changes on 0.x.x bump the minor).

semver-checks output
Checking fynd-core v0.45.0 -> v0.45.0 (no change; assume minor)
     Checked [   0.633s] 196 checks: 195 pass, 1 fail, 0 warn, 49 skip

--- failure inherent_method_missing: pub method removed or renamed ---

Description:
A publicly-visible method or associated fn is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/inherent_method_missing.ron

Failed in:
  FyndBuilder::blacklisted_components, previously in file fynd-core/src/solver.rs:384
  FyndBuilder::blacklisted_components, previously in file fynd-core/src/solver.rs:384

     Summary semver requires new major version: 1 major and 0 minor checks failed
    Finished [   0.850s] fynd-core
    Checking fynd-rpc v0.45.0 -> v0.45.0 (no change; assume minor)
     Checked [   0.082s] 196 checks: 194 pass, 2 fail, 0 warn, 49 skip

--- failure inherent_method_missing: pub method removed or renamed ---

Description:
A publicly-visible method or associated fn is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/inherent_method_missing.ron

Failed in:
  FyndRPCBuilder::blacklist, previously in file fynd-rpc/src/builder.rs:142

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/struct_missing.ron

Failed in:
  struct fynd_rpc::config::BlacklistConfig, previously in file fynd-rpc/src/config.rs:72

     Summary semver requires new major version: 2 major and 0 minor checks failed
    Finished [   0.135s] fynd-rpc
    Checking fynd-rpc-types v0.45.0 -> v0.45.0 (no change; assume minor)
     Checked [   0.130s] 196 checks: 196 pass, 49 skip
     Summary no semver update required
    Finished [   0.260s] fynd-rpc-types
    Checking fynd-client v0.45.0 -> v0.45.0 (no change; assume minor)
     Checked [   0.150s] 196 checks: 196 pass, 49 skip
     Summary no semver update required
    Finished [   0.310s] fynd-client

@Troshchk Troshchk force-pushed the kt/ENG-5580-add-blacklist-filter branch 3 times, most recently from 3f16269 to 3e39b64 Compare March 25, 2026 10:29
Copy link
Copy Markdown
Contributor

@louise-poole louise-poole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This likely can be simplified more if the tycho-simulation is updated to take a config file directly. So far looks good though.

## Blocklist config

Exclude specific components from routing, useful for components with known simulation issues (e.g., [rebasing tokens on UniswapV3 pools](https://docs.uniswap.org/concepts/protocol/integration-issues)):
By default, Fynd loads `blocklist.toml` from the working directory. The shipped default excludes components with known simulation issues (e.g., [rebasing tokens on UniswapV3 pools](https://docs.uniswap.org/concepts/protocol/integration-issues)). Override with `--blocklist-config`:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the default blocklist file should move to the tycho-simulation repo? As the reason it's blocklisted is because of simulation issues and not Fynd-specific issues.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to always blocklist the pools defined here? even for solver users (not Fynd)? Or are these issues only for Fynd? I think I'm missing a bit of context here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have asked Thales and he mentioned, that the most common use cases are:

  • this pool is faulty, so we want to to quickly remove this pool from the calculations
  • user wants to avoid going through this pool - maybe they give fees to someone they don’t like, or this pool has a security flaw or doesn’t comply to any user’s internal compliance

@Troshchk Troshchk force-pushed the kt/ENG-5580-add-blacklist-filter branch from d99168e to 471ff7b Compare March 30, 2026 10:37
Copy link
Copy Markdown
Collaborator

@dianacarvalho1 dianacarvalho1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm quite confused 😬 Did you also have a look at this PR #166 ?

self.config.min_tvl / self.config.tvl_buffer_ratio,
self.config.min_tvl,
)
.blocklist(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it blocklist_components(..)? here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is blocklist from ComponentFilter from here

Comment on lines +135 to +137
self.config
.blocklisted_components
.clone(),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and shouldn't it take a file path? 😵‍💫 I'm quite confused tbh

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This add components to blocklist in the ComponentFilter and it takes an iterator of the component ids.
If it makes it easier to follow, I can add components to blocklist on the ProtocolStreamBuilder level, it is basically the same.

/// Replaces the set of component addresses that are excluded from routing.
pub fn blacklisted_components(mut self, components: HashSet<String>) -> Self {
self.blacklisted_components = components;
/// Sets component IDs to exclude from the Tycho stream.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we keeping this here? Can you please explain the motivation in the PR description?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewing this is quite confusing.. we accept a file in one place and read it and then in another place we accept already a hashset? I'm really not following 😕 Can you explain please?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocklisted_components() on FyndBuilder is the builder setter that lets callers configure which components to exclude. In build(), the value is passed to TychoFeedConfig (here), which forwards it to TychoFeed and that's where the actual filtering happens.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aaaahhh ok then AG! I was just very confused when reviewing 😵‍💫

@Troshchk
Copy link
Copy Markdown
Contributor Author

I'm quite confused 😬 Did you also have a look at this PR #166 ?

I did see it and as far as I understand it was an adhoc change, that would be replaced with a change in this PR

Copy link
Copy Markdown
Collaborator

@dianacarvalho1 dianacarvalho1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! let's just not merge this before we merge all the other related PRs and change the cargo.toml here!

@Troshchk Troshchk force-pushed the kt/ENG-5580-add-blacklist-filter branch from eeeb226 to d5b93c6 Compare April 1, 2026 13:18
@Troshchk
Copy link
Copy Markdown
Contributor Author

Troshchk commented Apr 1, 2026

Since we now provide a blocklist file, do we still need builtin_default()?
Also, should tycho-simulation follow the same behavior for blocklist?
@kayibal tagging you here, since you added it

@Troshchk Troshchk force-pushed the kt/ENG-5580-add-blacklist-filter branch from ebe8789 to 6418f36 Compare April 1, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants