Skip to content

Pass scoring params through the router #2189

Closed
@TheBlueMatt

Description

@TheBlueMatt

Currently we require a "stateless" scorer, one which returns an absolute score with no context besides the channel and liquidity. This is somewhat annoying, though, for folks who want to have different scorers at different times - they'll have to create two separate scorers and pass them in. You can see this in the API for ProbabilisticScorer, which requires you pass the params at construction-time. Instead, we should parametrize the scorer with an associated "parameter" type, which is then passed to the router function itself, and allows passing a different, eg, ProbabilisticScorerParams per route-finding call.

Should be pretty straightforward to do - just add a assicated type to the Score trait, then add that as an argument to the score-fetching method and make it an argument to the get_/find_ route function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions