truffle icon indicating copy to clipboard operation
truffle copied to clipboard

Switch truffle's default from "strict" to "eager" until WebSockets is the default communication mode.

Open davidmurdoch opened this issue 2 years ago • 1 comments

Update to Ganache v7 should be faster than v6, but many users don't experience this in many (most?) cases as Truffle's web3 must poll for changes (example: https://github.com/OpenZeppelin/openzeppelin-upgrades/pull/523).

If truffle updates to using WebSockets this polling behavior won't occur. In the meantime, I think we should switch our default mode to "eager" (which is also Ganache v7's default).

There is a way to make Ganache behave as if it was in eager mode for messages sent over HTTP connections only, but doing it is very hacky and gross, as it makes the RPC logic change based on the connection kind. So I'd rather not do this (I actually did do it already, and it really is horrible).

davidmurdoch avatar Apr 28 '22 15:04 davidmurdoch

The issue here is that Web3.js's polling behavior means that with HTTP providers, each transaction in truffle test takes at least one-thousand milliseconds, oh my.

We'll want to reevaluate the need for the strict->eager switch after #4637 resolves

gnidan avatar May 05 '22 17:05 gnidan

Heads up that this is addressed in https://github.com/trufflesuite/truffle/pull/5407 👌

kevinbluer avatar Aug 11 '22 16:08 kevinbluer