As I mentioned on core dev call #18, we’re having issues with IPFS storage for SNT utility features. Chu’s had trouble getting Tribute to Talk to work in 90% of cases.
I learned from @barry that he’s also having issues publishing to IPFS, so am creating this thread to track how we fix this.
Problem
The IPFS gateway we use is unreliable.* Any feature for which we’re storing data on IPFS is affected—Stickers, Tribute to Talk and the liquid funding DApp.
*Could be something to do with Infura API blocking certain IPs?
Potential solutions
Host our own IPFS gateway
Risks are that anyone could upload a large file and bring this down. Accessing data via Cloudflare may lead to slow load times. And also IPFS’ hashing algorithm is not deterministic.
Use Swarm feeds instead
In their latest release, Swarm has fixed bugs that made it an unviable option in the past. @yenda and @jarradhope will be with the team in Madrid for their hackathon this weekend and can test/ask questions.
Current plan
The TtT team is going to experiment with Swarm further (@yenda) and check in with @jakubgs about the set-up of our own IPFS gateway—this sounds like ongoing work. TtT team will discuss both options again after the Swarm hackathon this weekend.
It would say it should be similar to mailservers in terms of numbers of requests, except they will be much smaller. However we might also or instead want to deploy a swarm gateway with our own swarm cluster.
It should only need to scale if we expect to upload a lot of content frequently to the nodes. In theory content that is frequently called will start to cache around the network on other IPFS nodes and will even reduce demand on our nodes as other nodes that are closer to requesting clients will deliver the content.
I also want to point out that IPFS multihashing function is non-deterministic depending on the DAG generation when chunking. So if we verify content downloaded (and we should [by running the hashing function locally and seeing if it matches with the query, combined with filesize in manifest]) then we’ll get false negatives.
This for me is a another strike against ipfs as you can’t really be sure what your asking for is what your getting, which to me almost defeats the point, will be asking how swarm tackles this (I suspect it probably isn’t an issue because not many implementations, but I’m curious if it is well specified)
The content is garbage collected by removing the chunks that have not been requested for the longest.
For feeds it should be safe because they would be checked everytime the user logs in or someone checks the user profile, and even more if we use it for things like public profile in public chats.
Let me verify, for example the container on node-01.gc-us-central1-a.swarm.test was created 13 days ago, and is:
$ docker run --rm -e PASSWORD=123qwe ethdevops/swarm:latest --version
...
Running Swarm:
Swarm Version: 0.3.5-stable Git Commit: 8bbe72075 Go Version: go1.11.1 OS: linux
localhost swarm version 0.3.5-8bbe7207
Nope, looks like latest points at 0.3.5: Docker
There is an explicit v0.4.0 tag, but using it would stop automatic updates.
I guess we could use edge if we want to be edgy.
Oh wait, let me retract that. I verified this on node-01.do-ams3.swarm.testand it’s 4.0 there:
[email protected]:~ % d exec -it swarm-node /swarm --version
swarm version 0.4.0-c3b317a4
That one was updated 22 hours ago. It appears the GC host in the swarm has run out of space, despite having --store.size specified, which probably blocked the container updated. I’ll fix that.
@rachel Do we have a Github issue for the IPFS problems? I can’t find a simple problem description or debugging trail for what we tried, if it is a specific gateway problem or IPFS general problem or whatever.
Could someone on go-team push the timeout for the feed chunk exploration to 5 sec and make a docker image that we can use for our swarm cluster? @igor
I discussed with the person that developed that algorithm and the current 1 sec is arbitrary and has an error rate that is too high
Update on the situation regarding Tribute to Talk:
To ensure stability for the MVP, we’ll revert back to using the “dumb” version of this feature and storing tribute amount in the contract (at some cost to user: Tx required for setting + privacy sacrifice).
Eric’s feedback on using Swarm for a public profile proof of concept is here.
We agreed it’s best to experiment with allowing users to store ‘lesser’ elements of their public profiles on Swarm, such as their photo. Pending how that goes, we could then start incorporating SNT utility features such as ENS name and TtT setting in the public profile as well.
@jakubgs this means that we won’t need the IPFS gateway for this particular feature. From my POV you can pause work on that, but as IPFS issues have also affected @barry and @cryptowanderer and will probably impact sticker market as well, I don’t believe it’s a wasted effort. Following up on how we’ll ensure reliability of stickers in #status-core-ui.