Skip to content

Commit e854f8d

Browse files
authored
Merge pull request #1112 from ricardolyn/upgrade/quorum-geth-1.9.8
Upgrade to geth 1.9.8
2 parents a21e1d4 + 63b65fb commit e854f8d

File tree

2,599 files changed

+3258
-1033806
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,599 files changed

+3258
-1033806
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ light/ @zsfelfoldi @rjl493456442
1616
mobile/ @karalabe @ligi
1717
p2p/ @fjl @zsfelfoldi
1818
rpc/ @fjl @holiman
19-
p2p/simulations @zelig @nonsense @janos @justelad
20-
p2p/protocols @zelig @nonsense @janos @justelad
21-
p2p/testing @zelig @nonsense @janos @justelad
19+
p2p/simulations @zelig @janos @justelad
20+
p2p/protocols @zelig @janos @justelad
21+
p2p/testing @zelig @janos @justelad
2222
signer/ @holiman
2323
whisper/ @gballet @gluk256

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
2626
- name: 'Run code linters'
2727
run: |
28-
GO111MODULE=off make lint
28+
GO111MODULE=on make lint
2929
unit-tests:
3030
name: 'Unit tests in ${{ matrix.os }}'
3131
strategy:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/**/*dapps*
1616
build/_vendor/pkg
1717
.idea
18+
*.iml
1819

1920
#*
2021
.#*
@@ -25,6 +26,7 @@ build/_vendor/pkg
2526

2627
# used by the Makefile
2728
/build/_workspace/
29+
/build/cache/
2830
/build/bin/
2931
/geth*.zip
3032

.golangci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This file configures github.com/golangci/golangci-lint.
2+
3+
run:
4+
timeout: 2m
5+
tests: true
6+
# default is true. Enables skipping of directories:
7+
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
8+
skip-dirs-use-default: true
9+
10+
linters:
11+
disable-all: true
12+
enable:
13+
- deadcode
14+
- goconst
15+
- goimports
16+
- gosimple
17+
- govet
18+
- ineffassign
19+
- misspell
20+
# - staticcheck
21+
- unconvert
22+
# - unused
23+
- varcheck
24+
25+
linters-settings:
26+
gofmt:
27+
simplify: true
28+
goconst:
29+
min-len: 3 # minimum length of string constant
30+
min-occurrences: 6 # minimum number of occurrences
31+
32+
issues:
33+
exclude-rules:
34+
- path: crypto/blake2b/
35+
linters:
36+
- deadcode
37+
- path: crypto/bn256/cloudflare
38+
linters:
39+
- deadcode
40+
- path: p2p/discv5/
41+
linters:
42+
- deadcode
43+
- path: core/vm/instructions_test.go
44+
linters:
45+
- goconst

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
os: linux
2020
dist: xenial
2121
go: 1.11.x
22+
env:
23+
- GO111MODULE=on
2224
script:
2325
- go run build/ci.go install
2426
- go run build/ci.go test -coverage $TEST_PACKAGES
@@ -27,6 +29,8 @@ jobs:
2729
os: linux
2830
dist: xenial
2931
go: 1.12.x
32+
env:
33+
- GO111MODULE=on
3034
script:
3135
- go run build/ci.go install
3236
- go run build/ci.go test -coverage $TEST_PACKAGES

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ RUN apk add --no-cache ca-certificates
1313
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
1414
COPY --from=builder /go-ethereum/build/bin/bootnode /usr/local/bin/
1515

16-
1716
EXPOSE 8545 8546 8547 30303 30303/udp
1817
ENTRYPOINT ["geth"]

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ geth:
1818

1919
bootnode:
2020
build/env.sh go run build/ci.go install ./cmd/bootnode
21-
@echo "Done building bootnode."
21+
@echo "Done building."
22+
@echo "Run \"$(GOBIN)/bootnode\" to launch bootnode."
23+
2224

2325
all:
2426
build/env.sh go run build/ci.go install
@@ -40,7 +42,7 @@ lint: ## Run linters.
4042
build/env.sh go run build/ci.go lint
4143

4244
clean:
43-
./build/clean_go_build_cache.sh
45+
go clean -cache
4446
rm -fr build/_workspace/pkg/ $(GOBIN)/*
4547

4648
# The devtools target installs tools required for 'go generate'.

accounts/abi/abi_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ func TestABI_MethodById(t *testing.T) {
927927
}
928928
b := fmt.Sprintf("%v", m2)
929929
if a != b {
930-
t.Errorf("Method %v (id %v) not 'findable' by id in ABI", name, common.ToHex(m.ID()))
930+
t.Errorf("Method %v (id %x) not 'findable' by id in ABI", name, m.ID())
931931
}
932932
}
933933
// Also test empty

accounts/abi/bind/bind.go

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,17 @@ const (
4747
// to be used as is in client code, but rather as an intermediate struct which
4848
// enforces compile time type safety and naming convention opposed to having to
4949
// manually maintain hard coded strings that break on runtime.
50-
func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]string, pkg string, lang Lang, libs map[string]string) (string, error) {
51-
// Process each individual contract requested binding
52-
contracts := make(map[string]*tmplContract)
50+
func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]string, pkg string, lang Lang, libs map[string]string, aliases map[string]string) (string, error) {
51+
var (
52+
// contracts is the map of each individual contract requested binding
53+
contracts = make(map[string]*tmplContract)
5354

54-
// Map used to flag each encountered library as such
55-
isLib := make(map[string]struct{})
55+
// structs is the map of all reclared structs shared by passed contracts.
56+
structs = make(map[string]*tmplStruct)
5657

58+
// isLib is the map used to flag each encountered library as such
59+
isLib = make(map[string]struct{})
60+
)
5761
for i := 0; i < len(types); i++ {
5862
// Parse the actual ABI to generate the binding for
5963
evmABI, err := abi.JSON(strings.NewReader(abis[i]))
@@ -73,13 +77,29 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
7377
calls = make(map[string]*tmplMethod)
7478
transacts = make(map[string]*tmplMethod)
7579
events = make(map[string]*tmplEvent)
76-
structs = make(map[string]*tmplStruct)
80+
81+
// identifiers are used to detect duplicated identifier of function
82+
// and event. For all calls, transacts and events, abigen will generate
83+
// corresponding bindings. However we have to ensure there is no
84+
// identifier coliision in the bindings of these categories.
85+
callIdentifiers = make(map[string]bool)
86+
transactIdentifiers = make(map[string]bool)
87+
eventIdentifiers = make(map[string]bool)
7788
)
7889
for _, original := range evmABI.Methods {
7990
// Normalize the method for capital cases and non-anonymous inputs/outputs
8091
normalized := original
81-
normalized.Name = methodNormalizer[lang](original.Name)
82-
92+
normalizedName := methodNormalizer[lang](alias(aliases, original.Name))
93+
// Ensure there is no duplicated identifier
94+
var identifiers = callIdentifiers
95+
if !original.Const {
96+
identifiers = transactIdentifiers
97+
}
98+
if identifiers[normalizedName] {
99+
return "", fmt.Errorf("duplicated identifier \"%s\"(normalized \"%s\"), use --alias for renaming", original.Name, normalizedName)
100+
}
101+
identifiers[normalizedName] = true
102+
normalized.Name = normalizedName
83103
normalized.Inputs = make([]abi.Argument, len(original.Inputs))
84104
copy(normalized.Inputs, original.Inputs)
85105
for j, input := range normalized.Inputs {
@@ -114,7 +134,14 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
114134
}
115135
// Normalize the event for capital cases and non-anonymous outputs
116136
normalized := original
117-
normalized.Name = methodNormalizer[lang](original.Name)
137+
138+
// Ensure there is no duplicated identifier
139+
normalizedName := methodNormalizer[lang](alias(aliases, original.Name))
140+
if eventIdentifiers[normalizedName] {
141+
return "", fmt.Errorf("duplicated identifier \"%s\"(normalized \"%s\"), use --alias for renaming", original.Name, normalizedName)
142+
}
143+
eventIdentifiers[normalizedName] = true
144+
normalized.Name = normalizedName
118145

119146
normalized.Inputs = make([]abi.Argument, len(original.Inputs))
120147
copy(normalized.Inputs, original.Inputs)
@@ -144,7 +171,6 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
144171
Transacts: transacts,
145172
Events: events,
146173
Libraries: make(map[string]string),
147-
Structs: structs,
148174
}
149175
// Function 4-byte signatures are stored in the same sequence
150176
// as types, if available.
@@ -176,6 +202,7 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
176202
Package: pkg,
177203
Contracts: contracts,
178204
Libraries: libs,
205+
Structs: structs,
179206
}
180207
buffer := new(bytes.Buffer)
181208

@@ -483,6 +510,15 @@ func namedTypeJava(javaKind string, solKind abi.Type) string {
483510
}
484511
}
485512

513+
// alias returns an alias of the given string based on the aliasing rules
514+
// or returns itself if no rule is matched.
515+
func alias(aliases map[string]string, n string) string {
516+
if alias, exist := aliases[n]; exist {
517+
return alias
518+
}
519+
return n
520+
}
521+
486522
// methodNormalizer is a name transformer that modifies Solidity method names to
487523
// conform to target language naming concentions.
488524
var methodNormalizer = map[Lang]func(string) string{

0 commit comments

Comments
 (0)