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

Error: oversized data #1739

Closed
basilji opened this issue Jun 28, 2018 · 8 comments
Closed

Error: oversized data #1739

basilji opened this issue Jun 28, 2018 · 8 comments
Assignees
Labels
Needs Clarification Requires additional input

Comments

@basilji
Copy link

basilji commented Jun 28, 2018

While deploying contract in ethereum private blockchain using web3

web3.eth.contract(JSON.parse(contractabi.toString('utf8')));
mycontract.new({
from: web3.eth.accounts[0],
data: codebin,
gas: 3141592
}

I am getting below error
Error: oversized data
at Object.InvalidResponse (/home/user1/node02/event_test/node_modules/web3/lib/web3/errors.js:38:16)
at /home/user1/node02/event_test/node_modules/web3/lib/web3/requestmanager.js:86:36
at XMLHttpRequest.request.onreadystatechange (/home/user1/node02/event_test/node_modules/web3/lib/web3/httpprovider.js:128:7)
at XMLHttpRequestEventTarget.dispatchEvent (/home/user1/node02/event_test/node_modules/xhr2/lib/xhr2.js:64:18)
at XMLHttpRequest.setReadyState (/home/user1/node02/event_test/node_modules/xhr2/lib/xhr2.js:354:12)
at XMLHttpRequest._onHttpResponseEnd (/home/user1/node02/event_test/node_modules/xhr2/lib/xhr2.js:509:12)
at IncomingMessage. (/home/user1/node02/eventtest/node_modules/xhr2/lib/xhr2.js:469:24)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)

@lanhao-tik
Copy link

same here

@nathanawmk
Copy link

Same here. Not sure how to put the maxCodeSize in it

@nivida
Copy link
Contributor

nivida commented Aug 10, 2018

Which version of web3 are you using?

@nathanawmk
Copy link

nathanawmk commented Aug 12, 2018

Since maxCodeSize parameter in genesis.json does not work, I had to fix this issue by increasing the transaction size to 64KB in tx_pool.go. To be specified, this is for Quorum, a fork from Ethereum for enterprise use.

DOS is less applicable for private Ethereum networks such as Quorum.

Updated code as follows:
// Heuristic limit, reject transactions over 32KB to prevent DOS attacks

// UPDATED to 64KB to support the deployment of bigger contract due to the pressing need for sophisticated/complex contract in financial/capital markets - Nathan Aw

if tx.Size() > 64*1024 {
	return ErrOversizedData
}

References:

https://github.com/nathanawmk/quorum/blob/master/core/tx_pool.go

https://ethereum.stackexchange.com/questions/55691/oversized-data-during-truffle-migrate/56354#56354

https://ethereum.stackexchange.com/questions/56000/quorum-oversized-data-during-contract-creation-contract-code-size-limit/56353#56353

@basilji
Copy link
Author

basilji commented Aug 13, 2018

we were using web3 - 0.19.0 version

@subhodi
Copy link

subhodi commented Sep 21, 2018

@basilji
Maximum data you can pass along with single transaction is 32KB. Out of that Apprx 1KB is used for transaction details and rest is actually available to the sender to add payload. Modularize your smart contract code and use multiple transactions to deploy large smart contracts.
Error is thrown from Geth side, look at this line of code https://github.com/ethereum/go-ethereum/blob/6a33954731658667056466bf7573ed1c397f4750/core/tx_pool.go#L570 Limit is 32KB to prevent DOS attacks

@shadab14meb346
Copy link

@nathanawmk
I have done this if tx.Size() > 128*1024 { return ErrOversizedData }.Even after doing this when I am deploying my smart contract to my private network it is still giving Error: oversized data. I have also tried to find the deployedBytecode length in mycontract.json file. I found out that it is 71236.
Reference:
https://ethereum.stackexchange.com/questions/59694/getting-this-error-error-oversized-data/59696?noredirect=1#comment71714_59696
this is the question we are discussing.

@nivida nivida added Needs Clarification Requires additional input and removed more information needed labels Nov 28, 2018
@nivida
Copy link
Contributor

nivida commented Apr 16, 2019

This is an issue of 0.20.7 and the last maintenance release happened some months ago. Because of this do I close this issue.

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

No branches or pull requests

6 participants