Skip to content

Add token_network_settings and channel_settings tables to database #5069

@lullis

Description

@lullis

As part of the #5011, we should be able to store user-defined values for some of the settings parameters. Non-exhaustive list of examples:

  • FeeSchedule per Channel
  • FeeSchedule per TokenNetwork
  • List of Matrix Services that the node should try to connect
  • Minimum REI Balance for node operation
  • Maximum Gas Price/Gas Limit
  • Maximum fee to pay to PFS
  • Transport Parameters

Specification

Some of these settings are related to the operation of the node and we can use the already-existing settings table on sqlite, which currently only stores the version record. There are however some parameters which can and should be specified per token network and/or channel, with the value specificed on settings.py only to be used as a default. So the proposal is to create the following tables:

CREATE TABLE token_network_settings (
    chain_id int NOT NULL,
    token_network_id VARCHAR[32] NOT NULL,
    name VARCHAR[24],
    value TEXT,
   UNIQUE(chain_id, token_network_id, name)
);

Likewise for per-channel settings:

CREATE TABLE token_network_settings (
    chain_id int NOT NULL,
    token_network_id VARCHAR[32] NOT NULL,
    channel_id VARCHAR[32] NOT NULL,
    name VARCHAR[24],
    value TEXT,
   UNIQUE(chain_id, token_network_id, chain_id, name)
);

Backwards Compatibility

Previous versions should not be affected by these new tables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions