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

Deployer error: only replay-protected (EIP-155) transactions allowed over RPC #3935

Closed
shoenseiwaso opened this issue Mar 20, 2021 · 22 comments
Assignees

Comments

@shoenseiwaso
Copy link

shoenseiwaso commented Mar 20, 2021

Since the upgrade to 1.10, the chain ID is now a required parameter. Although #3923 was merged to address it in the contract package, the deployer seems to be broken. The issue might be in executeDeployment(), where chain ID is not set.

Running truffle migrate --reset we see:

1_initial_migration.js
======================

   Deploying 'Migrations'
   ----------------------

Error:  *** Deployment Failed ***

"Migrations" -- only replay-protected (EIP-155) transactions allowed over RPC.
@MariusVanDerWijden
Copy link

MariusVanDerWijden commented Mar 20, 2021

This issue might also manifests as when trying to migrate your contracts to infura

1_initial_migration.js
======================

   Deploying 'Migrations'
   ----------------------

Error:  *** Deployment Failed ***

"Migrations" -- invalid sender.

If you are stuck on this and don't know what to do, try deploying your contracts with remix. Interaction with truffle should work (with the latest master) only deployment is broken

@maxwellfortney
Copy link

Master (v5.2.5 released yesterday) does not solve this issue when trying to deploy with infura or alchemy, deploying with remix did work however.

@shoenseiwaso
Copy link
Author

Probably a dupe of #3913.

@robbelouwet
Copy link

robbelouwet commented Mar 22, 2021

I can confirm I have the same issue.

I try to deploy my contract to ropsten, all parameters set with enough eth in the right address, and get the 'invalid sender' error.

Deploying 'Migrations'
   ----------------------

Error:  *** Deployment Failed ***

"Migrations" -- invalid sender.

    at /home/usr/.npm/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
    at process._tickCallback (internal/process/next_tick.js:68:7)
Truffle v5.2.5 (core: 5.2.5)
Node v10.19.0

I've checked everything, my truffle-config.js file is correct.
See my stackoverflow post where I describe into detail.

using Truffle v5.2.5

@noahfigueras
Copy link

Stuck with the same issue! Is there a fix for the error ?

@maxwellfortney
Copy link

@noahfigueras Fix is to downgrade @truffle/hdwallet-provider

@noahfigueras
Copy link

Thanks @maxwellfortney I downgraded @truffle/[email protected] and it deploys correctly now!

@haltman-at
Copy link
Contributor

Question, are these problems still happening on Truffle 5.2.6? Thank you!

@idealatom
Copy link

@haltman-at Yes. I couldn't deploy a contract now. Downgrading a @truffle/hdwallet-provider is helped for me.

@Tenoke
Copy link

Tenoke commented Mar 27, 2021

I was getting "Migrations" -- invalid sender. as well before downgrading which worked here, too.

@Jovonni
Copy link

Jovonni commented Mar 28, 2021

Since the upgrade to 1.10, the chain ID is now a required parameter. Although #3923 was merged to address it in the contract package, the deployer seems to be broken. The issue might be in executeDeployment(), where chain ID is not set.

Running truffle migrate --reset we see:

1_initial_migration.js
======================

   Deploying 'Migrations'
   ----------------------

Error:  *** Deployment Failed ***

"Migrations" -- only replay-protected (EIP-155) transactions allowed over RPC.

@shoenseiwaso Is a fix as simple as just adding the chainid key to the eventArgs object in

executeDeployment(contract, args) {

In here:

eventArgs = {
state: state,
contract: contract,
deployed: isDeployed,
blockLimit: currentBlock.gasLimit,
gas: self._extractFromArgs(newArgs, "gas") || contract.defaults().gas,
gasPrice:
self._extractFromArgs(newArgs, "gasPrice") ||
contract.defaults().gasPrice,
from:
self._extractFromArgs(newArgs, "from") || contract.defaults().from
};

@gabmontes
Copy link

Possible dup of #3946.

@eggplantzzz
Copy link
Contributor

Could someone provide me with a simple project and detailed steps to reproduce this error? It would be really helpful to have to test against.

@MariusVanDerWijden
Copy link

@eggplantzzz Any project migrating against you own geth node (v1.10.1 and higher) with geth --dev

@eggplantzzz
Copy link
Contributor

@MariusVanDerWijden It would be helpful if you have a specific project. I am able to successfully migrate a toy project to Geth version 1.10.1-stable using the currently released version of Truffle. If you have one handy and specific steps, I would appreciate it!

@shoenseiwaso
Copy link
Author

@eggplantzzz repo which reproduces the issue is here. Follow the steps in the README:
https://github.com/curvegrid/truffle-eip155-issues

@eggplantzzz
Copy link
Contributor

Thanks for providing the repro steps! I was able to recreate the error - it looks like upgrading ethereumjs-tx without extra configuration caused the issue. When I dowgrade that library it works fine, I put in a PR for downgrading here until we get a chance to spend more time upgrading it. Thank you all!

@eggplantzzz eggplantzzz self-assigned this Mar 31, 2021
@gnidan
Copy link
Contributor

gnidan commented Mar 31, 2021

This should be fixed in Truffle v5.3.0. Closing optimistically, but let us know if the problem persists, and we'll be glad to re-open!

Thanks all!

@gnidan gnidan closed this as completed Mar 31, 2021
@shoenseiwaso
Copy link
Author

@eggplantzzz @gnidan Truffle v5.3.0 did indeed fix the issue. However, upgrading Truffle alone was not enough: I also had to upgrade the @truffle/hdwallet-provider from 1.2.5 to 1.2.6 as well. This might seem obvious to some, but I think it's still going to catch a lot of people off guard that the error only replay-protected (EIP-155) transactions allowed over RPC. means, "upgrade the @truffle/hdwallet-provider depedency to 1.2.6.

Is it worth putting a note in the v5.3.0 release notes?

{
  "dependencies": {
    "@truffle/hdwallet-provider": "1.2.6"
  }
}

@shoenseiwaso
Copy link
Author

Note that the fix did not address the case where the network ID and chain ID differ. Opened #3961 for this.

@mmotiy
Copy link

mmotiy commented May 10, 2021

Thanks @maxwellfortney I downgraded @truffle/[email protected] and it deploys correctly now!

it work now

@nehal-backspace
Copy link

Other Solution

Inside truffle-config.js use :

const HDWalletProvider = require('truffle-hdwallet-provider');

instead of

const HDWalletProvider = require('@truffle/hdwallet-provider');

It's just other way of downgrading the @truffle/hdwallet-provider

while your package.json can still have
"dependencies": {
"@truffle/hdwallet-provider": "^1.3.1"
}

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