Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

FakeTransaction causes hash collisions in ganache-cli #80

Closed
benjamincburns opened this issue Nov 28, 2017 · 1 comment
Closed

FakeTransaction causes hash collisions in ganache-cli #80

benjamincburns opened this issue Nov 28, 2017 · 1 comment

Comments

@benjamincburns
Copy link
Contributor

benjamincburns commented Nov 28, 2017

Ganache/TestRPC experiences transaction hash collisions when the only thing differentiating two transactions is the sender, for example, when two brand new accounts send identical transactions to the same contract.

Example:

I'd expect that in the below code, tx1.hash() would not be the same as tx2.hash().

    var tx1 = new FakeTransaction({
        data:"0x7cf5dab00000000000000000000000000000000000000000000000000000000000000005",
        gasLimit:"0x15f90",
        gasPrice:"0x1",
        nonce:"0x01",
        to:"0xd9024df085d09398ec76fbed18cac0e1149f50dc",
        value:"0x0",
        from: "0xf492dd75de5acfe13ef9bae89a0f51767be3dae5"
    });

    var tx2 = new FakeTransaction({
        data:"0x7cf5dab00000000000000000000000000000000000000000000000000000000000000005",
        gasLimit:"0x15f90",
        gasPrice:"0x1",
        nonce:"0x01",
        to:"0xd9024df085d09398ec76fbed18cac0e1149f50dc",
        value:"0x0",
        from: "0x161b4555e40f6d42ae93591f3d9f35f6e765c6b9"
    });

    // fails
    assert.notEqual(tx1.hash(), tx2.hash());
benjamincburns added a commit to benjamincburns/ethereumjs-tx that referenced this issue Nov 28, 2017
benjamincburns added a commit to benjamincburns/ethereumjs-tx that referenced this issue Dec 21, 2017
benjamincburns added a commit to benjamincburns/ethereumjs-tx that referenced this issue Dec 21, 2017
@holgerd77
Copy link
Member

This is now REALLY fixed/closed by a new minor release v1.3.4 on npm, sorry that it took so long.

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

No branches or pull requests

2 participants