-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spark TTFB PoC #208
Comments
Re: We cannot trust any of the individual TTFB values reported by the checker nodes. To make it more difficult for checker nodes to cheat and influence the TTFB indicator we produce, I propose the following implementation for the PoC scope:
@patrickwoodhead You are our math wizard, what do you think? Can you propose a better aggregation function? Inputs: a list of p50 TTFB values, one value per retrieval task (committee) |
Someone can influence the p50 value without controlling more than 50% of the committee. Let's assume the truthful responses are This would make the median TTFB 25 instead of 22. So it has been influenced but it still remains one of the truthful values based on the honest majority assumption. I think this is a good enough starting point. I think the aggregation logic makes sense too. Keeping a value per task seems the right approach and then we can aggregate over tasks to get the values for miners, client, allocators etc. The one thing this doesn't account for is the geolocation of checkers and the time it takes to move the bytes over the internet. We discussed subtracting the round trip time for the TCP handshake from the round trip time for the first byte to understand the server side TTFB? |
SGTM 👍🏻
Yes, we don't account for geolocation and the related latency. IMO, fixing this is beyond the PoC/MVP scope, but geolocation-based latency is definitely something to document and plan to improve soon. For context:
Since we are measuring p50, if our network is distributed uniformly enough that we have a similar number of nodes far away and close to the SP being measured, then I think the p50 value should not be affected too much. I guess this depends on the interpretation. We can say that the PoC version is measuring the worldwide TTFB median. Later, we can improve this to measure "TTFB on the provider's server". But then this creates an attack vector, where the SP sets up a very slow internet connection (e.g. add 500ms latency at the TCP/IP or HTTPS/TLS level). Such retrieval service won't be very useful to users as they have to always wait more than 500ms for the first byte, but Spark will report much lower server-side TTFB, because it subtracts those 500ms. Clearly, more research is needed here. |
Should this be consider a different task that checkers should be rewarded for (e.g. evaluating separately from retrievability but using same reported data) or it should just be part of current evaluation process as additional metric? |
As a guiding principle for this PoC, we want to do as little effort as possible to ship TTFB metric (network-wide and per-miner). My idea was to extract TTFB as an additional step in the current evaluation process. Also, note that Spark checker nodes will not perform any additional task for this; they are already reporting enough data in their current measurements. |
I just want to confirm: Are we discussing the Committee evaluation process? Should they be responsible for calculating the P50 for TTFB or we should calculate P50 from all reported values? |
Let's start with TTFB calculation based on current committee results, even though committees don't necessarily agree on the TTFB value - it's a PoC and we can iterate from there |
See #208 (comment)
A committee is defined as "all measurements submitted for one Retrieval Task that pass fraud detection step", so yes, the TTFB can be extracted from individual committees. See this loop for an example showing how to extract per-committee data: Take also look at
To get per task granularity, we cannot use |
@bajtos the question made sense because committees are built on retrievability, not ttfb. It could make sense to also build them on ttfb values/buckets, for the sake of this metric. Since this is a PoC, that's not necessary. |
Makes sense 👍🏻
Agreed. I also realised that in my comment #208 (comment), I may be adding complexity that's not necessary for this PoC. I would like the result of this PoC to provide the following two metrics:
Per-client and per-allocator TTFB can be added later after we validate there is demand for that. |
@bajtos I guess if that's the case then we should just extend existing metrics (updating daily deals stats)? |
Yes, essentially. Let's add a new table to track TTFB, though. |
We want Spark to measure another service level indicator: time to first byte (TTFB).
The goal of this task is to create a proof-of-concept solution in a few days's time. The focus should be covering the entire vertical, from recording TTFB to showing TTFB in the dashboards and documenting the possible next step based on what's missing in the PoC.
Notes:
startAt
andendAt
.The text was updated successfully, but these errors were encountered: