Skip to content

Commit f88bca7

Browse files
authored
Merge pull request ethereum#3055 from karalabe/release/1.4
Geth 1.4.14: What else should we rewrite?
2 parents 7a5843d + d4608ae commit f88bca7

25 files changed

+592
-691
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.13
1+
1.4.14

appveyor.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,28 @@ clone_depth: 5
66
version: "{branch}.{build}"
77
environment:
88
global:
9+
# Go stuff
910
GOPATH: c:\gopath
10-
11-
# cache choco package files so we don't hit sourceforge all
12-
# the time.
13-
cache:
14-
- c:\cache
11+
GO: c:\go\bin\go
12+
GOROOT: c:\go
13+
CC: C:\msys64\mingw64\bin\gcc.exe
14+
# MSYS2 stuff
15+
MSYS2_ARCH: x86_64
16+
MSYSTEM: MINGW64
17+
PATH: C:\msys64\mingw64\bin\;%PATH%
1518

1619
install:
17-
- cmd: choco install --cache c:\cache golang mingw | find /v "Extracting "
18-
- refreshenv
19-
- cd c:\gopath\src\github.com\ethereum\go-ethereum
20+
- "%GO% version"
21+
- "%CC% --version"
2022

2123
build_script:
22-
- go run build\ci.go install
24+
- "%GO% run build\\ci.go install"
2325

2426
test_script:
25-
- go run build\ci.go test -vet -coverage
27+
- "%GO% run build\\ci.go test -vet -coverage"
2628

2729
after_build:
28-
- go run build\ci.go archive -type zip
30+
- "%GO% run build\\ci.go archive -type zip"
2931

3032
artifacts:
3133
- path: geth-*.zip

build/ci.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ func doTest(cmdline []string) {
227227

228228
// Run the actual tests.
229229
gotest := goTool("test")
230+
// Test a single package at a time. CI builders are slow
231+
// and some tests run into timeouts under load.
232+
gotest.Args = append(gotest.Args, "-p", "1")
230233
if *coverage {
231234
gotest.Args = append(gotest.Args, "-covermode=atomic", "-cover")
232235
}

build/update-license.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ var (
4949
// don't relicense vendored sources
5050
"crypto/sha3/", "crypto/ecies/", "logger/glog/",
5151
"crypto/secp256k1/curve.go",
52-
"trie/arc.go",
5352
}
5453

5554
// paths with this prefix are licensed as GPL. all other files are LGPL.

cmd/geth/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ import (
4747
)
4848

4949
const (
50-
clientIdentifier = "Geth" // Client identifier to advertise over the network
51-
versionMajor = 1 // Major version component of the current release
52-
versionMinor = 4 // Minor version component of the current release
53-
versionPatch = 13 // Patch version component of the current release
54-
versionMeta = "stable" // Version metadata to append to the version string
50+
clientIdentifier = "Geth" // Client identifier to advertise over the network
51+
versionMajor = 1 // Major version component of the current release
52+
versionMinor = 4 // Minor version component of the current release
53+
versionPatch = 14 // Patch version component of the current release
54+
versionMeta = "prerelease" // Version metadata to append to the version string
5555

5656
versionOracle = "0xfa7b9770ca4cb04296cac84f37736d4041251cdf" // Ethereum address of the Geth release oracle
5757
)

cmd/utils/cmd.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"os"
2424
"os/signal"
2525
"regexp"
26+
"runtime"
2627

2728
"github.com/ethereum/go-ethereum/common"
2829
"github.com/ethereum/go-ethereum/core"
@@ -52,10 +53,16 @@ func openLogFile(Datadir string, filename string) *os.File {
5253
// is redirected to a different file.
5354
func Fatalf(format string, args ...interface{}) {
5455
w := io.MultiWriter(os.Stdout, os.Stderr)
55-
outf, _ := os.Stdout.Stat()
56-
errf, _ := os.Stderr.Stat()
57-
if outf != nil && errf != nil && os.SameFile(outf, errf) {
58-
w = os.Stderr
56+
if runtime.GOOS == "windows" {
57+
// The SameFile check below doesn't work on Windows.
58+
// stdout is unlikely to get redirected though, so just print there.
59+
w = os.Stdout
60+
} else {
61+
outf, _ := os.Stdout.Stat()
62+
errf, _ := os.Stderr.Stat()
63+
if outf != nil && errf != nil && os.SameFile(outf, errf) {
64+
w = os.Stderr
65+
}
5966
}
6067
fmt.Fprintf(w, "Fatal: "+format+"\n", args...)
6168
logger.Flush()

core/blockchain.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,12 @@ func (self *BlockChain) AuxValidator() pow.PoW { return self.pow }
357357

358358
// State returns a new mutable state based on the current HEAD block.
359359
func (self *BlockChain) State() (*state.StateDB, error) {
360-
return state.New(self.CurrentBlock().Root(), self.chainDb)
360+
return self.StateAt(self.CurrentBlock().Root())
361+
}
362+
363+
// StateAt returns a new mutable state based on a particular point in time.
364+
func (self *BlockChain) StateAt(root common.Hash) (*state.StateDB, error) {
365+
return self.stateCache.New(root)
361366
}
362367

363368
// Reset purges the entire blockchain, restoring it to its genesis state.

core/state/iterator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (it *NodeIterator) step() error {
7676
}
7777
// Initialize the iterator if we've just started
7878
if it.stateIt == nil {
79-
it.stateIt = trie.NewNodeIterator(it.state.trie.Trie)
79+
it.stateIt = it.state.trie.NodeIterator()
8080
}
8181
// If we had data nodes previously, we surely have at least state nodes
8282
if it.dataIt != nil {

core/state/state_object.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ type Account struct {
9595
Balance *big.Int
9696
Root common.Hash // merkle root of the storage trie
9797
CodeHash []byte
98-
99-
codeSize *int
10098
}
10199

102100
// NewObject creates a state object.
@@ -275,20 +273,9 @@ func (self *StateObject) Code(db trie.Database) []byte {
275273
return code
276274
}
277275

278-
// CodeSize returns the size of the contract code associated with this object.
279-
func (self *StateObject) CodeSize(db trie.Database) int {
280-
if self.data.codeSize == nil {
281-
self.data.codeSize = new(int)
282-
*self.data.codeSize = len(self.Code(db))
283-
}
284-
return *self.data.codeSize
285-
}
286-
287276
func (self *StateObject) SetCode(code []byte) {
288277
self.code = code
289278
self.data.CodeHash = crypto.Keccak256(code)
290-
self.data.codeSize = new(int)
291-
*self.data.codeSize = len(code)
292279
self.dirtyCode = true
293280
if self.onDirty != nil {
294281
self.onDirty(self.Address())

0 commit comments

Comments
 (0)