-
Notifications
You must be signed in to change notification settings - Fork 8
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
Better Caching System #15
Comments
Another approach: Decentralizationtl;dr: we can't because there's no verification mechanism. This is mostly just a braindump. Another way to solve this would be decentralization. Either using a protocol of our own, or relying on IPFS, or Torrent, anything would do, but we could make a sort of "alliance" of people which rely on the mirror (mostly other Ripple-based osu! private servers) so that we all agree to take part in the decentralization effort by offering space or asking our users. This might seem a bit weird but it would solve quite a few issues:
The Verification ProblemThere is a problem, though: that is, how can you know that a beatmap file is actually the same as the one that osu! gives? The answer right now is: you download the beatmap from the osu website and check the contents. There is no checksum or signature of the .osz file, so if you want to verify it, you'd run again in the original problem, which is lowering requests to osu!. There is indeed a way to verify .osu files, because the osu! API provides a As a note: we could ask on the osu-api issues to add the osz checksum, but as anyone who's been around in the osu! development community for long enough will know, asking something on osu-api is like shouting in a void. So, we have no means of doing proper verification on the file contentsThe reason we need this is that I wouldn't want Ripple to be the single point of contact with osu! - I'd like to have other servers (or even users!) be able to join in and add more beatmaps, either linking to the osu! API to have verification, or even better would be the beatmap file PGP-Signed (or with any other mechanism) by osu!, and even better signed with with the metadata of the beatmap as well. We don't want to trust other servers when they say "Hey, look, this comes from osu!" without any verification. Sure, we could unzip everything and check the osu files and check all the beatmap information we can obtain via the osu! API, but there would be no mechanism to check the song file or any of the other files I listed previously. ThusOP is the best solution, at least until some verification is in place. sigh |
From a gameplay standpoint, it is not necessary to verify:
These can be changed by users however they desire without it affecting the submission process of scores they might get. Therefore, we don't need to verify these. It is completely fine to check for file_hash of each .osu file. |
Yes, I sort of considered that. But it is, however, important. We could even discard everything BUT we'd still need to check the music file. Mixing up music files is really not an option. Besides, if all we could guarantee to be correct were beatmap files, then we could just serve data from osu.ppy.sh/osu/:id, with a random picture and a random mp3 file. |
For future reference and those reading along, I'll leave the counterargument I exposed talking with @ilyt on Discord:
|
We need to update our caching system. This is necessary due to the fact that osu! asked us to make less requests. We thus need to find a better way to cache beatmaps and serve them.
I'm mostly creating this issue to document what the plan is for the Ripple beatmap mirror and how we're going to solve the problem. Also, I want to clear up the process I have in my head, so that I can then proceed to write the code.
Problem
We need to limit requests to osu! as much as possible. At most 10000 requests per month (in a first phase, then we'd need to gradually scale it down to ~2000) for ranked beatmaps, and 600 requests per month for unranked beatmaps. This allows about 20 unranked beatmaps per day, so roughly one every 1hr12m. If possible, we'd also need to gradually scale down the unranked beatmap allowance, as that's very expensive for osu! to do.
Solution
Beatmaps are served on three levels:
CheeseGull will keep all of its discovery code, but will additionally remove stale beatmaps from its own cache and from Wasabi whenever they're discovered to be stale.
The text was updated successfully, but these errors were encountered: