leapdao / meta

Everything meta and not-fitting to other repos
Creative Commons Attribution Share Alike 4.0 International
9 stars 7 forks source link

create a poor-man's hearbeat monitor #117

Closed johannbarbie closed 4 years ago

johannbarbie commented 5 years ago

Bounty

to effectively monitor the Plasma network, not only the uptime of the validators (hidden from the internet behind sentinel nodes), but also their sync status is relevant. A simple ping does not suffice, hence the following heartbeat collector service is proposed. It will allow to:

POST /heartbeat {
  "operatorContractAddress": "0x1234",
  "slotId": 123, // optional
  "ethBlockHeight": 123,
  "tendermintBlockHeight": 123,
  "timestamp": 123,  // in seconds
  "r": "0x1234",
  "s": "0x1234",
  "v": 27/28
} => HTTP status code

on receiving, signer address recovery will be attempted as follows:

signerAddr = `ecrecover(20bytes addr, 1byte slotId, 4bytes ethHeight, 4bytes tenderHeight, 4bytes time, r, s, v)

if slot given, and signer address does not match signerAddr of slot, HTTP 401 will be returned. signerAddr and receiving timestamp will be added to data. data will be stored in an event store. The following endpoint should allow to retrieve the data for last 24 hours:

GET /status/<operatorContractAddress> => {
  "<signerAddr>": [{
    "receiveTime": 123, // in seconds
    "timestamp": 123,  // in seconds
    "slotId": 123,  // optional
    "ethBlockHeight": 123,
    "tendermintBlockHeight": 123,
  },{..},{..},..
  ],
  "<signerAddr2>": {}
}

Scope

Deliverables

Gain for the project

Roles

bounty gardener: @johannbarbie / 15% bounty worker: name / share bounty reviewer: name / share

johannbarbie commented 4 years ago

closed for https://github.com/leapdao/leap-node/issues/288