Commit Graph

536 Commits

Author SHA1 Message Date
ledgerwatch
7eefcbe6a6
fix RPC notification, add boilerplate for tests (#1936)
* fix RPC notification, add boilerplate for tests

* Fix test

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2021-05-14 22:16:16 +01:00
Alex Sharov
2ff6ce7d92
move staged sync to tx (#1897) 2021-05-14 18:00:20 +07:00
ledgerwatch
9fa21db40e
Qucker reaction to new block headers (#1894)
* Qucker reaction to new block headers

* Always print header lag

* Print verification time

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2021-05-06 19:40:12 +01:00
Alex Sharov
c7eedf0091
Add kv to stage settings (because it doesn't change in runtime, tx will be passed as Stage func argument) (#1872)
* add kv to config

* move forward tx use

* move forward tx use

* gc stat

* gc stat

* changeset writer - move to tx

* clean

* clean

* clean

* clean

* clean
2021-05-04 13:36:03 +01:00
Alex Sharov
aacc457ea8
rawdb deprecated methods with Database interface (#1854) 2021-05-01 14:42:23 +07:00
ledgerwatch
34c1fdac21
Aleut fix for GASPRICE opcode (#1852)
* Aleut fix for GASPRICE opcode

* Fix for tip+basefee > feecap

* Unbork

* Fix tests

* Remove setHead test

* Test fix

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2021-04-30 19:20:18 +01:00
ledgerwatch
03beaf4df7
Connect txPool to download.v2 to resolve 1 reason for "frozen download" (#1830)
* Pass txPool into new staged sync

* Remove poolStart function

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-04-27 16:37:03 +01:00
Alex Sharov
10c41491fa
Use Config struct for headers/body/senders stages. Add StageSenders to new downloader. (#1787)
* config for headers/body/senders

* clean
2021-04-23 16:16:45 +07:00
ledgerwatch
12cde41772
Aleut support (Eip1559) (#1704)
* Where I am at

* Refactoring of transaction types

* More refactoring

* Use Homested signer in rpc daemon

* Unified signer

* Continue unified signer

* A bit more

* Fixes and down the rabbit hole...

* More tx pool fixes

* More refactoring fixes

* More fixes'

* more fixes

* More fixes

* More compile fixes

* More RLP hand-writing

* Finish RLP encoding/decoding of transactions

* Fixes to header encoding, start on protocol packets

* Transaction decoding

* Use DecodeTransaction function

* Decoding BlockBodyPacket

* Encode and decode for pool txs

* Start fixing tests

* Introduce SigningHash

* Fixes to SignHash

* RLP encoding fixes

* Fixes for encoding/decoding

* More test fixes

* Fix more tests

* More test fixes

* More test fixes

* Fix core tests

* More fixes for signer

* Fix for tx

* Fixes to string encoding/size

* Fix eip2930 test

* Fix rest of ./tests

* More fixes

* Fix compilation

* More test fixes

* More test fixes

* Test fixes

* More fixes

* Reuse EncodingSize in EncodeRLP for accessList

* Rearrange things in dynamic fee tx

* Add MarshalBinary

* More fixes

* Make V,R,S non-pointers

* More NPE fixes

* More fixes

* Receipt fixes

* Fix core/types

* Fix ./eth

* More compile fixes for tests

* More test fixes

* More test fixes

* Try to see lint errors better

* Try to see lint errors better

* Fix lint

* Debugging eip1559 test

* Fix TestEIP1559Transition test

* Fix NewBlockPacket encoding/decoding

* Fix calculation of TxHash

* Fix perf problem with senders

* Update aleut config values

* Try adding static peers

* Add staticpeers to defaul flags

* Change aleut networkID

* Fix test

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-04-22 18:11:37 +01:00
Alex Sharov
4b803bfa6a
Notify RPCDaemon after sync cycle commit (#1772) 2021-04-21 17:58:23 +07:00
Artem Vorotnikov
9a3e47a498
Remove StateCache where unused (#1770) 2021-04-21 16:14:23 +07:00
Alex Sharov
bf1c219531
Move txPool.Get method behind direct-grpc (#1760) 2021-04-20 21:41:46 +07:00
Alex Sharov
bf6f042a5d
Start mining on new tx (#1740) 2021-04-20 09:12:08 +07:00
Evgeny Danilenko
17c07c50a5
Move clique buckets to separate DB (#1703)
* debug

* debug

* it works

* rename clique bucket

* remove genesis special case

* copy snapshot

* remove debug

* migration

* debug

* regenerate snapshots

* simplify

* regeneration

* after merge

* tests

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-04-19 22:58:05 +01:00
Alex Sharov
2050127f01
Remove eth64 (#1715) 2021-04-13 21:48:36 +07:00
Alex Sharov
9527671e5e
Remove blockchain object step3 (#1684) 2021-04-07 12:38:43 +07:00
Alex Sharov
a913ae8847
Remove chainContext object (#1683) 2021-04-06 16:52:53 +07:00
Alex Sharov
cc539ce266
Remove blockchain.InsertChain method (#1681) 2021-04-06 12:06:07 +07:00
Alex Sharov
eb1897cb7d
remove blockchain.InsertChain call from downloader (#1674) 2021-04-05 13:00:54 +07:00
Artem Vorotnikov
dbc0db0856
Nuke old miner and mux (#1666) 2021-04-03 13:09:31 +07:00
Artem Vorotnikov
1bedfc1965
Nuke remnants of non-staged-sync modes (#1664) 2021-04-03 08:48:57 +07:00
Alex Sharov
dcd081412e
remove unused metrics (#1643) 2021-03-31 16:24:39 +07:00
Artem Vorotnikov
9b8cdc0f22
Fix lints and remove more unused code (#1621) 2021-03-29 10:58:45 +07:00
Alex Sharov
0685250095
metrics for header/body/exec stages (#1618) 2021-03-28 21:40:42 +07:00
Alex Sharov
8ccc6b2664
Mining: remove local pow mining (from ethash), --miner.notify is required now, cycle is non-blocking now (#1617) 2021-03-28 21:40:27 +07:00
ledgerwatch
270f866b06
rpctest commands to support block ranges, integration tool to allow tx tracing into files (#1616)
* block range options for rpctest

* convert bench8 to fastjson

* Add txtrace to integration tool

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-03-27 21:43:38 +00:00
Artem Vorotnikov
e67be2b1be
Remove unused code (#1604)
* Remove graphql, legacy options

* Remove CODEOWNERS

* Remove EWASM and custom EVM interpreter
2021-03-26 09:08:01 +07:00
ledgerwatch
69702c8235
Correct forkID computation in sentry, use blocks prefetched by NewBlockPacket, Fix NaN delivery speed output (#1596)
* Use proper forkID

* Remove NaN from Write block bodies messages

* Move Prefetched blocks

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-03-24 09:46:31 +00:00
Alex Sharov
aff859edc0
Mining stage (#1554) 2021-03-23 16:00:07 +07:00
Alex Sharov
91e4126ca7
db commit - remove unused return param (#1584) 2021-03-22 19:41:52 +07:00
ledgerwatch
81ea5bab78
More updates to downloader, new p2psentry protocol (#1559)
* Initial commit

* Add sentry gRPC interface

* p2psentry directory

* Update README.md

* Update README.md

* Update README.md

* Add go package

* Correct syntax

* add external downloader interface (#2)

* Add txpool (#3)

* Add private API (#4)

* Invert control.proto, add PeerMinBlock, Separare incoming Tx message into a separate stream (#5)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Separate upload messages into its own stream (#6)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Only send changed accounts to listeners (#7)

* Txpool interface doc (#9)

* More additions

* More additions

* Fix locking

* Intermediate

* Fix separation of phases

* Intermediate

* Fix test

* More transformations

* New simplified way of downloading headers

* Fix hard-coded header sync

* Fixed syncing near the tip of the chain

* Add architecture diagram source and picture (#10)

* More fixes

* rename tip to link

* Use preverified hashes instead of preverified headers

* Fix preverified hashes generation

* more parametrisation

* Continue parametrisation

* Fix grpc data limit, interruption of headers stage

* Add ropsten preverified hashes

* Typed hashes (#11)

* Typed hashes

* Fix PeerId

* 64-bit tx nonce

* Disable penalties

* Add goerli settings, bootstrap nodes

* Try to fix goerly sync

* Remove interfaces

* Add proper golang packages, max_block into p2p sentry Status

* Prepare for proto overhaul

* Squashed 'interfaces/' content from commit ce36053c2

git-subtree-dir: interfaces
git-subtree-split: ce36053c24db2f56e48ac752808de60afa1dfb4b

* Change EtherReply to address

* Adaptations to new types

* Switch to new types

* Fixes

* Fix formatting

* Fix lint

* Lint fixes, reverse order in types

* Fix lint

* Fix lint

* Fix lint

* Fix test

* Not supporting eth/66 yet

* Fix shutdown

* Fix lint

* Fix lint

* Fix lint

* return stopped check

Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
Co-authored-by: b00ris <b00ris@mail.ru>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: canepat <16927169+canepat@users.noreply.github.com>
2021-03-19 21:24:49 +00:00
b00ris
c03da8fb8e
Split header prefix bucket to headers, td and canonical (#1556)
* split headers prefix

* migration

* fix downloader bug

* test for migration

* fix lint

* uncomment t.Prallel

* fix postprocessing test
2021-03-19 12:54:47 +00:00
Igor Mandrigin
90edad9852 and more linter fixes 2021-03-18 11:46:13 +01:00
Igor Mandrigin
36297dd057 more linter fixes 2021-03-18 11:44:22 +01:00
Igor Mandrigin
f1f849e691 fix linter 2021-03-18 11:18:57 +01:00
Igor Mandrigin
7b000b5644 linter fixups 2021-03-18 11:17:04 +01:00
Igor Mandrigin
ff4868bcdd fix eth/downloader 2021-03-17 14:41:14 +01:00
Igor Mandrigin
0136e2b61f skip downloader tests that hang 2021-03-16 16:14:02 +01:00
Igor Mandrigin
14a3b8d676 eth/downloader compiles 2021-03-16 15:06:47 +01:00
Alexey Sharp
a2f9ed2a5d more compilation fixes 2021-03-15 19:17:15 +00:00
Alexey Sharp
519b19f8aa Compilation fixes 2021-03-14 08:00:37 +00:00
lightclient
50d975302d all: add support for EIP-2718, EIP-2930 transactions (#21502)
This adds support for EIP-2718 typed transactions as well as EIP-2930
access list transactions (tx type 1). These EIPs are scheduled for the
Berlin fork.

There very few changes to existing APIs in core/types, and several new APIs
to deal with access list transactions. In particular, there are two new
constructor functions for transactions: types.NewTx and types.SignNewTx.
Since the canonical encoding of typed transactions is not RLP-compatible,
Transaction now has new methods for encoding and decoding: MarshalBinary
and UnmarshalBinary.

The existing EIP-155 signer does not support the new transaction types.
All code dealing with transaction signatures should be updated to use the
newer EIP-2930 signer. To make this easier for future updates, we have
added new constructor functions for types.Signer: types.LatestSigner and
types.LatestSignerForChainID.

This change also adds support for the YoloV3 testnet.

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
# Conflicts:
#	accounts/abi/bind/backends/simulated.go
#	cmd/evm/internal/t8ntool/execution.go
#	cmd/evm/internal/t8ntool/transition.go
#	cmd/geth/main.go
#	cmd/geth/usage.go
#	core/bench_test.go
#	core/state/statedb.go
#	core/state_prefetcher.go
#	core/state_processor.go
#	core/state_transition.go
#	core/tx_pool.go
#	core/types/block.go
#	core/types/derive_sha.go
#	core/types/gen_tx_json.go
#	core/types/receipt.go
#	core/types/receipt_test.go
#	core/types/transaction.go
#	core/types/transaction_signing.go
#	core/types/transaction_test.go
#	ethclient/ethclient.go
#	ethclient/signer.go
#	graphql/graphql.go
#	internal/ethapi/api.go
#	internal/guide/guide_test.go
#	les/benchmark.go
#	les/odr_test.go
#	light/odr_test.go
#	light/txpool.go
#	miner/worker.go
#	miner/worker_test.go
#	signer/core/api.go
#	tests/state_test_util.go
#	trie/stacktrie_test.go
#	turbo/stages/blockchain_test.go
2021-03-12 15:40:24 +01:00
Martin Holst Swende
d1b207ff7e eth: implement eth66 (#22241)
* eth/protocols/eth: split up the eth protocol handlers

* eth/protocols/eth: define eth-66 protocol messages

* eth/protocols/eth: poc implement getblockheaders on eth/66

* eth/protocols/eth: implement remaining eth-66 handlers

* eth/protocols: define handler map for eth 66

* eth/downloader: use protocol constants from eth package

* eth/protocols/eth: add ETH66 capability

* eth/downloader: tests for eth66

* eth/downloader: fix error in tests

* eth/protocols/eth: use eth66 for outgoing requests

* eth/protocols/eth: remove unused error type

* eth/protocols/eth: define protocol length

* eth/protocols/eth: fix pooled tx over eth66

* protocols/eth/handlers: revert behavioural change which caused tests to fail

* eth/downloader: fix failing test

* eth/protocols/eth: add testcases + fix flaw with header requests

* eth/protocols: change comments

* eth/protocols/eth: review fixes + fixed flaw in RequestOneHeader

* eth/protocols: documentation

* eth/protocols/eth: review concerns about types
# Conflicts:
#	eth/downloader/downloader_test.go
#	eth/downloader/peer.go
2021-03-10 11:33:45 +01:00
Martin Holst Swende
e6dd171f2f eth/protocols/snap: snap sync testing (#22179)
* eth/protocols/snap: make timeout configurable

* eth/protocols/snap: snap sync testing

* eth/protocols/snap: test to trigger panic

* eth/protocols/snap: fix race condition on timeouts

* eth/protocols/snap: return error on cancelled sync

* squashme: updates + test causing panic + properly serve accounts in order

* eth/protocols/snap: revert failing storage response

* eth/protocols/snap: revert on bad responses (storage, code)

* eth/protocols/snap: fix account handling stall

* eth/protocols/snap: fix remaining revertal-issues

* eth/protocols/snap: timeouthandler for bytecode requests

* eth/protocols/snap: debugging + fix log message

* eth/protocols/snap: fix misspelliings in docs

* eth/protocols/snap: fix race in bytecode handling

* eth/protocols/snap: undo deduplication of storage roots

* synctests: refactor + minify panic testcase

* eth/protocols/snap: minor polishes

* eth: minor polishes to make logs more useful

* eth/protocols/snap: remove excessive logs from the test runs

* eth/protocols/snap: stress tests with concurrency

* eth/protocols/snap: further fixes to test cancel channel handling

* eth/protocols/snap: extend test timeouts on CI

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-03-09 12:34:26 +01:00
meowsbits
71a78fafd0 downloader: extract findAncestor search functions (#21744)
This is a simple refactoring, extracting common ancestor
negotiation logic to named function
2021-03-09 11:13:39 +01:00
Chris Ziogas
07503e3d11 eth/downloader: fix race condition in tests (#22140)
* downloader: fix race condition in tests

* eth/downloader: fix race condition in tests

* Revert "downloader: fix race condition in tests"

This reverts commit 108033ebc6985de83791d375b6e6647a77d28d5a.
2021-03-09 10:26:12 +01:00
Péter Szilágyi
a50f261e87 cmd/utils, eth/downloader: minor snap nitpicks 2021-03-09 10:22:04 +01:00
jk-jeongkyun
18852aa9b3 eth/downloader: enhanced test cases for downloader queue (#22114)
# Conflicts:
#	eth/downloader/queue_test.go
2021-03-09 10:21:52 +01:00
jk-jeongkyun
b3e18e483d eth/downloader: remove unnecessary condition (#22052) 2021-03-09 10:12:43 +01:00
Péter Szilágyi
693459073e core, eth: split eth package, implement snap protocol (#21482)
This commit splits the eth package, separating the handling of eth and snap protocols. It also includes the capability to run snap sync (https://github.com/ethereum/devp2p/blob/master/caps/snap.md) , but does not enable it by default.

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Martin Holst Swende <martin@swende.se>
# Conflicts:
#	cmd/geth/misccmd.go
#	cmd/utils/flags.go
#	core/blockchain.go
#	core/blockchain_snapshot_test.go
#	core/forkid/forkid.go
#	core/rawdb/accessors_snapshot.go
#	core/rawdb/schema.go
#	core/state/snapshot/generate.go
#	core/state/statedb.go
#	eth/api_test.go
#	eth/backend.go
#	eth/downloader/downloader.go
#	eth/downloader/downloader_test.go
#	eth/downloader/modes.go
#	eth/downloader/queue.go
#	eth/downloader/statesync.go
#	eth/gen_config.go
#	eth/handler.go
#	eth/handler_test.go
#	eth/helper_test.go
#	eth/peer.go
#	eth/protocol.go
#	eth/protocol_test.go
#	eth/sync.go
#	eth/sync_test.go
#	ethstats/ethstats.go
#	les/client.go
#	les/enr_entry.go
#	les/handler_test.go
#	les/peer.go
#	les/server_handler.go
#	tests/block_test_util.go
#	trie/proof.go
#	trie/proof_test.go
#	trie/trie.go
#	turbo/trie/notary.go
#	turbo/trie/sync_bloom.go
2021-03-08 17:07:38 +01:00