Skip to content
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

Geth >= 1.8.3 can't deploy large contracts over websockets #16846

Closed
cgewecke opened this issue May 30, 2018 · 10 comments · Fixed by #19866
Closed

Geth >= 1.8.3 can't deploy large contracts over websockets #16846

cgewecke opened this issue May 30, 2018 · 10 comments · Fixed by #19866
Assignees
Labels

Comments

@cgewecke
Copy link

System information

Geth version: >= 1.8.3
OS & Version: OSX
Commit hash : (if develop)

Expected behaviour

Should deploy contracts of any (legal) size over websockets.

Actual behaviour

If the data sent has a length > 16416 the websocket connection fails and closes - all subsequent calls receive the error message:

Error: CONNECTION ERROR: Couldn't connect to node on WS.

Steps to reproduce the behaviour

Deploy a large contract over websockets to Geth 1.8.2 (Succeeds)
Deploy a large contract over websockets to Geth >= 1.8.3. (Errors)

Example of a contract that fails can be found at ethpm/escape-truffle where we are trying to run tests in CI using geth --dev but larger deployments like this one which consumes +/- 3 million gas trigger the error.

This problem is also being tracked at web3 here because web3 crashes on the geth response.

@cz3kit discovered the data size limit mentioned above and may have more reproduction info.

@jacekv
Copy link

jacekv commented May 30, 2018

I deployed the following contract using geth 1.8.9
contract Test{ string public test; function setString(string _msg) public { test = msg; } }
When I call the function setString with up to 8009 times 'a', everything is fine. But as soon I send 8010 'a', geth gives the following message:
read error unexpected EOF

As soon I repeat the same test with geth 1.8.2, all is fine.

@ekryski
Copy link

ekryski commented Jun 15, 2018

And I don't think this is necessarily even to do with large contracts solely. I think there have been regressions in some of the events when websocket code was rewritten. cc/ @karalabe any insight into this? Any way we can help to fix?

@ekryski
Copy link

ekryski commented Jun 19, 2018

We're seeing websocket connections constantly getting killed. Seemingly at random. My hunch is that it is related to too large a frame size for web3. Any insight here would be great.

@mahjiang
Copy link

+1

@djvs
Copy link

djvs commented Sep 18, 2018

Likely related - trying to send a 28kb whisper message over WS is giving:

Error: Failed to send direct message: Error: CONNECTION ERROR: Couldn't connect to node on WS.

The max message size of course being at the standard 1MB.

@djvs
Copy link

djvs commented Sep 20, 2018

Some kind of issue with socket buffers overflowing? A hard-set message limit?

Hope this gets fixed soon, it's gonna require some difficult workarounds if not.

@ekryski
Copy link

ekryski commented Sep 21, 2018

So in web3 a patch came in that now allows you to pass config options to the websocket provider but it's for NodeJS only. Won't work in the browser. web3/web3.js#1631.

As a result if this is where you are affected you can increase the frame buffer size as a temporary workaround like this: web3/web3.js#1217 (comment).

@jrainville
Copy link

We got the same issue (embarklabs/embark#1028).

We currently use web3 beta 34 since 36 has issues with deploying some contracts, so the current workaround for us is to either use RPC (yuck), use Ganache-cli or use Parity.

@eggplantzzz
Copy link

eggplantzzz commented Mar 18, 2019

I get this issue while using geth 1.8.17-stable, migrating with Truffle and a web3@1.0.0-beta.37 WebsocketProvider. I can successfully deploy a contract with bytecode that is 16216 characters (including "0x") long. If you add one more character I get the above behavior. Does anyone have any insight into this?

More specifically I think the call that was failing was a web3Contract.estimateGas call.

@eggplantzzz
Copy link

Truffle issue #1699 references this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants