core, eth, cmd: temporary work around for enabling the jit

This commit serves as a temporary workaround for enabling the jit until
the block customisation PR is merged in.
release/1.4
Jeffrey Wilcke 9 years ago
parent 5f92606be2
commit 0cfa21fc7f
  1. 2
      cmd/utils/flags.go
  2. 7
      core/blockchain.go
  3. 9
      eth/backend.go

@ -668,6 +668,8 @@ func MakeSystemNode(name, version string, extra []byte, ctx *cli.Context) *node.
ExtraData: MakeMinerExtra(extra, ctx),
NatSpec: ctx.GlobalBool(NatspecEnabledFlag.Name),
DocRoot: ctx.GlobalString(DocRootFlag.Name),
EnableJit: ctx.GlobalBool(VMEnableJitFlag.Name),
ForceJit: ctx.GlobalBool(VMForceJitFlag.Name),
GasPrice: common.String2Big(ctx.GlobalString(GasPriceFlag.Name)),
GpoMinGasPrice: common.String2Big(ctx.GlobalString(GpoMinGasPriceFlag.Name)),
GpoMaxGasPrice: common.String2Big(ctx.GlobalString(GpoMaxGasPriceFlag.Name)),

@ -84,6 +84,7 @@ type BlockChain struct {
chainDb ethdb.Database
eventMux *event.TypeMux
genesisBlock *types.Block
vmConfig *vm.Config
mu sync.RWMutex // global mutex for locking chain operations
chainmu sync.RWMutex // blockchain insertion lock
@ -162,6 +163,10 @@ func NewBlockChain(chainDb ethdb.Database, pow pow.PoW, mux *event.TypeMux) (*Bl
return bc, nil
}
func (self *BlockChain) SetConfig(vmConfig *vm.Config) {
self.vmConfig = vmConfig
}
func (self *BlockChain) getProcInterrupt() bool {
return atomic.LoadInt32(&self.procInterrupt) == 1
}
@ -891,7 +896,7 @@ func (self *BlockChain) InsertChain(chain types.Blocks) (int, error) {
return i, err
}
// Process block using the parent state as reference point.
receipts, logs, usedGas, err := self.processor.Process(block, statedb, nil)
receipts, logs, usedGas, err := self.processor.Process(block, statedb, self.vmConfig)
if err != nil {
reportBlock(block, err)
return i, err

@ -35,6 +35,7 @@ import (
"github.com/ethereum/go-ethereum/common/registrar/ethreg"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/eth/filters"
"github.com/ethereum/go-ethereum/ethdb"
@ -91,6 +92,9 @@ type Config struct {
GpobaseStepUp int
GpobaseCorrectionFactor int
EnableJit bool
ForceJit bool
TestGenesisBlock *types.Block // Genesis block to seed the chain database with (testing only!)
TestGenesisState ethdb.Database // Genesis state to seed the database with (testing only!)
}
@ -225,6 +229,11 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
}
//genesis := core.GenesisBlock(uint64(config.GenesisNonce), stateDb)
eth.blockchain, err = core.NewBlockChain(chainDb, eth.pow, eth.EventMux())
eth.blockchain.SetConfig(&vm.Config{
EnableJit: config.EnableJit,
ForceJit: config.ForceJit,
})
if err != nil {
if err == core.ErrNoGenesis {
return nil, fmt.Errorf(`Genesis block not found. Please supply a genesis block with the "--genesis /path/to/file" argument`)

Loading…
Cancel
Save