graphprotocol / graphprotocol/graph-node

Rules-based system to control index creation and similar attributes

Abierto
#4,325 6 comentarios 3 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Stale
Lenguaje dominante
Rust
Estrellas
3.2k
Forks
1.1k
Merge medio
4 d 1 h
PR fusionados (30 d)
1

Descripción

There are a few things that can be set manually through graphman or directly by manipulating the database that affect how subgraph data is stored, and can help query performance. Those items include:

  • custom indexes (multicolumn indexes or partial indexes)
  • creation of default attribute indexes (a lot of them are never used)
  • account-like optimization
  • statistics target
  • amount of history

An example of what that could like like in YAML form is

# Sketch of what an index definition file could look like. The file will
# contain many entries like this one
- rule: Messari analytics subgraphs
  match:
    # All subgraphs whose name matches this regex will be treated according
    # to these actions
    name: messari/.*
  actions:
    # Keep 10,000 blocks of history
    - history: 10000   
    - entity:
        name: LiquidityPoolSnapshot
        index:
          - on: [pool, timestamp]
    - entity:
        name: LiquidityPool
        # Turn off attribute indexes
        default_indexes: false
        # Set the table to account-like
        account-like: true
        # Increase the statistics target
        stats-target: 300
        # Create some custom indexes
        index:
          # Use a GiST index since we use block_range
          - on: [block_range, timestamp, id]
            method: gist
          # A partial index that only covers blocks after a certain point
          # TODO: since the block number means different things on
          # different networks, we should either use a timespan or let users
          # match on network
          - on: [timestamp, id]
            after: 15664000
          - on: [pool_address, block_range, timestamp]
            method: gist

We need to think more about the way in which operators interact with these rules. Some requirements:

  • changing rules should not require a restart of graph-node
  • it should be possible to list rules, delete them etc.
  • rules should be applied when a subgraph is deployed, but there should also be tooling to apply a new rule to an existing deployment.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Usa graphman y las rutas existentes de manipulación de la base de datos como puntos de entrada; primero determina cómo se representan y aplican las configuraciones actuales de índice, historial y atributos. Define cómo se enumeran, eliminan y recargan las reglas sin reiniciar graph-node, cómo se aplican durante el despliegue y cómo se aplican a los despliegues existentes; se considera terminado cuando estos flujos de trabajo están especificados y cubiertos por pruebas.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
rust
Área
databases
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.