Commit Graph

13009 Commits

Author SHA1 Message Date
Alex Sharov
27a24746b7
remove GetLogsByHash (#1390) 2020-12-04 10:27:24 +00:00
Thomas Jay Rush
362e9a1773
Update docs testing (#1385)
* Remove unused files

* Updating testing definition

* Updating auto-generated docs

* Update go code to make agree with silkrpc testing
2020-12-04 10:24:49 +00:00
Igor Mandrigin
63ec2ec9f1 post-rebase fixes 2020-12-03 18:59:17 +01:00
Péter Szilágyi
dd29778fca params: release Geth v1.9.24 with Go 1.15.5 (#21842)
# Conflicts:
#	build/checksums.txt
#	build/ci.go
#	params/version.go
2020-12-03 18:59:17 +01:00
Felix Lange
bb6649feba .travis.yml: move test builders after install builders (#21833) 2020-12-03 18:59:17 +01:00
Felix Lange
4baf97ed0d build: fix regressions with the -dlgo change (#21831)
This fixes cross-build and mobile framework failures.
It also disables the mac test builder because it was failing
all the time in hard to understand ways and we can't afford
it anymore under Travis CI's new pricing.
# Conflicts:
#	build/ci.go
2020-12-03 18:59:17 +01:00
Slava Karpenko
26db7c6c22 consensus/ethash: use 64bit indexes for the DAG generation (#21793)
* Bit boundary fix for the DAG generation routine

* Fix unnecessary conversion warnings

Co-authored-by: Sergey Pavlov <spavlov@gmail.com>
2020-12-03 18:59:17 +01:00
Felix Lange
8812a67585 build: add -dlgo flag in ci.go (#21824)
This new flag downloads a known version of Go and builds with it. This
is meant for environments where we can't easily upgrade the installed Go
version.

* .travis.yml: remove install step for PR test builders

We added this step originally to avoid re-building everything
for every test. go test has become much smarter in recent go
releases, so we no longer need to install anything here.
# Conflicts:
#	build/checksums.txt
#	build/ci.go
#	internal/build/util.go
2020-12-03 18:59:17 +01:00
Marius van der Wijden
2dc9078674 fuzzers: removed fuzzbuzz configuration (#21813)
We decided to move our fuzzing efforts to oss-fuzz since fuzzbuzz is still early access.
2020-12-03 18:59:17 +01:00
Martin Holst Swende
eb6e1d6816 scripts: create oss-fuzz script in go-ethereum (#21808) 2020-12-03 18:59:17 +01:00
gary rong
a8cbb48d1e p2p/simulations/adapters/exec: fix some issues (#21801)
- Remove the ws:// prefix from the status endpoint since
  the ws:// is already included in the stack.WSEndpoint().
- Don't register the services again in the node start.
  Registration is already done in the initialization stage.
- Expose admin namespace via websocket.
  This namespace is necessary for connecting the peers via websocket.
- Offer logging relevant options for exec adapter.
  It's really painful to mix all log output in the single console. So
  this PR offers two additional options for exec adapter in this case
  testers can config the log output(e.g. file output) and log level
  for each p2p node.
2020-12-03 18:59:17 +01:00
Péter Szilágyi
7fc5fb3ce8 build: stop building for Ubuntu Eoan, not supported any more
# Conflicts:
#	build/ci.go
2020-12-03 18:59:17 +01:00
Péter Szilágyi
e7b79d75a7 travis: drop Go 1.13 builders as it's not supported any more 2020-12-03 18:59:17 +01:00
Martin Holst Swende
9534c2d38c trie, tests/fuzzers: implement a stacktrie fuzzer + stacktrie fixes (#21799)
* trie: fix error in stacktrie not committing small roots

* fuzzers: make trie-fuzzer use correct returnvalues

* trie: improved tests

* tests/fuzzers: fuzzer for stacktrie vs regular trie

* test/fuzzers: make stacktrie fuzzer use 32-byte keys

* trie: fix error in stacktrie with small nodes

* trie: add (skipped) testcase for stacktrie

* tests/fuzzers: address review comments for stacktrie fuzzer

* trie: fix docs in stacktrie
# Conflicts:
#	tests/fuzzers/trie/trie-fuzzer.go
#	trie/stacktrie.go
#	trie/stacktrie_test.go
#	trie/trie_test.go
2020-12-03 18:59:17 +01:00
Péter Szilágyi
233570c5ae core/state/snapshot: update generator marker in sync with flushes
# Conflicts:
#	core/state/snapshot/generate.go
#	core/state/snapshot/journal.go
#	core/state/snapshot/snapshot.go
2020-12-03 18:59:17 +01:00
Martin Holst Swende
50141e0d7d consensus/ethash: fix the percentage progress report 2020-12-03 18:59:17 +01:00
Péter Szilágyi
ec6f485f35 build: stop verbose output to keep travis from overflowing
# Conflicts:
#	build/ci.go
2020-12-03 18:59:17 +01:00
Martin Holst Swende
288f9bd414 core/types, rlp: optimize derivesha (#21728)
This PR contains a minor optimization in derivesha, by exposing the RLP
int-encoding and making use of it to write integers directly to a
buffer (an RLP integer is known to never require more than 9 bytes
total). rlp.AppendUint64 might be useful in other places too.

The code assumes, just as before, that the hasher (a trie) will copy the
key internally, which it does when doing keybytesToHex(key).

Co-authored-by: Felix Lange <fjl@twurst.com>
# Conflicts:
#	core/types/derive_sha.go
2020-12-03 18:59:17 +01:00
rene
040dcebf57 cmd/devp2p/internal/ethtest: add correct chain files and improve test output (#21782)
This PR replaces the old test genesis.json and chain.rlp files in the testdata
directory for the eth protocol test suite, and also adds documentation for
running the eth test suite locally.

It also improves the test output text and adds more timeouts.

Co-authored-by: Felix Lange <fjl@twurst.com>
# Conflicts:
#	cmd/devp2p/internal/ethtest/suite.go
2020-12-03 18:59:17 +01:00
Felix Lange
6dee5bbdb5 cmd/devp2p, internal/utesting: implement TAP output (#21760)
TAP is a text format for test results. Parsers for it are available in many languages,
making it easy to consume. I want TAP output from our protocol tests because the
Hive wrapper around them needs to know about the test names and their individual
results and logs. It would also be possible to just write this info as JSON, but I don't
want to invent a new format.

This also improves the normal console output for tests (when running without --tap).
It now prints -- RUN lines before any output from the test, and indents the log output
by one space.
# Conflicts:
#	cmd/devp2p/discv4cmd.go
#	cmd/devp2p/discv5cmd.go
#	cmd/devp2p/rlpxcmd.go
2020-12-03 18:59:17 +01:00
gary rong
d474b21f4b core/state/snapshot: fix journal recovery from generating old journal (#21775)
* core/state/snapshot: print warning if failed to resolve journal

* core/state/snapshot: fix snapshot recovery

When we meet the snapshot journal consisted with:
- disk layer generator with new-format
- diff layer journal with old-format

The base layer should be returned without error.
The broken diff layer can be reconstructed later
but we definitely don't want to reconstruct the
huge diff layer.

* core: add tests
# Conflicts:
#	core/state/snapshot/journal.go
2020-12-03 18:59:17 +01:00
Marius van der Wijden
4f2558be98 common: remove ToHex and ToHexArray (#21610)
ToHex was deprecated a couple years ago. The last remaining use
was in ToHexArray, which itself only had a single call site.

This just moves ToHexArray near its only remaining call site and
implements it using hexutil.Encode. This changes the default behaviour
of ToHexArray and with it the behaviour of eth_getProof. Previously we
encoded an empty slice as 0, now the empty slice is encoded as 0x.
# Conflicts:
#	common/bytes.go
#	internal/ethapi/api.go
2020-12-03 18:59:17 +01:00
gary rong
0a48344dfe les, p2p/simulations/adapters: fix issues found while simulating les (#21761)
This adds a few tiny fixes for les and the p2p simulation framework:

LES Parts

- Keep the LES-SERVER connection even it's non-synced

  We had this idea to reject the connections in LES protocol if the les-server itself is
  not synced. However, in LES protocol we will also receive the connection from another
  les-server. In this case even the local node is not synced yet, we should keep the tcp
  connection for other protocols(e.g. eth protocol).

- Don't count "invalid message" for non-existing GetBlockHeadersMsg request

  In the eth syncing mechanism (full sync, fast sync, light sync), it will try to fetch
  some non-existent blocks or headers(to ensure we indeed download all the missing chain).
  In this case, it's possible that the les-server will receive the request for
  non-existent headers. So don't count it as the "invalid message" for scheduling
  dropping.

- Copy the announce object in the closure

  Before the les-server pushes the latest headers to all connected clients, it will create
  a closure and queue it in the underlying request scheduler. In some scenarios it's
  problematic. E.g, in private networks, the block can be mined very fast. So before the
  first closure is executed, we may already update the latest_announce object. So actually
  the "announce" object we want to send is replaced.

  The downsize is the client will receive two announces with the same td and then drop the
  server.

P2P Simulation Framework

- Don't double register the protocol services in p2p-simulation "Start".

  The protocols upon the devp2p are registered in the "New node stage". So don't reigster
  them again when starting a node in the p2p simulation framework

- Add one more new config field "ExternalSigner", in order to use clef service in the
  framework.

# Conflicts:
#	les/server_handler.go
2020-12-03 18:59:17 +01:00
gary rong
89b2ff6097 core: improve snapshot journal recovery (#21594)
* core/state/snapshot: introduce snapshot journal version

* core: update the disk layer in an atomic way

* core: persist the disk layer generator periodically

* core/state/snapshot: improve logging

* core/state/snapshot: forcibly ensure the legacy snapshot is matched

* core/state/snapshot: add debug logs

* core, tests: fix tests and special recovery case

* core: polish

* core: add more blockchain tests for snapshot recovery

* core/state: fix comment

* core: add recovery flag for snapshot

* core: add restart after start-after-crash tests

* core/rawdb: fix imports

* core: fix tests

* core: remove log

* core/state/snapshot: fix snapshot

* core: avoid callbacks in SetHead

* core: fix setHead cornercase where the threshold root has state

* core: small docs for the test cases

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
# Conflicts:
#	core/blockchain.go
#	core/blockchain_repair_test.go
#	core/blockchain_sethead_test.go
#	core/rawdb/accessors_snapshot.go
#	core/rawdb/schema.go
#	core/state/snapshot/disklayer_test.go
#	core/state/snapshot/generate.go
#	core/state/snapshot/journal.go
#	core/state/snapshot/snapshot.go
#	tests/state_test_util.go
2020-12-03 18:59:17 +01:00
gary rong
ee91b3e5ee core/state: disable snapshot iteration if it's not fully constructed (#21682)
* core/state/snapshot: add diskRoot function

* core/state/snapshot: disable iteration if the snapshot is generating

* core/state/snapshot: simplify the function

* core/state: panic for undefined layer
# Conflicts:
#	core/state/snapshot/snapshot.go
2020-12-03 18:59:17 +01:00
gary rong
42f8bcb3d4 core/state: maintain one more diff layer (#21730)
* core/state: maintain one more diff layer

* core/state: address comment
# Conflicts:
#	core/state/statedb.go
2020-12-03 18:59:17 +01:00
Marius van der Wijden
b6cdfa9307 accounts/abi/bind: restore error functionality (#21743)
* accounts/abi/bind: restore error functionality

* Update accounts/abi/bind/base.go

Co-authored-by: Guillaume Ballet <gballet@gmail.com>

Co-authored-by: Guillaume Ballet <gballet@gmail.com>
2020-12-03 18:59:17 +01:00
James Prestwich
8c4ecebbfe cmd/geth: fix dir path in geth attach for yolov2 network (#21749)
# Conflicts:
#	cmd/geth/consolecmd.go
2020-12-03 18:59:17 +01:00
Martin Holst Swende
3e6100fe4f params: update yolov2 bootnode with elastic ip 2020-12-03 18:59:17 +01:00
Martin Holst Swende
39c494f4f3 utils, params: add yolov2 bootnode 2020-12-03 18:59:17 +01:00
Felix Lange
eb955580c0 cmd/devp2p/internal/ethtest: update test chain (#21742)
The old one was wrong in two ways: the first block in chain.rlp was the
genesis block, and the genesis difficulty was below minimum difficulty.

This also contains some other fixes to the test.
2020-12-03 18:59:17 +01:00
Igor Mandrigin
5d98f8d40d post-rebase. fix imports 2020-12-03 17:37:38 +01:00
Martin Holst Swende
ca3d54a32c all: implement EIP-2929 (gas cost increases for state access opcodes) + yolo-v2 (#21509)
* core/vm, core/state: implement EIP-2929 + YOLOv2

* core/state, core/vm: fix some review concerns

* core/state, core/vm: address review concerns

* core/vm: address review concerns

* core/vm: better documentation

* core/vm: unify sload cost as fully dynamic

* core/vm: fix typo

* core/vm/runtime: fix compilation flaw

* core/vm/runtime: fix renaming-err leftovers

* core/vm: renaming

* params/config: use correct yolov2 chainid for config

* core, params: use a proper new genesis for yolov2

* core/state/tests: golinter nitpicks
# Conflicts:
#	cmd/evm/internal/t8ntool/execution.go
#	cmd/geth/chaincmd.go
#	cmd/geth/consolecmd.go
#	cmd/geth/main.go
#	cmd/geth/usage.go
#	cmd/utils/flags.go
#	core/state/statedb.go
#	core/state/statedb_test.go
#	core/vm/evm.go
#	core/vm/interpreter.go
#	core/vm/logger.go
#	core/vm/runtime/runtime.go
#	eth/api_tracer.go
2020-12-03 17:37:38 +01:00
Igor Mandrigin
c52f9e8196 add to-merge.txt 2020-12-03 17:37:38 +01:00
Kristofer Peterson
d526984025 accounts/usbwallet: fix ledger version check (#21733)
The version check logic did not take into account the second digit (i.e. the '4' in v1.4.0) - this one line patch corrects this.
2020-12-03 17:37:38 +01:00
hwanjo
7929173dfd core: fix blockchain insert report time interval calculation (#21723) 2020-12-03 17:37:38 +01:00
Felföldi Zsolt
8effe4cb28 les: remove clientPeerSet and serverSet (#21566)
* les: move NodeStateMachine from clientPool to LesServer

* les: new header broadcaster

* les: peerCommons.headInfo always contains last announced head

* les: remove clientPeerSet and serverSet

* les: fixed panic

* les: fixed --nodiscover option

* les: disconnect all peers at ns.Stop()

* les: added comments and fixed signed broadcasts

* les: removed unused parameter, fixed tests
# Conflicts:
#	les/client_handler.go
#	les/clientpool.go
#	les/clientpool_test.go
#	les/enr_entry.go
#	les/lespay/server/prioritypool.go
#	les/peer.go
#	les/protocol.go
#	les/server.go
#	les/server_handler.go
#	les/test_helper.go
2020-12-03 17:37:38 +01:00
aaronbuchwald
07aefb98c3 eth/api: fix potential nil deref in AccountRange (#21710)
* Fix potential nil pointer error when neither block number nor hash is specified to accountRange

* Update error description
# Conflicts:
#	eth/api.go
2020-12-03 17:37:38 +01:00
gary rong
8b493c2895 core: track and improve tx indexing/unindexing (#21331)
* core: add background indexer to waitgroup

* core: make indexer stopable

* core/rawdb: add unit tests

* core/rawdb: fix lint

* core/rawdb: fix tests

* core/rawdb: fix linter
# Conflicts:
#	core/blockchain.go
#	core/rawdb/chain_iterator.go
#	core/rawdb/chain_iterator_test.go
2020-12-03 17:37:38 +01:00
Marius van der Wijden
809bb24399 miner: fixed race condition in tests (#21664)
# Conflicts:
#	miner/miner_test.go
2020-12-03 17:37:38 +01:00
rene
1afdd6bcc0 console: don't exit on ctrl-c, only on ctrl-d (#21660)
* add interrupt counter

* remove interrupt counter, allow ctrl-C to clear ONLY, ctrl-D will terminate console, stop node

* format

* add instructions to exit

* fix tests
# Conflicts:
#	cmd/geth/consolecmd_test.go
#	console/console.go
2020-12-03 17:37:38 +01:00
Marius van der Wijden
f68ac9d1c3 core/vm: marshall returnData as hexstring in trace logs (#21715)
* core/vm: marshall returnData as hexstring in trace logs

* core/vm: marshall returnData as hexstring in trace logs
# Conflicts:
#	core/vm/gen_structlog.go
2020-12-03 17:37:38 +01:00
Felix Lange
a20f00d918 params: begin v1.9.24 release cycle
# Conflicts:
#	params/version.go
2020-12-03 17:37:38 +01:00
Igor Mandrigin
f787c24ba8 begin 2020.12.2 release cycle 2020-12-03 10:37:11 +01:00
Igor Mandrigin
7026c4fefe update skip_analysis 2020-12-03 09:55:00 +01:00
ledgerwatch
8d2db43e2b
Fix for slow stage3 (#1377)
* Fix for slow stage3

* Cache sequence

* Small optimisation

* mutation sequence lock and sequence(0) use read transaction

* tx

* Fixes

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
2020-11-30 11:49:52 +00:00
Alex Sharov
ed2b36ff04
log db size if stage took longer than 1Minute (#1378)
* log db size

* log db size
2020-11-30 08:58:06 +00:00
ledgerwatch
9a233da93d
Add test for getChainConfig (#1375)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2020-11-28 15:08:17 +00:00
Andrew Ashikhmin
8a877c227a
Integrate Silkworm execution (#1344)
* Expose C Handle of lmdbTx

* LoadExecutionFunctionPointer

* silkworm ExecuteBlocks

* linter

* CLI flag for SilkwormExecutionFunc

* linter

* Call SilkwormExecutionFunc in SpawnExecuteBlocksStage

* Commit transaction after Silkworm execution

* Fix batch initialization

* Make batch_size uint64_t instead of size_t

* max_block in silkworm_execute_blocks

* More accurate logProgress

* Use CHandle exposed by lmdb-go

* Enable Silkworm on Linux only

* Update lmdb-go

* Error when attempting to use Silkworm not on Linux

* Move SilkwormFlag from cmd/utils/flags.go to turbo/cli/flags.go

* Integrate Silkworm into cmd/integration

* Check against ReaderBuilder/WriterBuilder/ChangeSetHook in Silkworm execution

* Refactor SpawnExecuteBlocksStage

* linters

* Small clean-ups

* Move ChangeSetHook inside executeBlockWithGo

* No need to tamper with batch size in executeBlocksWithSilkworm

* fix

* Fix

* Fixup

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2020-11-28 15:08:02 +00:00
Alex Sharov
4565bd43c1
Mdbx v0.9.2 (#1373)
* up devel

* up devel

* up devel

* up devel

* up devel

* up devel

* up devel

* up devel

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* switch to master

* mdbx 0.9.2

* mdbx 0.9.2

* %<<$!%%%%%%<o'{}k.###

* %<<$!%%%%%%<o'{}k.###

* merge

* merge

* merge

* merge

* ad

* ad

* ad

* ad
2020-11-28 14:26:28 +00:00