aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2016-11-15 20:46:47 +0800
committerGitHub <noreply@github.com>2016-11-15 20:46:47 +0800
commit81d9d7d38555a63602b9da3d07955ad4e5a62f02 (patch)
tree9ce0d55bfe182f6493867ea5497bf2c8cd9e8523 /cmd
parentef9265d0d7abf6614c1d2fb977989ab0d400a590 (diff)
parent822355f8a6e8826561433392fd94a8bde7e4dbf3 (diff)
downloadgo-tangerine-1.4.19.tar
go-tangerine-1.4.19.tar.gz
go-tangerine-1.4.19.tar.bz2
go-tangerine-1.4.19.tar.lz
go-tangerine-1.4.19.tar.xz
go-tangerine-1.4.19.tar.zst
go-tangerine-1.4.19.zip
Merge pull request #3252 from obscuren/release/1.4v1.4.19
1.4 HF
Diffstat (limited to 'cmd')
-rw-r--r--cmd/ethtest/main.go5
-rw-r--r--cmd/evm/main.go36
-rw-r--r--cmd/geth/main.go2
-rw-r--r--cmd/gethrpctest/main.go4
-rw-r--r--cmd/utils/flags.go43
5 files changed, 60 insertions, 30 deletions
diff --git a/cmd/ethtest/main.go b/cmd/ethtest/main.go
index 5663c2623..7ce663dc0 100644
--- a/cmd/ethtest/main.go
+++ b/cmd/ethtest/main.go
@@ -76,10 +76,11 @@ func runTestWithReader(test string, r io.Reader) error {
case "bk", "block", "blocktest", "blockchaintest", "blocktests", "blockchaintests":
err = tests.RunBlockTestWithReader(params.MainNetHomesteadBlock, params.MainNetDAOForkBlock, params.MainNetHomesteadGasRepriceBlock, r, skipTests)
case "st", "state", "statetest", "statetests":
- rs := tests.RuleSet{HomesteadBlock: params.MainNetHomesteadBlock, DAOForkBlock: params.MainNetDAOForkBlock, DAOForkSupport: true}
+ rs := &params.ChainConfig{HomesteadBlock: params.MainNetHomesteadBlock, DAOForkBlock: params.MainNetDAOForkBlock, DAOForkSupport: true, EIP150Block: params.MainNetHomesteadGasRepriceBlock}
err = tests.RunStateTestWithReader(rs, r, skipTests)
case "tx", "transactiontest", "transactiontests":
- err = tests.RunTransactionTestsWithReader(r, skipTests)
+ rs := &params.ChainConfig{HomesteadBlock: params.MainNetHomesteadBlock, DAOForkBlock: params.MainNetDAOForkBlock, DAOForkSupport: true, EIP150Block: params.MainNetHomesteadGasRepriceBlock}
+ err = tests.RunTransactionTestsWithReader(rs, r, skipTests)
case "vm", "vmtest", "vmtests":
err = tests.RunVmTestWithReader(r, skipTests)
case "rlp", "rlptest", "rlptests":
diff --git a/cmd/evm/main.go b/cmd/evm/main.go
index 952b32cd1..518be1ffd 100644
--- a/cmd/evm/main.go
+++ b/cmd/evm/main.go
@@ -158,7 +158,7 @@ func run(ctx *cli.Context) error {
vmdone := time.Since(tstart)
if ctx.GlobalBool(DumpFlag.Name) {
- statedb.Commit()
+ statedb.Commit(true)
fmt.Println(string(statedb.Dump()))
}
vm.StdErrFormat(vmenv.StructLogs())
@@ -219,7 +219,7 @@ func NewEnv(state *state.StateDB, transactor common.Address, value *big.Int, cfg
return env
}
-// ruleSet implements vm.RuleSet and will always default to the homestead rule set.
+// ruleSet implements vm.ChainConfig and will always default to the homestead rule set.
type ruleSet struct{}
func (ruleSet) IsHomestead(*big.Int) bool { return true }
@@ -227,22 +227,22 @@ func (ruleSet) GasTable(*big.Int) params.GasTable {
return params.GasTableHomesteadGasRepriceFork
}
-func (self *VMEnv) RuleSet() vm.RuleSet { return ruleSet{} }
-func (self *VMEnv) Vm() vm.Vm { return self.evm }
-func (self *VMEnv) Db() vm.Database { return self.state }
-func (self *VMEnv) SnapshotDatabase() int { return self.state.Snapshot() }
-func (self *VMEnv) RevertToSnapshot(snap int) { self.state.RevertToSnapshot(snap) }
-func (self *VMEnv) Origin() common.Address { return *self.transactor }
-func (self *VMEnv) BlockNumber() *big.Int { return common.Big0 }
-func (self *VMEnv) Coinbase() common.Address { return *self.transactor }
-func (self *VMEnv) Time() *big.Int { return self.time }
-func (self *VMEnv) Difficulty() *big.Int { return common.Big1 }
-func (self *VMEnv) BlockHash() []byte { return make([]byte, 32) }
-func (self *VMEnv) Value() *big.Int { return self.value }
-func (self *VMEnv) GasLimit() *big.Int { return big.NewInt(1000000000) }
-func (self *VMEnv) VmType() vm.Type { return vm.StdVmTy }
-func (self *VMEnv) Depth() int { return 0 }
-func (self *VMEnv) SetDepth(i int) { self.depth = i }
+func (self *VMEnv) ChainConfig() *params.ChainConfig { return params.TestChainConfig }
+func (self *VMEnv) Vm() vm.Vm { return self.evm }
+func (self *VMEnv) Db() vm.Database { return self.state }
+func (self *VMEnv) SnapshotDatabase() int { return self.state.Snapshot() }
+func (self *VMEnv) RevertToSnapshot(snap int) { self.state.RevertToSnapshot(snap) }
+func (self *VMEnv) Origin() common.Address { return *self.transactor }
+func (self *VMEnv) BlockNumber() *big.Int { return common.Big0 }
+func (self *VMEnv) Coinbase() common.Address { return *self.transactor }
+func (self *VMEnv) Time() *big.Int { return self.time }
+func (self *VMEnv) Difficulty() *big.Int { return common.Big1 }
+func (self *VMEnv) BlockHash() []byte { return make([]byte, 32) }
+func (self *VMEnv) Value() *big.Int { return self.value }
+func (self *VMEnv) GasLimit() *big.Int { return big.NewInt(1000000000) }
+func (self *VMEnv) VmType() vm.Type { return vm.StdVmTy }
+func (self *VMEnv) Depth() int { return 0 }
+func (self *VMEnv) SetDepth(i int) { self.depth = i }
func (self *VMEnv) GetHash(n uint64) common.Hash {
if self.block.Number().Cmp(big.NewInt(int64(n))) == 0 {
return self.block.Hash()
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index c4389e434..ce9b532e6 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -50,7 +50,7 @@ const (
clientIdentifier = "Geth" // Client identifier to advertise over the network
versionMajor = 1 // Major version component of the current release
versionMinor = 4 // Minor version component of the current release
- versionPatch = 18 // Patch version component of the current release
+ versionPatch = 19 // Patch version component of the current release
versionMeta = "stable" // Version metadata to append to the version string
versionOracle = "0xfa7b9770ca4cb04296cac84f37736d4041251cdf" // Ethereum address of the Geth release oracle
diff --git a/cmd/gethrpctest/main.go b/cmd/gethrpctest/main.go
index 2e07e9426..64c1c8230 100644
--- a/cmd/gethrpctest/main.go
+++ b/cmd/gethrpctest/main.go
@@ -26,7 +26,6 @@ import (
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
- "github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethdb"
@@ -130,8 +129,7 @@ func MakeSystemNode(keydir string, privkey string, test *tests.BlockTest) (*node
ethConf := &eth.Config{
TestGenesisState: db,
TestGenesisBlock: test.Genesis,
- ChainConfig: &core.ChainConfig{HomesteadBlock: params.MainNetHomesteadBlock},
- AccountManager: accman,
+ ChainConfig: &params.ChainConfig{HomesteadBlock: params.MainNetHomesteadBlock},
}
if err := stack.Register(func(ctx *node.ServiceContext) (node.Service, error) { return eth.New(ctx, ethConf) }); err != nil {
return nil, err
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 58e3ebfcb..c46caf7eb 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -769,7 +769,7 @@ func SetupNetwork(ctx *cli.Context) {
}
// MustMakeChainConfig reads the chain configuration from the database in ctx.Datadir.
-func MustMakeChainConfig(ctx *cli.Context) *core.ChainConfig {
+func MustMakeChainConfig(ctx *cli.Context) *params.ChainConfig {
db := MakeChainDatabase(ctx)
defer db.Close()
@@ -777,9 +777,9 @@ func MustMakeChainConfig(ctx *cli.Context) *core.ChainConfig {
}
// MustMakeChainConfigFromDb reads the chain configuration from the given database.
-func MustMakeChainConfigFromDb(ctx *cli.Context, db ethdb.Database) *core.ChainConfig {
+func MustMakeChainConfigFromDb(ctx *cli.Context, db ethdb.Database) *params.ChainConfig {
// If the chain is already initialized, use any existing chain configs
- config := new(core.ChainConfig)
+ config := new(params.ChainConfig)
genesis := core.GetBlock(db, core.GetCanonicalHash(db, 0))
if genesis != nil {
@@ -793,6 +793,9 @@ func MustMakeChainConfigFromDb(ctx *cli.Context, db ethdb.Database) *core.ChainC
Fatalf("Could not make chain configuration: %v", err)
}
}
+ if config.ChainId == nil {
+ config.ChainId = new(big.Int)
+ }
// Set any missing fields due to them being unset or system upgrade
if config.HomesteadBlock == nil {
if ctx.GlobalBool(TestNetFlag.Name) {
@@ -809,11 +812,39 @@ func MustMakeChainConfigFromDb(ctx *cli.Context, db ethdb.Database) *core.ChainC
}
config.DAOForkSupport = true
}
- if config.HomesteadGasRepriceBlock == nil {
+ if config.EIP150Block == nil {
+ if ctx.GlobalBool(TestNetFlag.Name) {
+ config.EIP150Block = params.TestNetHomesteadGasRepriceBlock
+ } else {
+ config.EIP150Block = params.MainNetHomesteadGasRepriceBlock
+ }
+ }
+ if config.EIP150Hash == (common.Hash{}) {
+ if ctx.GlobalBool(TestNetFlag.Name) {
+ config.EIP150Hash = params.TestNetHomesteadGasRepriceHash
+ } else {
+ config.EIP150Hash = params.MainNetHomesteadGasRepriceHash
+ }
+ }
+ if config.EIP155Block == nil {
+ if ctx.GlobalBool(TestNetFlag.Name) {
+ config.EIP150Block = params.TestNetSpuriousDragon
+ } else {
+ config.EIP155Block = params.MainNetSpuriousDragon
+ }
+ }
+ if config.EIP158Block == nil {
+ if ctx.GlobalBool(TestNetFlag.Name) {
+ config.EIP158Block = params.TestNetSpuriousDragon
+ } else {
+ config.EIP158Block = params.MainNetSpuriousDragon
+ }
+ }
+ if config.ChainId.BitLen() == 0 {
if ctx.GlobalBool(TestNetFlag.Name) {
- config.HomesteadGasRepriceBlock = params.TestNetHomesteadGasRepriceBlock
+ config.ChainId = params.TestNetChainID
} else {
- config.HomesteadGasRepriceBlock = params.MainNetHomesteadGasRepriceBlock
+ config.ChainId = params.MainNetChainID
}
}
// Force override any existing configs if explicitly requested