-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Investigate & fix bug surfaced in 5.0.44 #2654
Comments
When investigating locally, I hit this type of error:
|
In 5.0.44 we bumped Web3.js to 1.2.2 (#2558), so there could be something going on with the "backported" typings, or the fact that the Going to downgrade priority since this appears to be more of a connectivity issue. |
We received this error as well in CI for https://github.com/Synthetixio/synthetix when upgrading truffle from 5.0.43 to 50.0.44, and we're on web3 1.2.2 and ganache 6.7.0. FWIW I also tried upgrading web3 1.2.4 and ganache-cli to 6.8.1-beta.0 (which uses ganache-core |
@CruzMolina I think I have a repro (or a guess about the problem).
const MetaCoin = artifacts.require("MetaCoin");
const util = require('util');
contract('MetaCoin', (accounts) => {
it('should put 10000 MetaCoin in the first account', async () => {
const metaCoinInstance = await MetaCoin.deployed();
const balance = await metaCoinInstance.getBalance.call(accounts[0]);
console.log(
"web3.currentProvider --> " +
util.inspect(web3.currentProvider)
);
console.log(
"Contract.web3 (web3Shim) --> " +
util.inspect(MetaCoin.web3.currentProvider)
);
console.log(
"instance.contract.currentProvider (also web3Shim?)--> " +
util.inspect(metaCoinInstance.contract.currentProvider)
);
assert.equal(balance.valueOf(), 10000, "10000 wasn't in the first account");
});
}) If you compare outputs for Truffle v5.0.43 vs v5.1.2, you'll see that the Truffle 5.1.2: web3.currentProvider {
host: 'http://127.0.0.1:7545/',
httpAgent:
Agent {...},
withCredentials: false,
timeout: 0,
headers: undefined,
connected: false, // <-- Should be true?
send: [Function],
_alreadyWrapped: true
} Truffle 5.0.43: web3.currentProvider {
host: 'http://127.0.0.1:7545/',
httpAgent:
Agent {...},
timeout: 0,
headers: undefined,
connected: true, // True!
send: [Function],
_alreadyWrapped: true
} Both Synthetix and JoinColony use this injected web3.currentProvider instance in their test helpers |
@CruzMolina Just circling back here, for a quick look. In case the note above isn't clear - believe the bug is at Truffle, possibly where Web3 is instantiated in core/test. #2653 looks related and might provide a simple test case as well. But if you discover the problem is the dependency, please just lmk and will try to get it fixed. |
So far #2653 looks somewhat related but a different issue altogether. |
Hmm, I'm not exactly sure what's going on here. Is this a timeout issue or an issue with using web3's low-level rpc request method It doesn't seem like we should be using the Furthermore, the |
It's looking like downgrading to web3 |
@CruzMolina I will open a PR on latest with a reproduction / test case. If it passes then downgrading Web3 makes sense. If it doesn't, then downgrading Web3 won't fix the problem. |
Ok yes, I'm wrong about currentProvider (unhappily because this problem seems worryingly non-deterministic). Will look back over on the Web3 side... Colony's tests are:
|
@cgewecke Thanks for giving support here to the Truffle team! The mentioned improvement of the transaction confirmations could probably be the thing that does give some problems in the Colony test suite but I'm not sure. |
Not sure if this helps, but for https://github.com/sablierhq/sablier, downgrading and pinning web3@1.2.1 alone was not sufficient. I also had to also downgrade and pin truffle to 5.0.37. |
Hey @PaulRBerg, I see a failing job using 5.1.3. Are there logs available for any version between 5.0.37 and 5.0.44? |
I think the latest CircleCI workflow finished right after you replied: https://circleci.com/workflow-run/00101565-3959-48d0-9e9e-b587c768c9e8
Unfortunately, no. I left the contracts untouched for a while. |
Based on the diff, it looks like the unpinned truffle deps were pulling in 5.1.3. Would love to know if this same issue was present between 5.0.37 & 5.0.44. |
There you go, I created a branch for you where truffle is pinned to 4.0.40. https://circleci.com/workflow-run/6bad4d9a-c04c-4820-990e-3f69cca867f3 |
@PaulRBerg , not quite sure what's going on with your workflow. Seems like it is either an unrelated issue or a different one. |
Greenkeeper caught a bug released in 5.0.44 over in Colony's repo: JoinColony/colonyNetwork#734.
Appears to be related toInterfaceAdapter
changes, but it could be something else. Seems like this is relatively high priority.EDIT: So far it seems like this is actually a Web3.js issue that appeared in the past. See #1504, #1461, & web3/web3.js#2105.
The text was updated successfully, but these errors were encountered: