Metamask-extension: MetaMask 3.5.3 breaks when using local testrpc

Created on 25 Apr 2017  Â·  10Comments  Â·  Source: MetaMask/metamask-extension

I'm developing a DApp using testrpc, and MetaMask in Chrome. Starting with version 3.5.3 of MetaMask (released yesterday), whenever I try to sign a transaction, I get this error:

the field v must have a byte length of 1

It appears as if nothing is happening at all: after pushing the 'accept' button to sign the transaction, I only see the spinner. But when I close the MetaMask window and open it again to see the transaction history, I see the above error message. I just reverted back to MetaMask 3.5.2 and now it works again.

I have this issue both with TestRPC 3.0.3 and TestRPC 3.0.4.

T00-bug

Most helpful comment

You can install the latest testrpc with npm install -g ethereumjs-testrpc. MetaMask auto-updates, and the fix has been published, but the auto-updates take place over the course of an hour. @svdo.

All 10 comments

I'm really sorry we didn't catch this before releasing. I believe this is because TestRPC generates very high network IDs, and the new EIP 155 replay protection feature creates much larger v values.

You can even see that ethereumjs-tx began allowing a larger V 15 days ago.

I guess the hope is that the problem is just that TestRPC uses an outdated version of ethereumjs-tx, and just needs to bump the version, I'll try that out now.

Naievely bumping the ethereumjs-tx version still throws the same error. Any ideas for simple fixes @wanderer or @tcoulter?

We could do an emergency mitigation from the MetaMask side by rolling back our support of EIP-155 until after TestRPC implements support, but this would leave MetaMask users vulnerable on the main network (which to be fair, hasn't been a big issue so far).

Oh it looks like the TestRPC error is different from the error code listed here.

The full error reported here is:
"AssertionError: The field v must have byte length of 1↵ at Transaction.setter [as v] (chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:36221:9)↵ at Transaction.hash

The full TestRPC error is:
{"message":"Error: Invalid Signature\n at FakeTransaction.getSenderPublicKey (/Users/danfinlay/.nvm/versions/node/v7.7.3/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-tx/index.js:195:42)\n at FakeTransaction.getSenderAddress (/Users/danfinlay/.nvm/versions/node/v7.7.3/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-tx/index.js:184:25)\n at StateManager.queueRawTransaction (/Users/danfinlay/.nvm/versions/node/v7.7.3/lib/node_modules/ethereumjs-testrpc/lib/statemanager.js:216:17)\n at GethApiDouble.eth_sendRawTransaction (/Users/danfinlay/.nvm/versions/node/v7.7.3/lib/node_modules/ethereumjs-testrpc/lib/subproviders/geth_api_double.js:252:14)\n at GethApiDouble.handleRequest (/Users/danfinlay/.nvm/versions/node/v7.7.3/lib/node_modules/ethereumjs-testrpc/lib/subproviders/geth_api_double.js:70:10)\n at next (/Users/danfinlay/.nvm/versions/node/v7.7.3/lib/node_modules/ethereumjs-testrpc/node_modules/web3-provider-engine/index.js:95:18)\n at SolcSubprovider.handleRequest (/Users/danfinlay/.nvm/versions/node/v7.7.3/lib/node_modules/ethereumjs-testrpc/node_modules/web3-provider-engine/subproviders/solc.js:28:7)\n at next (/Users/danfinlay/.nvm/versions/node/v7.7.3/lib/node_modules/ethereumjs-testrpc/node_modules/web3-provider-engine/index.js:95:18)\n at VmSubprovider.handleRequest (/Users/danfinlay/.nvm/versions/node/v7.7.3/lib/node_modules/ethereumjs-testrpc/node_modules/web3-provider-engine/subproviders/vm.js:40:12)\n at next (/Users/danfinlay/.nvm/versions/node/v7.7.3/lib/node_modules/ethereumjs-testrpc/node_modules/web3-provider-engine/index.js:95:18)","code":-32000}}

This makes me think that the testrpc transactions are failing validations on both the testrpc and the MetaMask sides.

Since there appear to be two fixes involved, I'm increasingly inclined to release a rollback fix while we figure it out correctly.

Bonus weirdness: We added EIP155 support 25 days ago but ethereumjs-tx only added "v values over 1 byte" 15 days ago.

So maybe the problem is in ethereumjs-tx?

Nice, that's fast! Do you have an ETA on a new release (for both)?

You can install the latest testrpc with npm install -g ethereumjs-testrpc. MetaMask auto-updates, and the fix has been published, but the auto-updates take place over the course of an hour. @svdo.

Excellent, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

estebanmino picture estebanmino  Â·  3Comments

aakilfernandes picture aakilfernandes  Â·  3Comments

rossbulat picture rossbulat  Â·  3Comments

kumavis picture kumavis  Â·  3Comments

BMillman19 picture BMillman19  Â·  3Comments