jsdelivr / globalping

A global network of probes to run network tests like ping, traceroute and DNS resolve
https://www.jsdelivr.com/globalping
248 stars 31 forks source link

Adopted probes should generate credits #452

Closed MartinKolarik closed 9 months ago

MartinKolarik commented 10 months ago

Similar to how recurrent sponsorships add credits over time, adopted probes should generate credits for their owners. To be decided:

jimaek commented 10 months ago

Once per day makes sense, with some logic where it has to stay up at least 20 hours during that day to be counted.

alexey-yarmosh commented 9 months ago

I am thinking about having a cron to call /probes every 10 mins with a 5 min deviation. If probe was found in the response increment new onlineTimes field by 1. If at the end of a day onlineTimes > 20 * 6, assign credits. Then set onlineTimes to 0. Time intervals are configurable.

MartinKolarik commented 9 months ago

Seems reasonable.

jimaek commented 9 months ago

Btw we will need to add anti abuse logic at some point, but I'm guessing it won't impact the current implemention and we can come back to it later?

alexey-yarmosh commented 9 months ago

What abuse scenario do you mean?

jimaek commented 9 months ago

Credits farming, e.g. starting 500 probes with some super cheap hosting provider.

I would add rules like limiting the number of probes from the same ASN and same ASN+same city.

Maybe also a global probe limit per account

alexey-yarmosh commented 9 months ago

Ok, current logic is extensible enough to support that in future.

alexey-yarmosh commented 9 months ago

@jimaek should we assign credits for probes in any status or only in "ready"?

jimaek commented 9 months ago

Only ready, the probe should be active and process measurements to get credits