Skip to content

feat: Support multiple winning solutions by a single solver #3350

@squadgazzz

Description

@squadgazzz

Problem

The current DB schema doesn't support multiple solutions by an individual solver, which is required in the world of combinatorial auctions. The diagram below shows the current relations between the main components of the solver competition. The intention is to provide a reference from the settlement TX hash to the solution UID instead of the current solver→TX hash relation.

classDiagram

%% === Classes ===

    class Auction {
        +id
        +score
    }

    class Solution {
        +uid
        +isWinner
        +score
    }

    class Settlement {
        +hash
    }

    class Solver {
        +refScore
    }

%% === Relationships ===

    Auction "1" --> "n" Solution
    Solution "n" --> "1" Solver : refScore
    Solver "1" --> "1" Settlement : ❌ currently (to remove)
    Solution "1" --> "1" Settlement : ✅ intended

%% === Notes ===
%% - Solver → Settlement is a current 1-to-1 link, to be removed
%% - New 1-to-1 link from Solution → TransactionSettlement is intended
%% - Solver.refScore is recalculated as if not participating
Loading

Additional context

Acceptance criteria

  • Add solution_uid column to the settlements table.
  • Add reference_scores table, which should support multiple winning solutions and eventually replace the settlement_scores table.
  • Implement the reference score calculation for multiple winning solutions.
  • Drop settlement_observations and reference_scores tables, since they become obsolete.
  • (Optional) The two tables above were part of the CIP-20. Check if anything else can be cleaned up.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions