trufflesuite / truffle

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
14.02k stars 2.32k forks source link

Truffle does not properly look up EPM packages #378

Closed skmgoldin closed 7 years ago

skmgoldin commented 7 years ago

Issue

An EPM package which is ostensibly available, https://www.ethpm.com/registry/packages/15, and for which the listed IPFS hash resolves, seems not to be looked-up correctly by Truffle when using truffle install.

Steps to Reproduce

truffle install tokens produces the error message Error: Could not find object at hash 'QmSMdCxaH1H5TfyjKVtiPKnFabkQByciTBG6FTCAiCufX7' in 5000ms.

The hash QmSMdCxaH1H5TfyjKVtiPKnFabkQByciTBG6FTCAiCufX7 does not match the hash QmTixZiE9HBpgcB5UEncmZbu7M3grPUhsMCzEMhdJAKYV5 indexed in the package registry.

Expected Behavior

Truffle should try to resolve the hash QmTixZiE9HBpgcB5UEncmZbu7M3grPUhsMCzEMhdJAKYV5, which does contain a lockfile (at the time of this bug submission).

Actual Results

Truffle tries to resolve the hash QmSMdCxaH1H5TfyjKVtiPKnFabkQByciTBG6FTCAiCufX7, which is empty.

Environment

tcoulter commented 7 years ago

So it looks like HumanStandardTokenFactory.sol is missing from IPFS.

Source: /Users/tim/Documents/workspace/Consensys/test3/installed_contracts/tokens/contracts/HumanStandardTokenFactory.sol 
URI ipfs://QmSMdCxaH1H5TfyjKVtiPKnFabkQByciTBG6FTCAiCufX7

The easiest way to fix this is to publish a new version of tokens to the registry. If Ropsten is dead and won’t let you do that, then the only way to fix it is to upload HumanStandardTokenFactory.sol back to IPFS in the exact state it was in when you originally published it (so it receives the same hash).

Unfortunately this isn't a bug in Truffle so much as it is an inherent problem with IPFS. IPFS needs to Swarmify or Swarm needs to get done. :(

Going to close this for now.

skmgoldin commented 7 years ago

Thanks amigo!

maraoz commented 7 years ago

We're also having these problems with OpenZeppelin: https://github.com/OpenZeppelin/zeppelin-solidity/issues/209 There have also been reports on slack.

Is there anything we can do to prevent this from happening? We might have to move back to npm if this keeps being an issue :(

cc: @frangio

tcoulter commented 7 years ago

cc @pipermerriam

Once Ropsten got attacked, EthPM development slowed down a bit. We need to add extra support to IPFS since IPFS doesn't guarantee data persistence.

@maraoz Can you guys rerelease a version of Zeppelin on EthPM to refresh the data stored on IPFS?

ProphetDaniel commented 7 years ago

Same issue for us both Windows and Linux when trying to install zeppelin to a Truffle project.

maraoz commented 7 years ago

We just published a new version (v1.0.5) to ethpm. Let's see if this solves the problems @tcoulter.

maraoz commented 7 years ago

It didn't. We'll have to revert to npm :(

tcoulter commented 7 years ago

@maraoz Thanks for the update. I will take a look at this tomorrow.

On Wed, May 10, 2017, 2:33 PM Manuel Aráoz notifications@github.com wrote:

It didn't. We'll have to revert to npm :(

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/trufflesuite/truffle/issues/378#issuecomment-300619210, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFp1SWvESR0ggwPzOozjk8mWhSDQi6Tks5r4i02gaJpZM4MkZcI .

tcoulter commented 7 years ago

I closed this? Reopening.

ProphetDaniel commented 7 years ago

I'm very worried with the openZeppelin community without the lastest version working right now. So I think @maraoz we should switch to npm right away just to make sure there won't be unnecessary hurdles for the underlying community. In the meanwhile @tcoulter will be investigating and solving the issue as soon as possible if that can be solved within truffle or maybe we will have to escalate the issue to IPFS folks in the case that's their problem impacting on this issue.

SirensOfTitan commented 7 years ago

What's the swarm timeline for development use cases like this? This is a pretty basic use case that undoubtedly should be a good experience (installing standards-compliant token library) so that new developers don't shy away from the platform.

Happy to lend some SWE time if you guys direct me to what I can do to help! :)

tcoulter commented 7 years ago

@ProphetDaniel Regarding Zeppelin, this issue has been fixed in Truffle 3.2.3 (latest version of Truffle as of this writing). For the tokens package, however, it looks like data is missing. @skmgoldin, if you want to release a new version of the tokens package, it should fix the issue.

In general though, there was data loss at the IPFS level, and I can't speak to why (I don't have enough information). At its heart, however, there's no guarantees that any data will remain on the network, so data loss is bound to happen again. IPFS is like bittorrent: if people stop seeding the data, it's gone. IPFS's Filecoin needs to get here fast, or SWARM needs to finish development.

@SirensOfTitan There's no work that can be done as of now, unless you want to somehow speed up SWARM development.

tcoulter commented 7 years ago

@SirensOfTitan Meant to say: Appreciate the offer though, and if something comes up I'll let you know.

skmgoldin commented 7 years ago

Hey y'all I'm going to re-upload the tokens contracts tomorrow! If I don't mess it up they should be available under the same name. I'll comment here again with an update.

tcoulter commented 7 years ago

@skmgoldin If you run into any trouble tomorrow please contact me directly and we'll work through it. Would love to fix the issues as you find them for quick turnaround.