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

Tx silently fails if payload is too large but shows up as succesful #16

Open
kaustavha opened this issue Jul 23, 2017 · 0 comments
Open

Comments

@kaustavha
Copy link

Hi there,

I'm attempting to jam a ton of text into a smart contract on the rinkeby network. (~12kb).
The contract in essence takes text supplied and concats it to its internal data variable.
When I try to shove the whole 12kb payload in a single TX it fails silently while showing a succesfully mined TX.
But if I break it up into smaller TXs it works till 4605 bytes at least.
I chunked the whole text blob into 3. Attempting to send the TX with the s3 sized payload fails silently, but shows up in metamask as succesful. The other two work fine.

s3.length
4794
s2.length
3031
s1.length
4605

Here is the contract code:

import "github.com/Arachnid/solidity-stringutils/strings.sol";

contract PermanentDataStore {
    using strings for *;
    string public data;
    function PermanentDataStore(string _data) public {
        concat(data, _data);
    }

    function get() constant returns (string) {
        return data;
    }

    function add(string _data) public {
        concat(data, _data);
    }

    function clear() public {
        data = "";
    }

    function concat(string s1, string s2) {
        data = s1.toSlice().concat(s2.toSlice());
    }
}

I'm wondering what the limit is and if it is documented anywhere?
Also would it be possible to alert when it fails?

Expected behaviour would be either an alert that there was an issue, or a block that prevents initiating a tx with a payload too large.

Browser is chrome 59. OS is macOS 10.12.

Steps to reproduce:

  • Deploy the contract on rinkeby.
  • Generate a 12kb blob of text.
  • Try calling contract.add(string) from the browsers console with various sized chunks of text.

Same issue: MetaMask/metamask-extension#1809

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

No branches or pull requests

1 participant