api3dao / airseeker-v1

Airseeker maintains beacons using signed data from an Airnode HTTP Signed Data Gateway
MIT License
2 stars 3 forks source link

Prepare config format & validation for `triggers.beaconSetUpdates` section #164

Closed amarthadan closed 2 years ago

amarthadan commented 2 years ago

I presume this will be similar to the triggers.beaconUpdates section, grouped based on the chain and sponsor. Deviation threshold and heartbeat interval will be beacon set bound. The list of beacons included in the set is available in the beaconSets field. I would imagine something like:

"beaconSetUpdates": {
  "1": {
    "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC": {
      "beaconSets": [
        {
          "beaconSetId": "0x924b5d4cb3ec6366ae4302a1ca6aec035594ea3ea48a102d160b50b0c43ebfb5",
          "deviationThreshold": 0.1,
          "heartbeatInterval": 86400
        }
      ],
      "updateInterval": 30
    }
  },
  "3": {
    "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC": {
      "beaconSets": [
        {
          "beaconSetId": "0x924b5d4cb3ec6366ae4302a1ca6aec035594ea3ea48a102d160b50b0c43ebfb5",
          "deviationThreshold": 0.2,
          "heartbeatInterval": 86400
        }
      ],
      "updateInterval": 30
    }
  }
}

In the validation, we need to make sure that the beacon set present in this section has its counterpart in the beaconSets section.

bbenligiray commented 2 years ago

I don't think beaconIds is needed, that information is already present in https://github.com/API3-CTT/airseeker/issues/163

amarthadan commented 2 years ago

Issue description updated based on the Slack discussion.