increase HTTP server's default maximum POST size to 2MB #160
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'd say at least once a month I see a user ensnared by the HTTP server's default maximum POST size when trying to set a "large" (512KB-1MB) contract on their account. There's even a recent open issue in b1's repo with someone who fell victim to this trap (EOSIO/eos#11085)
The reason this problem creeps up is because the WASM in the request sent to the HTTP server in keosd is encoded as a hex byte array, effectively doubling its size in the POST payload.
#153 improves the error message in this situation. But I really can't see any downside to just increasing the default limit to 2MB. This allows users to set contracts up to just under 1MB in size -- the maximum size cleos can set contract code to as-is anyways. A 2MB instead of 1MB limit would even seem unlikely to impact a nodeos RPC node exposed publicly with no proxy protection in front of it.