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

"truffle migrate —reset" failed from "geth 1.10.0" #3913

Closed
1 task done
daenamkim opened this issue Mar 9, 2021 · 39 comments
Closed
1 task done

"truffle migrate —reset" failed from "geth 1.10.0" #3913

daenamkim opened this issue Mar 9, 2021 · 39 comments
Assignees

Comments

@daenamkim
Copy link


Issue

I have been working with truffle and experienced truffle migrate —reset is not working from geth 1.10.0, it showed only replay-protected (EIP-155) transactions allowed over RPC. I found out workaround from https://github.com/ethereum/go-ethereum/releases/tag/v1.10.0, adding --rpc.allow-unprotected-txs on local geth running. For local geth will be fine but I am not sure after all remote nodes (of using geth) are updated to v1.10.x.

Steps to Reproduce

  • Upgrade your local geth node to v1.10.x
  • Setup your truffle and config: provider and network ID points to your local geth
  • run truffle migrate --reset multiple times (I am not sure on the first because I have updated geth while I was working)

Expected Behavior

truffle migrate --reset should work without any problem (in my opinion) or show a guide what a has to do at least.

Actual Results

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

   Replacing 'Migrations'
   ----------------------

Error:  *** Deployment Failed ***

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

Environment

  • Operating System: macOS 11.2.1 (20D74)
  • Ethereum client: geth v1.10.1
  • Truffle version (truffle version): Truffle v5.2.3 (core: 5.2.3)
  • node version (node --version): v14.15.5
  • npm version (npm --version): 6.14.11 (FYI, I am not using npm but yarn 1.22.10)
@Jovonni
Copy link

Jovonni commented Mar 9, 2021

+1 I thought I was going crazy @daenamkim!

Everything was working until randomly started getting this error, I just started seeing this error about 3-4 hours ago. Did you by any chance change your secrets you were using? That was the last thing I remember doing before seeing this, but I am unaware if it was related. I am also on a mac btw

npx truffle migrate --reset --network ropsten

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.



Starting migrations...
======================
> Network name:    'ropsten'
> Network id:      3
> Block gas limit: 8000000 (0x7a1200)


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

   Replacing 'Migrations'
   ----------------------

Error:  *** Deployment Failed ***

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

Results of "networks --clean"

npx truffle networks --clean
TypeError: Cannot convert undefined or null to object

I also noticed how little information there is about this specific issue. The only documentation I noticed was what OP mentioned above with

--rpc.allow-unprotected-txs

EDIT:
I am using the following versions

Truffle v5.2.3 (core: 5.2.3)
Node v13.8.0

@Jovonni
Copy link

Jovonni commented Mar 9, 2021

@daenamkim what network are you targeting?

@Jovonni
Copy link

Jovonni commented Mar 9, 2021

Also looking at that gitter link @daenamkim , seems like multiple people are having this issue.. it can't be local then... It could be a number of things now that I'm seeing this... for it to randomly occur when I made no updates on my machine, that is telling.

hm

@Jovonni
Copy link

Jovonni commented Mar 9, 2021

Temporarily, how can we make use of --rpc.allow-unprotected-txs with truffle directly?

This seems insecure though, and this doesn't seem like a production-ready workaround...

Lastly, this seems concerning that an issue like this can effect so many developers at once... @daenamkim you said you updated while running a migrate --reset, but I did not. I actually never upgraded anything on my end.

The only thing I did was switch secrets to another account, and then switched back. Perhaps this could've forced an upgrade?.. this is strange though

BTW just running npx truffle develop, and performing a migrate works fine, if it matter at all for this convo.

My final thought is perhaps several network nodes upgrade to pangea expanse today...

@Siegrift
Copy link

Siegrift commented Mar 9, 2021

I am having the same issue. I want to (re)deploy my contracts to Ropsten and I am using Infura.

I believe I want to somehow pass --rpc.allow-unprotected-txs directly to Infura (not truffle), but that is not possible from what I can see.

@Jovonni
Copy link

Jovonni commented Mar 9, 2021

Yea, I don't think so either @Siegrift , since the nodes themselves are running the runtime itself, those nodes would have to run that command. I am sure being able to pass command line args like --rpc.allow-unprotected-txs would be a security concern

I wonder if this means we only need to submit replay-protected TXs moving forward...

@Jovonni
Copy link

Jovonni commented Mar 9, 2021

More context for other readers, in addition to the links above:
ethereum/go-ethereum#22339

@hackedhead
Copy link

@Jovonni
Thank you so dang much, I've been scouring for HOURS trying to figure out why this started happening to me. My code (which has not changed) could suddenly no longer transact with Ropsten via Infura. I assume now that they upgraded their runtimes and this default is the reason.

@jpataylor
Copy link

Definitely seems to be caused by Infura upgrading to geth v1.10.1 but I don't blame them for that, nor do I think the solution is to add the --rpc.allow-unprotected-txs on their side. It would be nice to be able to pass an argument to Infura that adds the flag when really required, but the real solution would be to have truffle add the chain ID to transactions as per EIP 155.

Thanks to @daenamkim for starting this thread. Sounds like many of us have spent some hours scratching our heads already and for sure many others will until it's fixed.

@Jovonni
Copy link

Jovonni commented Mar 10, 2021

Agreed @jpataylor

I have been looking at truffle's core in attempts to add the chainID to transactions myself, and submit it as a PR. Still looking...

@discoteq-cmd
Copy link

discoteq-cmd commented Mar 10, 2021

For anyone who also waiting for the fix - Alchemy updated their nodes to be running with --rpc.allow-unprotected-txs

@egalano
Copy link

egalano commented Mar 10, 2021

Infura has re-enabled support for non-eip-155 transactions to help users on Ropsten until Truffle has a fix ready. Full details here: https://community.infura.io/t/berlin-fork-and-strict-checking-for-eip-155-transaction-compatibility/2609

@Jovonni
Copy link

Jovonni commented Mar 11, 2021

Does anyone have any documentation on how to sign the transactions to adhere to EIP 155?

looking for definitive documentation. Want to ensure to be ahead of the curve on this

@Siegrift
Copy link

Hi, is there some progress on the proper fix for this on truffle side? I hope this will get fixed until infura disables the --rpc.allow-unprotected-txs on 17th May.

@shoenseiwaso
Copy link

@haltman-at this was NOT fixed by #3923. See also #3935.

@haltman-at
Copy link
Contributor

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

@eggplantzzz
Copy link
Contributor

Using Truffle version 5.2.6 and Geth 1.10.1-stable I am able to migrate a project successfully (with @truffle/hdwallet-provider). Can anyone else confirm the same results or still get errors?

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

shoenseiwaso commented Mar 31, 2021

@eggplantzzz Truffle version 5.2.6 did NOT resolve this for me.

$ yarn install
yarn install v1.22.10
warning package.json: No license field
warning No license field
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "@truffle/hdwallet-provider > @trufflesuite/web3-provider-engine > eth-block-tracker > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@truffle/hdwallet-provider > @trufflesuite/web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime > [email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@truffle/hdwallet-provider > @trufflesuite/web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime > [email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@truffle/hdwallet-provider > @trufflesuite/web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime > [email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@truffle/hdwallet-provider > @trufflesuite/web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime > babel-plugin-polyfill-corejs2 > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.4.0-0".
warning "@truffle/hdwallet-provider > @trufflesuite/web3-provider-engine > eth-block-tracker > @babel/plugin-transform-runtime > babel-plugin-polyfill-corejs2 > @babel/helper-define-polyfill-provider > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0".
[4/4] 🔨  Building fresh packages...
✨  Done in 1.47s.

$ truffle migrate

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.



Starting migrations...
======================
> Network name:    'development'
> Network id:      1337
> Block gas limit: 11500000 (0xaf79e0)


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

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

Error:  *** Deployment Failed ***

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

    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at Migration._deploy (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:74:1)
    at Migration._load (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:61:1)
    at Migration.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:212:1)
    at Object.runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1)
    at Object.runFrom (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
    at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:87:1)
    at runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:263:1)
    at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:228:1)
    at Command.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/command.js:136:1)
Truffle v5.2.6 (core: 5.2.6)
Node v15.11.0

$ truffle version
Truffle v5.2.6 (core: 5.2.6)
Solidity v0.5.16 (solc-js)
Node v15.11.0
Web3.js v1.2.9

$ cat package.json
{
  "dependencies": {
    "@truffle/hdwallet-provider": "^1.2.5"
  }
}
$

@haltman-at
Copy link
Contributor

OK, this should be resolved in 5.3.0, so I'm going to close this. Let us know if it's not and we can reopen.

@apolosan
Copy link

I'm still getting the same problem. Truffle v5.3.6 and @truffle/[email protected] @1.2.6 @1.3.0

@haltman-at
Copy link
Contributor

Could you try updating @truffle/hdwallet-provider to 1.4.0? It should resolve this problem. Thanks!

@ConnorBP
Copy link

Ahh this is infuriating. Trying to deploy to matic testnet as per https://docs.matic.network/docs/develop/truffle these instructions, and it hates me.

@FollonSaxBass
Copy link

Ahh this is infuriating. Trying to deploy to matic testnet as per https://docs.matic.network/docs/develop/truffle these instructions, and it hates me.

FYI Updating @truffle/hdwallet-provider to 1.4.0 worked for me :)

@ConnorBP
Copy link

Ahh this is infuriating. Trying to deploy to matic testnet as per https://docs.matic.network/docs/develop/truffle these instructions, and it hates me.

FYI Updating @truffle/hdwallet-provider to 1.4.0 worked for me :)

worked for me too. Also found out I somehow had "hdwallet-provider" instead of "@truffle/hdwallet-provider" as my dependency, which was deprecated so its version number wouldn't go any higher. Confused me briefly. If anyone else is stuck here make sure you check that you have the right dependency name.

@haltman-at
Copy link
Contributor

OK, I'm going to leave this closed for now then. @apolosan, let us know if there's still a problem after upgrading to 1.4.0.

@Xuefeng-Zhu
Copy link

@haltman-at I am able to trigger transaction, but the transaction seems to be pending forever on mumbai
https://explorer-mumbai.maticvigil.com/tx/0x6898c3edb1d8b5d0430cc65c5eae76d31db3b379428d07a9430cc4406ada5de7/internal-transactions

@haltman-at
Copy link
Contributor

@Xuefeng-Zhu That sounds like an unrelated problem. Could you perhaps file a new issue for that? Thanks!

@m1cm1c
Copy link

m1cm1c commented Jun 14, 2021

There seems to be a recession. I originally used Truffle 5.1.50 when I came across this problem. After reading up on this thread, I installed Truffle 5.3.10 and continued to have the problem:

[christoph@ladybug ~/Development/Work/flexqgrid/period_block_contract]$ truffle deploy --network=mumbaitestnet

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.



Starting migrations...
======================
> Network name:    'mumbaitestnet'
> Network id:      80001
> Block gas limit: 20000000 (0x1312d00)


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

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

Error:  *** Deployment Failed ***

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

    at /home/christoph/.nvm/versions/node/v14.3.0/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Migration._deploy (/home/christoph/.nvm/versions/node/v14.3.0/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:75:1)
    at Migration._load (/home/christoph/.nvm/versions/node/v14.3.0/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:61:1)
    at Migration.run (/home/christoph/.nvm/versions/node/v14.3.0/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:218:1)
    at Object.runMigrations (/home/christoph/.nvm/versions/node/v14.3.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1)
    at Object.runFrom (/home/christoph/.nvm/versions/node/v14.3.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
    at Object.run (/home/christoph/.nvm/versions/node/v14.3.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:87:1)
    at runMigrations (/home/christoph/.nvm/versions/node/v14.3.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:258:1)
    at Object.run (/home/christoph/.nvm/versions/node/v14.3.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:223:1)
    at Command.run (/home/christoph/.nvm/versions/node/v14.3.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/command.js:167:1)
Truffle v5.3.10 (core: 5.3.10)
Node v14.3.0
[christoph@ladybug ~/Development/Work/flexqgrid/period_block_contract]$ truffle --version
Truffle v5.3.10 - a development framework for Ethereum

Usage: truffle <command> [options]

Commands:
  build     Execute build pipeline (if configuration present)
  compile   Compile contract source files
  config    Set user-level configuration options
  console   Run a console with contract abstractions and commands available
  create    Helper to create new contracts, migrations and tests
  db        Database interface commands
  debug     Interactively debug any transaction on the blockchain
  deploy    (alias for migrate)
  develop   Open a console with a local development blockchain
  exec      Execute a JS module within this Truffle environment
  help      List all commands or provide information about a specific command
  init      Initialize new and empty Ethereum project
  install   Install a package from the Ethereum Package Registry
  migrate   Run migrations to deploy contracts
  networks  Show addresses for deployed contracts on each network
  obtain    Fetch and cache a specified compiler
  opcode    Print the compiled opcodes for a given contract
  preserve  Save data to decentralized storage platforms like IPFS and Filecoin
  publish   Publish a package to the Ethereum Package Registry
  run       Run a third-party command
  test      Run JavaScript and Solidity tests
  unbox     Download a Truffle Box, a pre-built Truffle project
  version   Show version number and exit
  watch     Watch filesystem for changes and rebuild the project automatically

See more at http://trufflesuite.com/docs

However, the problem does not occur with Truffle 5.3.0.

@haltman-at
Copy link
Contributor

@m1cm1c Just to be certain, are you using a version of @truffle/hdwallet-provider prior to 1.4.0? It's strange that you say it works with Truffle 5.3.0, as the problem wasn't properly fixed until 5.3.6. But if you're using @truffle/hdwallet-provider separately from Truffle itself, you may be using an old version of such.

@m1cm1c
Copy link

m1cm1c commented Jun 17, 2021

@hatman-at I'm not using @truffle/hdwallet-provider separately. However, I cannot reproduce the problem with Truffle 5.3.10 anymore, so there probably was something weird going on with my system. Thanks for letting me know that the problem was only solved in Truffle 5.3.6.

@myyan
Copy link

myyan commented Jun 27, 2021

@eggplantzzz @haltman-at @m1cm1c
Truffle version 5.3.12 did NOT resolve this for me.

  • The Problem

➜  testing git:(master) ✗ truffle deploy --network matic

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.



Starting migrations...
======================
> Network name:    'matic'
> Network id:      137
> Block gas limit: 20009743 (0x131530f)


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

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

Error:  *** Deployment Failed ***

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

    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at Migration._deploy (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:75:1)
    at Migration._load (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:61:1)
    at Migration.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:218:1)
    at Object.runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1)
    at Object.runFrom (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
    at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:87:1)
    at runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:258:1)
    at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:223:1)
    at Command.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/command.js:167:1)
Truffle v5.3.12 (core: 5.3.12)
Node v14.5.0

  • My Local Environment
➜  testing git:(master) ✗ truffle version 
Truffle v5.3.12 (core: 5.3.12)
Solidity - 0.6.12 (solc-js)
Node v14.5.0
Web3.js v1.3.6
  • Truffle Config
    matic: {
      provider: () => new HDWalletProvider(privateKey, `https://rpc-mainnet.maticvigil.com`),
      network_id: 137,
      confirmations: 2,
      timeoutBlocks: 200,
      skipDryRun: true
    }

@haltman-at
Copy link
Contributor

@myyan It seems you've also created issue #4147 for this, so I think we'll leave this one closed and we can discuss your problem over there.

scald pushed a commit to scald/polygon-box that referenced this issue Jun 29, 2021
See issue truffle-box#1 and related issues linked below. 

Fixes below error when attempting to migrate the default contract.

```
Error: while migrating SimpleStorage: only replay-protected (EIP-155) transactions allowed over RPC
```

trufflesuite/truffle#3913
trufflesuite/truffle#4147
@WPSmartContracts
Copy link

I keep having this error with:

Truffle v5.3.6 (core: 5.3.6)
Solidity - ^0.5.7 (solc-js)
Node v15.14.0
Web3.js v1.3.5

I also tried with truffle:

Truffle v5.4.19 (core: 5.4.19)

Also I tried different RPC, like:

    `https://rpc-mainnet.maticvigil.com/`
    `https://matic-mainnet-archive-rpc.bwarelabs.com`
    `https://polygon-rpc.com/`
    `https://polygon-mainnet.infura.io/v3/{API_KEY}`

And the same error happens:

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

And I am having this in other networks as well, like Fantom, not only Polygon...

more info:

truffle.js:

maticmainnet: {
  provider: function() {
    return new HDWalletProvider(MNEMONIC, `https://rpc-mainnet.maticvigil.com/`)
  },
  network_id: 137,
  timeoutBlocks: 50000,
  gas: 7000000,
  skipDryRun: true
},

command:

truffle migrate --network maticmainnet

error:

Compiling your contracts...
===========================
✔ Fetching solc version list from solc-bin. Attempt #1
> Everything is up to date, there is nothing to compile.



Starting migrations...
======================
> Network name:    'maticmainnet'
> Network id:      137
> Block gas limit: 29015541 (0x1babdf5)


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

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

Error:  *** Deployment Failed ***

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

package.json:

{
  "name": "openzeppelin-deployer",
  "version": "1.0.0",
  "description": "",
  "main": "truffle.js",
  "directories": {
    "test": "test"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "truffle-plugin-verify": "^0.5.15"
  },
  "dependencies": {
    "@truffle/hdwallet-provider": "^1.4.0"
  }
}

truffle version

Truffle v5.3.6 (core: 5.3.6)
Solidity - ^0.5.7 (solc-js)
Node v15.14.0
Web3.js v1.3.5

any ideas?

@WPSmartContracts
Copy link

I noticed this bug is closed, should I open a new one?

@haltman-at
Copy link
Contributor

@WPSmartContracts Yes, I would suggest opening a new issue.

@MisterMoCity
Copy link

Do not forget to update - var HDWalletProvider = require("@truffle/hdwallet-provider"); This will ensure you are pointing to the corrector hdwallet version. It works!

@samskiter
Copy link

@WPSmartContracts did you file a new issue?

@haltman-at I'm seeing this issue when running truffle test with ganachev7, but not with ganache v6. It's flakey though - sometimes the tests will run, other time it will fail at this deployment step.

@haltman-at
Copy link
Contributor

@samskiter I would suggest filing a new issue for this, as this one's got a lot to sort through.

@janassss
Copy link

hey i had the same issue

Do not forget to update - var HDWalletProvider = require("@truffle/hdwallet-provider"); This will ensure you are pointing to the corrector hdwallet version. It works!

But could solve this with this help in my truffle-confic

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