Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Invalid Signature when validating pre-homestead blocks #67

Closed
micahriggan opened this issue Mar 21, 2019 · 1 comment
Closed

Invalid Signature when validating pre-homestead blocks #67

micahriggan opened this issue Mar 21, 2019 · 1 comment

Comments

@micahriggan
Copy link

micahriggan commented Mar 21, 2019

https://github.com/ethereumjs/ethereumjs-block/blob/master/index.js#L76

This line appears to set homestead to true, even for blocks that happen before homestead.

When processing blocks before the fork, I often get an invalid signature error for transactions due to https://github.com/ethereumjs/ethereumjs-tx/blob/471037fb1146983884bf45206dba021b04867f59/index.js#L194

For me I changed index.js to only turn homestead on for blocks that happened after the fork

  // parse transactions
  const height = new BN(this.header.number).toNumber()
  for (i = 0; i < rawTransactions.length; i++) {
    var tx = new Tx(rawTransactions[i])
    tx._homestead = height >= 1150000;
    this.transactions.push(tx)
  }

As an aside, current version of ethereumjs-tx appear to use ethereumjs-common to try to determine hardfork settings.

@micahriggan micahriggan changed the title Homestead happens at 1150000 Invalid Signature when validating pre-homestead blocks Mar 21, 2019
@alcuadrado
Copy link
Member

Fixed by #72

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants