Spark Meridian Implementation

Spec:

Measure

Job definition

Each retrieval made from an SP is a job.

Data model

[
	{
	    "job_id": "abcdef",
	    "peer_id": "<Libp2p Peer ID>",
	    "started_at": "2023-05-01 00:52:57.62+00",
	    "ended_at": "2023-05-01 00:52:58.62+00",
	    "status_code": 200,
	    "signature_chain": "<signature chain>",
	    "num_bytes": 200,
	    "ttfb_ms": 45
	},
  ...
]

Evaluate

Evaluation Stage I: Data preprocessing

Fraud detection function

fraudulenti=verifyUCAN(logLinei)fraudulent_i = verifyUCAN(logLine_i)

The fraud detection function verifies a log’s UCAN signature chain. If the signature chain holds, the log line will be aggregated into Honest logs, otherwise Fraudulent logs.

Data model

{
  "measurement_root": "<merkle root hash>",
  "started_at": "2023-05-01 00:52:57.62+00",
  "ended_at": "2023-05-01 00:52:57.62+00",
  "measurements": {
    "honest": {
      "log_count": 13
    },
    "fraudulent": {
      "log_count": 2000
    }
  }
}

Evaluation Stage II

Evaluation Function

The evaluation function is simply a count of the number of successful requests with valid signature chains a Station has performed. Specifically, for node kk,

yk=j=1mkδkji=1nj=1miδijy_k = \frac {\sum_{j=1}^{m_k} \delta_{kj} } {\sum_{i=1}^n\sum_{j=1}^{m_i} \delta_{ij}}

where δij=1\delta_{ij} = 1 if the log with index jj of node ii is valid and 00 otherwise.

Fraud detection

There is no secondary fraud detection in SPARK.

Roadmap

TODO