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

Invalid Signature when validating pre-homestead blocks #67

@micahriggan

Description

@micahriggan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions