Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Usage of FakeTransaction from ethereumjs-tx #131

Closed
unao opened this issue Jul 3, 2018 · 6 comments
Closed

Usage of FakeTransaction from ethereumjs-tx #131

unao opened this issue Jul 3, 2018 · 6 comments

Comments

@unao
Copy link
Contributor

unao commented Jul 3, 2018

I have a fairly simple setup: deploy some contracts and then run some tests. Initially it worked via ganache-cli, but encountered an issue which is addressed in this PR: #130.

To fix it I started to use server from ganache-core, but strangely enough the results were bit different and core breaks first time eth_sendRawTransaction is used. cli seems to work fine. The transaction's data is exactly the same and contracts are deployed successfully in both cases.
The error message said: TXRejectedError: the tx doesn\'t have the correct nonce. account has nonce of: 0 tx has nonce of: 6, but it seemed rather suspicious as I always obtain nonce directly from the rpc node via eth_getTransactionCount.
I pinned down the problem to missing from field after the transaction was re-created on the server side. This: unao@f656b6e seems to fix the issue.

To be honest I do not understand what is the root cause of it and if my hacky fix is safe/good enough.

The real mysterious part is why it works in case of cli, but not core. From what I saw cli just starts the server. My best hypotheses would be that webpack build somehow modifies the semantics slightly.

Your Environment

  • Version used: ganache-core 2.1.2, ganache CLI v6.1.3 (ganache-core: 2.1.2)
  • Environment name and version (e.g. PHP 5.4 on nginx 1.9.1): node 8.11.2
  • Server type and version:
  • Operating System and version: ubuntu 16.04
  • Link to your project:
@kipliklotrika
Copy link

It seems that the problem is fixed in the ethereumjs-tx in version 1.3.6, but unfortunately another problem is introduced ethereumjs/ethereumjs-tx#113 because of which fake transactions still doesn't work.

jamespic added a commit to spacesuit-extension/SpaceSuit that referenced this issue Jul 8, 2018
@benjamincburns
Copy link
Contributor

I can confirm reproduction of this issue. Will release a fix for ganache-core and ganache-cli shortly.

@benjamincburns
Copy link
Contributor

The real mysterious part is why it works in case of cli, but not core. From what I saw cli just starts the server. My best hypotheses would be that webpack build somehow modifies the semantics slightly.

Just solved that mystery - ganache-core depended on ethereumjs-tx@^1.3.0 and 1.3.4 was the version found in its package-lock.json however it seems that npm doesn't give a hoot about transitive dependencies' package-lock.json files, so when I refreshed that file prior to cutting the last release it selected [email protected], putting ethereumjs/ethereumjs-tx#113 into play for [email protected].

I've fixed this by pinning ganache-core's ethereumjs-tx dependency to 1.3.4 (dropped the carat operator), and releasing [email protected]. This is the only difference between 2.1.4 and 2.1.5. I'm now in the process of releasing [email protected] which will point at this new release. I'll catch up with the Ganache project (electron UI) tomorrow.

Thanks for this, @kipliklotrika!

@benjamincburns
Copy link
Contributor

Closed by 7326b51.

@benjamincburns
Copy link
Contributor

[email protected] is now published.

@ajhodges
Copy link

I think this issue was related to a bug that was fixed in ethereumjs/ethereumjs-tx#118

[email protected] contains the fix! Should also fix #523

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

4 participants