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

Commit

Permalink
Merge pull request #113 from ethereumjs/fix-undefined-transaction-sta…
Browse files Browse the repository at this point in the history
…te-on-block-addition

Explicitly initialize Common instances with chainstart HF
  • Loading branch information
holgerd77 authored Jun 2, 2020
2 parents 22a72f4 + 08f212c commit 2d86f29
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ async function run () {
const syncDirName = args.syncmode === 'light' ? 'lightchaindata' : 'chaindata'
const networkDirName = args.network === 'mainnet' ? '' : `${args.network}/`
const chainParams = args.params ? await parse.params(args.params) : args.network
const common = new Common(chainParams)
// Initialize Common with an explicit 'chainstart' HF set until
// hardfork awareness is implemented within the library
// Also a fix for https://github.com/ethereumjs/ethereumjs-vm/issues/757
const common = new Common(chainParams, 'chainstart')
const servers = parse.transports(args.transports).map(t => {
const Server = serverFromName(t.name)
if (t.name === 'rlpx') {
Expand Down
2 changes: 1 addition & 1 deletion lib/blockchain/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const promisify = require('util-promisify')

const defaultOptions = {
logger: defaultLogger,
common: new Common('mainnet')
common: new Common('mainnet', 'chainstart')
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/service/ethereumservice.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Common = require('ethereumjs-common').default

const defaultOptions = {
lightserv: false,
common: new Common('mainnet'),
common: new Common('mainnet', 'chainstart'),
minPeers: 3,
timeout: 5000,
interval: 1000
Expand Down

0 comments on commit 2d86f29

Please sign in to comment.