-
Notifications
You must be signed in to change notification settings - Fork 239
includeSignature change breaks ganache-core contract deployment #108
Comments
Ah yes, tested this locally and could reproduce the error. Sorry for that, merged this too thoughless since this was coming from the MetaMask side so I somehow assumed that this should be safe. What would you suggest? Would it be a way to just use a random different private key for fake tx signing when |
I think that removal of What you're suggesting could also work because the key used to generate a signature was constructed from the cc @Artazor |
Added a failing test case for this in #109 as well as a trivial fix by setting default from address to |
Hmm, I think on a second though this is relatively clear: if a combination of Will prepare a PR on this. |
Hmm, hmm 😄, another take on this after a third and fourth thought: things are a bit more complex and also a bit tricky. Since these changes were introduced in minor releases I think it gets to harsh with throwing an exception on this and this will probably cause unnecessary trouble for other libraries. And maybe this is also not necessary considering the fake nature of this. I think I will just revert this PR #94, this should make the various cases work again. |
Ok, this #110 would be my suggestion for a fix, I think this should be the most non-intrusive way balancing a bit the needs of existing libraries and the already done API changes. |
We've bumped into that because ganache-core was generating the same transaction hash no matter what was the from address. Because it was calling |
@LogvinovLeon Yes, thanks, I also thought longer about this this morning. I will then go the complete way and undo both PR changes from |
Thanks for taking care of this! I agree that it would be best to release the default value change in One thought about this - current default value implementation where it just sets the If |
a) One last last (hopefully :-)) thing on the default value: after thinking about this over the weekend and have another look I think we can leave this in the I just merged the revertion of #94 (#110), will do a bug fix release with this right after. |
Ok, just released v1.3.6 https://github.com/ethereumjs/ethereumjs-tx/releases/tag/v1.3.6 with the fix. |
Ganache CLI v6.7.0 (ganache-core: 2.8.0) same issue |
I think you should report this in https://github.com/trufflesuite/ganache-core @fastchain, as it's using an old version of this library, and upgrading it probably fixes it. |
Change to how includeSignature default value is handled in
FakeTransaction.hash
method introduced in b49d3ca (#94) brokeganache-core
contract deployment.Contract deployment now fails with:
Error: nonce generation function failed or private key is invalid
.The problem is that previously FakeTransaction attempted to generate the signature only if
this._from
was set. Now it attempts to set the signature regardless of it being present. Later down the line functionsecp256k1.sign
gets passed a private key consisting of0
s which causes the error.Full stack trace:
Downgrading to
ethereumjs-tx
version1.3.3
resolved the issue.I will provide a minimal example later.
The text was updated successfully, but these errors were encountered: