torproject / torspec Public
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
Authorities expose bandwidth file used in votes #21
Conversation
In a similar ways as authorities expose the votes for the next consensus. This way it can be archived by CollectTor
Hi, please move the extra text, and make it more detailed.
Think about how you are going to implement the spec. Don't make it too hard to implement!
Please also check with metrics to see what they need for collector.
dir-spec.txt
Outdated
| @@ -1588,6 +1588,14 @@ | |||
| and sending it in an HTTP POST request to each other authority at the URL | |||
| http://<hostname>/tor/post/vote | |||
|
|
|||
| If an authority has used a Bandwidth List file to generate this vote it | |||
Please don't put the bandwidth file URL in the middle of the vote section. It makes the rest of the vote section confusing.
You can put it before section 3.4.1., or in its own subsection 3.4.3.
i better move all the paragraph (not just the URL), right?
dir-spec.txt
Outdated
| http://<hostname>/tor/status-vote/next/bandwidth.z | ||
|
|
||
| If an authority makes this file available, its headers MUST correspond to | ||
| the ones in the "bandwidth-file-headers" item in the vote document. |
Don't say "it's headers MUST correspond to the ones in the…vote document", because that's confusing.
It could mean that tor reads the headers from the vote, which is not what you want.
Instead, say "it MUST be the file used to create the vote".
The bandwidth generator can overwrite the bandwidth file at any time.
How are you going to store the old bandwidth file so the authority can serve it with the old vote?
You could say:
"If an authority makes this file available, it MAY be the bandwidth file used to create the vote, or the bandwidth file currently on disk."
Which vote document?
"the vote document available at http:///tor/status-vote/next/authority.z"?
Please also reference the bandwidth file spec, so people know the format of the file.
Or you can say:
"If an authority makes this file available, it MUST be the bandwidth file used to create the vote."
Then tor MUST make a copy of the file before closing it.
(Tor and sbws will need to be careful of race conditions when writing the file.)
Please also say the version of Tor that introduced this feature. Looks like it will be 0.3.5.
I opened a sbws ticket to avoid the race condition:
https://trac.torproject.org/projects/tor/ticket/26692
The bandwidth generator can overwrite the bandwidth file at any time.
Torflow archives the file renaming it with a timestamp and putting it in a dir, but scp inside cron.sh sends the file without timestamp.
This is an easy change so that it sends the file with the timestamp.
In the DirAuth there should be a cron or ssh command that create a link to the latest.
If Torflow runs in the same system as the DirAuth then it could just read the link locally.
sbws already archives files with timestamp, then creates a link to the latest.
How are you going to store the old bandwidth file so the authority can serve it with the old vote?
i don't understand this question
"If an authority makes this file available, it MAY be the bandwidth file used to create the vote, or the bandwidth file currently on disk."
I like more the idea of trying to ensure that the file used to create the vote is the one being served.
"If an authority makes this file available, it MUST be the bandwidth file used to create the vote."
Hmm, maybe it's not needed at all to say this sentence, it's basically the same as the 1st one.
Then tor MUST make a copy of the file before closing it.
This would be a solution, while is not done in the same path where the generator puts the file.
(Tor and sbws will need to be careful of race conditions when writing the file.)
Hmm, Tor doesn't need to write to that file, only read, right?.
|
See Also: https://marc.info/?l=tor-dev&m=151605509930409&w=2 tor-dev thread "Proposal: Expose raw bwauth votes" |
|
@tomrittervg, it looks like we never added your proposal to: @juga0, please add the proposal in another commit in this branch. |
|
Hmm, we should update the proposal so it matches the spec change. |
|
Now the name of this branch doesn't match the new ticket for the spec https://trac.torproject.org/projects/tor/ticket/26694. |
|
@tomrittervg thanks for pointing at the proposal, didn't know it exists.
|
The archived file might be written atomically, if cp writes atomically: But the file that Tor reads is not written atomically:
We are not fixing bugs in torflow. We will never get sbws done if we stop to fix bugs in torflow. We can't guarantee that authority operators will implement file transfers atomically. Instead, we should remind authority operators not to schedule bandwidth file generation or transfers during voting times:
Ok, that is another way to implement atomic reads and writes. I closed trac ticket #26692.
Does metrics need to download the bandwidth file that matches the vote? How can they reliably download the bandwidth file that matches the vote, if the bandwidth generator can overwrite the bandwidth file at any time? Tor must copy the file.
I don't understand what you mean by "while is not done in the same path where the generator puts the file."
Yes. See my answer above about trac ticket #26702.
The first sentence in you patch talks about files and votes with matching headers.
Please work on the current branch and pull request. When the branch is ready to merge, put the branch name on the trac ticket again.
No, only large changes.
Yes, because the proposal has more information than the spec change.
No, please update the proposal to match the spec. There is a standard format for dir-spec URLs:
We should match this format. In your dir-spec patch, please modify the "current" section as well:
No, you should update the proposal, get it reviewed, then send it to tor-dev. Here is a list of the other changes I asked for, so I don't need to search all the comments:
|
Proposal sent to tor-dev maling list by Tom Ritter. (https://lists.torproject.org/pipermail/tor-dev/2017-December/012677.html)
|
I think i've made all the changes suggested in dir-spec. |
|
Thanks for your changes. I made some extra changes in my torspec repository, and put them in a different pull request: You can review there, or push my commits to your branch, and review here.
I added bandwidth.z to the current section.
I made some edits to the proposal, please review.
I made this change.
They don't need to match. Proposals often have extra detail, or leave details to the spec.
No, I solved #26702 with a tor man page update. |
|
This was obsoleted by #26. |
In a similar ways as authorities expose the votes for the next
consensus.
This way it can be archived by CollectTor
The text was updated successfully, but these errors were encountered: