Skip to content

perf: detectBlockchain runs every non-EVM validator on every input #8

Closed as not planned

Description

@Dhananjay-alt

Every input runs the full Bech32 decode in all five Cosmos validators, plus Base58 decodes for Solana, TRON, Ripple, Cardano and the UTXO chains. Dispatching on the Bech32 HRP, or on the first character for Base58 formats, would skip most of that work. This matters less after the Keccak speed-up (see the Keccak performance issue), but it's still the slowest public API.

Activity

  1. added a commit that references this issue on Nov 21, 2026
    7f35b38
  2. Dhananjay-alt commented on Nov 21, 2026

    @Dhananjay-alt
    ContributorAuthor

    Fixed in #10.

    detectBlockchain now checks a cheap precondition before running each non-EVM validator, so results and their order are unchanged (commit 7f35b38). A new test compares it against exhaustive validation over ~1,000 inputs. Detection is 2.4-10x faster depending on input.

  3. Samarth208P commented on Nov 21, 2026

    @Samarth208P
    Owner

    Confirmed that detection tries all five Cosmos validators even when the prefix rules out four or all five. The EVM aliases already share one validation, and NEAR already has an input filter. I’d defer broader changes until a mixed-input benchmark shows where detection spends its time after #1.

    For a future optimization, please compare the complete ordered result against the current detector, including shared UTXO prefixes, Sui/Aptos overlap, uppercase Bech32 and network filters. Returning every valid candidate is the behavior callers depend on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions