Commit Graph

47 Commits

Author SHA1 Message Date
gary rong
99033c6c57 trie: fix gaped range proof test case (#21484)
# Conflicts:
#	trie/proof_test.go
2020-10-06 14:12:09 +02:00
Binacs
f4397a3485 cmd/clef, cmd/geth: use SplitAndTrim from cmd/utils (#21579)
# Conflicts:
#	cmd/geth/retesteth.go
#	cmd/utils/flags.go
2020-10-06 14:12:09 +02:00
rene
d57fb49ed3 p2p: move rlpx into separate package (#21464)
This change moves the RLPx protocol implementation into a separate package,
p2p/rlpx. The new package can be used to establish RLPx connections for
protocol testing purposes.

Co-authored-by: Felix Lange <fjl@twurst.com>
# Conflicts:
#	p2p/rlpx/rlpx.go
#	p2p/rlpx/rlpx_test.go
#	p2p/server_test.go
2020-10-06 14:12:09 +02:00
Marius van der Wijden
6149347099 mobile: better api for java users (#21580)
* (mobile): Adds string representations for types

* mobile: better interfaces add stringer to types

Co-authored-by: sarath <sarath@melvault.com>
# Conflicts:
#	go.mod
#	go.sum
#	mobile/common.go
#	mobile/geth.go
#	mobile/types.go
2020-10-06 14:12:09 +02:00
Guillaume Ballet
822244dcd4 core: fix a typo in comment (#21439)
# Conflicts:
#	core/block_validator.go
2020-10-06 14:12:09 +02:00
Giuseppe Bertone
33f3cbacf4 cmd/geth: added counters to the geth inspect report (#21495)
* database: added counters

* Improved stats for ancient db

* Small improvement

* Better message and added percentage while counting receipts

* Fast counting for receipts

* added info message

* Show both receips itemscount  from ancient db and counted receipts

* Fixed default case

* Removed counter for receipts in ancient store

* Removed counting of receipts present in leveldb
# Conflicts:
#	core/rawdb/database.go
2020-10-06 14:12:09 +02:00
Marius van der Wijden
1f0014a34e cmd/utils: use preconfigured testnet flags instead of networkid (#21561)
* cmd/utils: use preconfigured testnet flags instead of networkid

* cmd/utils: shorter description

Co-authored-by: Martin Holst Swende <martin@swende.se>

* Update flags.go

Co-authored-by: Martin Holst Swende <martin@swende.se>
# Conflicts:
#	cmd/utils/flags.go
2020-10-06 14:12:09 +02:00
Marius van der Wijden
f6c97d1df1 tests/fuzzers/abi: add fuzzer for fuzzing package accounts/abi (#21217)
* tests/fuzzers/abi: added abi fuzzer

* accounts/abi: fixed issues found by fuzzing

* tests/fuzzers/abi: update fuzzers, added repro test

* tests/fuzzers/abi: renamed abi_fuzzer to abifuzzer

* tests/fuzzers/abi: updated abi fuzzer

* tests/fuzzers/abi: updated abi fuzzer

* accounts/abi: minor style fix

* go.mod: added go-fuzz dependency

* tests/fuzzers/abi: updated abi fuzzer

* tests/fuzzers/abi: make linter happy

* tests/fuzzers/abi: make linter happy

* tests/fuzzers/abi: comment out false positives
# Conflicts:
#	go.mod
#	go.sum
2020-10-06 14:12:09 +02:00
gary rong
1240e7bcac les/lespay/server: bump database version (#21571)
# Conflicts:
#	les/lespay/server/clientdb.go
2020-10-06 14:12:09 +02:00
Giuseppe Bertone
1af24a80bd core/rawdb: single point of maintenance for writing and deleting tx lookup indexes (#21480)
# Conflicts:
#	core/blockchain.go
#	core/rawdb/accessors_indexes.go
#	core/rawdb/accessors_indexes_test.go
#	core/rawdb/chain_iterator.go
#	light/txpool.go
2020-10-06 14:12:09 +02:00
Martin Holst Swende
c0a60c5f44 eth/tracers: regenerate assets from #21549 (#21564)
# Conflicts:
#	eth/tracers/internal/tracers/assets.go
2020-10-06 14:12:09 +02:00
Felföldi Zsolt
f4d9f05acf les, les/lespay/server: refactor client pool (#21236)
* les, les/lespay/server: refactor client pool

* les: use ns.Operation and sub calls where needed

* les: fixed tests

* les: removed active/inactive logic from peerSet

* les: removed active/inactive peer logic

* les: fixed linter warnings

* les: fixed more linter errors and added missing metrics

* les: addressed comments

* cmd/geth: fixed TestPriorityClient

* les: simplified clientPool state machine

* les/lespay/server: do not use goroutine for balance callbacks

* internal/web3ext: fix addBalance required parameters

* les: removed freeCapacity, always connect at minCapacity initially

* les: only allow capacity change with priority status

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
# Conflicts:
#	cmd/geth/les_test.go
#	les/api.go
#	les/api_test.go
#	les/clientpool.go
#	les/clientpool_test.go
#	les/metrics.go
#	les/peer.go
#	les/server.go
#	les/server_handler.go
#	les/test_helper.go
#	les/utils/expiredvalue.go
2020-10-06 14:12:09 +02:00
Julian Koh
db4861b9f9 js/tracers: make calltracer report value in selfdestructs (#21549) 2020-10-06 14:12:09 +02:00
Felföldi Zsolt
d55e519f23 p2p/nodestate: ensure correct callback order (#21436)
This PR adds an extra guarantee to NodeStateMachine: it ensures that all
immediate effects of a certain change are processed before any subsequent
effects of any of the immediate effects on the same node. In the original
version, if a cascaded change caused a subscription callback to be called
multiple times for the same node then these calls might have happened in a
wrong chronological order.

For example:

- a subscription to flag0 changes flag1 and flag2
- a subscription to flag1 changes flag3
- a subscription to flag1, flag2 and flag3 was called in the following order:

   [flag1] -> [flag1, flag3]
   [] -> [flag1]
   [flag1, flag3] -> [flag1, flag2, flag3]

This happened because the tree of changes was traversed in a "depth-first
order". Now it is traversed in a "breadth-first order"; each node has a
FIFO queue for pending callbacks and each triggered subscription callback
is added to the end of the list. The already existing guarantees are
retained; no SetState or SetField returns until the callback queue of the
node is empty again. Just like before, it is the responsibility of the
state machine design to ensure that infinite state loops are not possible.
Multiple changes affecting the same node can still happen simultaneously;
in this case the changes can be interleaved in the FIFO of the node but the
correct order is still guaranteed.

A new unit test is also added to verify callback order in the above scenario.
# Conflicts:
#	les/serverpool.go
#	p2p/nodestate/nodestate.go
#	p2p/nodestate/nodestate_test.go
2020-10-06 14:12:09 +02:00
Shude Li
3e6820d863 Dockerfile: unexpose port 8547 as GraphQL was merged into HTTP endpoint (#21556)
# Conflicts:
#	Dockerfile
#	Dockerfile.alltools
2020-10-06 14:12:09 +02:00
Marius van der Wijden
ca6b1bcea5 miner: use channels instead of atomics in update loop (#21536)
This PR changes several different things:

- Adds test cases for the miner loop
- Stops the worker if it wasn't already stopped in worker.Close()
- Uses channels instead of atomics in the miner.update() loop

Co-authored-by: Felix Lange <fjl@twurst.com>
# Conflicts:
#	miner/miner.go
2020-10-06 14:12:09 +02:00
Guillaume Ballet
acb354ab33 cmd/geth: print warning when whisper config is present in toml (#21544)
* cmd/geth: print warning when whisper config is present in toml

* Update cmd/geth/config.go

Co-authored-by: Martin Holst Swende <martin@swende.se>
# Conflicts:
#	cmd/geth/config.go
2020-10-06 14:12:09 +02:00
Shude Li
c6a6a1e691 go.mod: remove golang.org/x/sync (#21541)
# Conflicts:
#	go.mod
2020-10-06 14:12:09 +02:00
Marius van der Wijden
73fa175bd1 accounts/abi/bind/backends: reverted some stylistic changes (#21535)
# Conflicts:
#	accounts/abi/bind/backends/simulated.go
2020-10-06 14:12:09 +02:00
Péter Szilágyi
c1adde387e params: begin v1.9.22 release cycle
# Conflicts:
#	params/version.go
2020-10-06 14:12:09 +02:00
Igor Mandrigin
ab797a9909 add to-merge 2020-10-06 14:12:09 +02:00
Igor Mandrigin
0dae3ade0d post-rebase fixups 2020-05-20 15:26:22 +03:00
gary rong
2b9820a167 les: drop the message if the entire p2p connection is stuck (#21033)
* les: drop the message if the entire p2p connection is stuck

* les: fix lint
# Conflicts:
#	les/peer.go
#	les/server_handler.go
2020-05-20 15:26:22 +03:00
AusIV
2060287625 core/rawdb: stop freezer process as part of freezer.Close() (#21010)
* core/rawdb: Stop freezer process as part of freezer.Close()

When you call db.Close(), it was closing the leveldb database first,
then closing the freezer, but never stopping the freezer process.
This could cause the freezer to attempt to write to leveldb after
leveldb had been closed, leading to a crash with a non-zero exit code.

This change adds a quit channel to the freezer, and freezer.Close()
will not return until the freezer process has stopped.

Additionally, when you call freezerdb.Close(), it will close the
AncientStore before closing leveldb, to ensure that the freezer goroutine
will be stopped before leveldb is closed.

* core/rawdb: Fix formatting for golint

* core/rawdb: Use backoff flag to avoid repeating select

* core/rawdb: Include accidentally omitted backoff
# Conflicts:
#	core/rawdb/database.go
#	core/rawdb/freezer.go
2020-05-20 15:26:22 +03:00
Péter Szilágyi
27063780f4 core/state: make GetCodeSize mirror GetCode implementation wise
# Conflicts:
#	core/state/state_object.go
#	core/state/statedb.go
2020-05-20 15:26:22 +03:00
Martin Holst Swende
4b33806719 core/state: avoid statedb.dbErr due to emptyCode (#21051)
* core/state: more verbose stateb errors

* core/state: fix flaw

* core/state: fixed lint

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
# Conflicts:
#	core/state/statedb.go
2020-05-20 15:26:22 +03:00
Martin Holst Swende
dc5eee4860 core/state: abort commit if read errors have occurred (#21039)
This finally adds the error check that the documentation of StateDB.dbErr
promises to do. dbErr was added in 9e5f03b6c (June 2017), and the check was
already missing in that commit. We somehow survived without it for three years.
# Conflicts:
#	core/state/statedb.go
#	core/state/statedb_test.go
2020-05-20 15:26:22 +03:00
Martin Holst Swende
ab83455837 core/state: include zero-address in state dump if present (#21038)
* Include 0x0000 address into the dump if it is present

* core/state: go fmt

Co-authored-by: Alexey Akhunov <akhounov@gmail.com>
# Conflicts:
#	core/state/dump.go
2020-05-20 15:26:22 +03:00
gary rong
cd6eacfd2c core/state/snapshot: fix typo (#21037)
# Conflicts:
#	core/state/snapshot/difflayer.go
2020-05-20 15:26:22 +03:00
Péter Szilágyi
f30a6fd32a core/state/snapshot: don't create storage list for non-existing accounts
# Conflicts:
#	core/state/snapshot/difflayer.go
2020-05-20 15:26:22 +03:00
gary rong
f0ffa8a8b4 trie: fix TestBadRangeProof unit test (#21034)
# Conflicts:
#	trie/proof_test.go
2020-05-20 15:26:22 +03:00
Péter Szilágyi
3bea6f911c core/state/snapshot: release iterator after verification 2020-05-20 15:26:22 +03:00
Boqin Qin
4d10d64a2f les: remove invalid use of t.Fatal in TestHandshake (#21012)
# Conflicts:
#	les/peer_test.go
2020-05-20 15:26:22 +03:00
gary rong
434245bb01 core/state/snapshot: fix trie generator reporter (#21004)
# Conflicts:
#	core/state/snapshot/conversion.go
#	go.sum
2020-05-20 15:26:22 +03:00
Péter Szilágyi
5f3bcbe1c3 core/state/snapshot: fix journal nil deserialziation
# Conflicts:
#	core/state/snapshot/journal.go
2020-05-20 15:26:22 +03:00
gary rong
91061d043e core/state/snapshot: fix binary iterator (#20970)
# Conflicts:
#	core/state/snapshot/iterator_binary.go
#	core/state/snapshot/iterator_test.go
2020-05-20 15:26:22 +03:00
gary rong
126d94fa7c trie: initial implementation for range proof (#20908)
* trie: initial implementation for range proof

* trie: add benchmark

* trie: fix lint

* trie: fix minor issue

* trie: unset the edge valuenode as well

* trie: unset the edge valuenode as nilValuenode
# Conflicts:
#	les/odr_requests.go
#	trie/proof.go
#	trie/proof_test.go
2020-05-20 15:26:22 +03:00
Martin Holst Swende
e0f33c2abb core/state/snapshot: make difflayer account iterator seek operation inclusive
# Conflicts:
#	core/state/snapshot/iterator.go
#	core/state/snapshot/iterator_test.go
2020-05-20 15:26:22 +03:00
Boqin Qin
94abaf9542 snapshot: add Unlock before return (#20948)
* Forget Unlock in snapshot

* Remove Unlock before panic
# Conflicts:
#	core/state/snapshot/iterator.go
2020-05-20 15:26:22 +03:00
Igor Mandrigin
ef737c457a add to-merge 2020-05-20 15:26:22 +03:00
Igor Mandrigin
8dfcb25e84 post-rebase: remove file 2020-03-16 16:40:19 +03:00
gary rong
4817b0a327 les: separate peer into clientPeer and serverPeer (#19991)
* les: separate peer into clientPeer and serverPeer

* les: address comments
2020-03-16 16:40:19 +03:00
Igor Mandrigin
d9f70be2b3 add to-merge.txt 2020-03-16 16:40:19 +03:00
Igor Mandrigin
785d0eafd8 post-rebase fixups v1.9.10 2020-01-30 13:36:30 +02:00
gary rong
05452032db core: fix chain indexer unit test (#20506) 2020-01-30 13:36:30 +02:00
wangxiang
6e28a428a8 whisper/whisperv6: fix peer time.Ticker leak (#20520) 2020-01-30 13:36:30 +02:00
Igor Mandrigin
81a02dd88c to-merge added 2020-01-30 13:36:30 +02:00