Commit Graph

465 Commits

Author SHA1 Message Date
b00ris
e5f6412da2
Update snapshot hash (#1243)
* remove useless bucket

* update snapshot hashes

* remove log
2020-10-17 08:48:20 +01:00
Alex Sharov
a8f38ba1c3
fix db opening (#1240) 2020-10-14 13:05:54 +01:00
ledgerwatch
cd706d5081
Download/seed block bodies and block headers via BitTorrent (#1218)
* save state

* torrent experiments

* torrent experiment passed

* fixes after merge

* snapshot headers processing passed

* save state

* save state

* download headers works after snapshot processing

* save state

* save state

* save state

* save state

* add lazy load tx to snapshots, increase number of trackers

* save state

* speedup getting info

* change logging

* move to turbo package

* save state

* save state

* save state

* cleanup

* save state

* add test test

* save state

* lmdb debugging

* fix readonly mode

* save state

* fix build

* sync works

* save state

* save state

* save state

* allow cmd stages stageSenders use snapshots

* debugging failed hashing

* remove experimental tests

* remove torrent experimental tests

* fix lint

* extract snapshot wrapper

* metainfo checker

* add remote seeder

* add logs

* update gomod

* remove useless code

* fix lint&remove useless code

* extract verify snapshot to separated command

* skip debug test

* fix test

* change type of seedSnapshot flag

* add eth logger to torrent lib

* skip debug test

* add Close method

* review fixes

* fix lint

* tidy mods

* Fix compile

* Fix lint

* Fix rpcdaemon running in the docker

Co-authored-by: b00ris <b00ris@mail.ru>
Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
2020-10-13 13:56:16 +01:00
Igor Mandrigin
f3ce1ce423
turbo-api: add a plug-in mechanism for possible Bloom and other filters (#1229)
* Add a convenience method to replace stages

* allow more parameters to the execution function

* add a plug-in point for stuff like bloom filters, etc

* add comments

* fixups
2020-10-12 14:58:45 +01:00
Alex Sharov
88a099702b
rawdb.ReadCanonicalHash to return err (#1204)
* read_canonical_hash_return_err

* hack hugeFreelist

* fix tests
2020-10-10 07:05:56 +01:00
ledgerwatch
1af6cbe37b
Revert "Download/seed headers and block bodies via BitTorrent (#1195)" (#1202)
This reverts commit 94360212cb.
2020-10-07 21:49:44 +01:00
ledgerwatch
94360212cb
Download/seed headers and block bodies via BitTorrent (#1195)
* save state

* torrent experiments

* torrent experiment passed

* fixes after merge

* snapshot headers processing passed

* save state

* save state

* download headers works after snapshot processing

* save state

* save state

* save state

* save state

* add lazy load tx to snapshots, increase number of trackers

* save state

* speedup getting info

* change logging

* move to turbo package

* save state

* save state

* save state

* cleanup

* save state

* add test test

* save state

* lmdb debugging

* fix readonly mode

* save state

* fix build

* sync works

* save state

* save state

* save state

* allow cmd stages stageSenders use snapshots

* debugging failed hashing

* remove experimental tests

* remove torrent experimental tests

* fix lint

* extract snapshot wrapper

* metainfo checker

* add remote seeder

* add logs

* update gomod

* remove useless code

* fix lint&remove useless code

* extract verify snapshot to separated command

* skip debug test

* fix test

* change type of seedSnapshot flag

* add eth logger to torrent lib

* skip debug test

* add Close method

* review fixes

* fix lint

Co-authored-by: b00ris <b00ris@mail.ru>
Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
2020-10-07 13:15:49 +01:00
ledgerwatch
bdb0155856
Revert "Add sync by bittorrent snapshots (#1160)" (#1194)
This reverts commit 4ebade3583.
2020-10-06 22:31:57 +01:00
b00ris
4ebade3583
Add sync by bittorrent snapshots (#1160)
* save state

* torrent experiments

* torrent experiment passed

* fixes after merge

* snapshot headers processing passed

* save state

* save state

* download headers works after snapshot processing

* save state

* save state

* save state

* save state

* add lazy load tx to snapshots, increase number of trackers

* save state

* speedup getting info

* change logging

* move to turbo package

* save state

* save state

* save state

* cleanup

* save state

* add test test

* save state

* lmdb debugging

* fix readonly mode

* save state

* fix build

* sync works

* save state

* save state

* save state

* allow cmd stages stageSenders use snapshots

* debugging failed hashing

* remove experimental tests

* remove torrent experimental tests

* fix lint

* extract snapshot wrapper

* metainfo checker

* add remote seeder

* add logs

* update gomod

* remove useless code

* fix lint&remove useless code

* extract verify snapshot to separated command

* skip debug test

* fix test

* change type of seedSnapshot flag

* add eth logger to torrent lib

* skip debug test

* add Close method

* review fixes

* fix lint

Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
Co-authored-by: Alexey Akhunov <akhounov@gmail.com>
2020-10-06 20:24:48 +01:00
Igor Mandrigin
70f6ec3b49 post-rebase fixes 2020-10-06 14:12:09 +02:00
Péter Szilágyi
0bdcf2cc71 eth/downloader: dynamically move pivot even during chain sync
# Conflicts:
#	eth/downloader/downloader.go
2020-10-06 14:12:09 +02:00
Péter Szilágyi
7970cad173 eth/downloader: only roll back light sync if not fully validating
# Conflicts:
#	eth/downloader/downloader.go
#	eth/downloader/downloader_test.go
2020-10-06 14:12:09 +02:00
Evgeny Danilenko
ec6be820ac
Don't force sync in case InMemDb (#1174)
* initial

* fix

* fix chain length
2020-10-02 14:08:28 +01:00
Alex Sharov
e02d6acc7d
bitmap indices for logs (#1124)
* save progress

* try now

* don't create bloom inside rlpDecode

* don't create bloom inside ApplyTransaction

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* rename method

* print timings

* print timings

* print timings

* sort before flush

* fix err lint

* clean

* move tests to transactions

* compressed version

* up bound

* up bound

* more tests

* more tests

* more tests

* more tests

* better removal

* clean

* better performance of get/put methods

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* optimize rpcdaemon

* fix test

* fix rpcdaemon

* fix test

* simplify

* simplify

* fix nil pointer

* clean

* revert some changes

* add some logs

* clean

* try without optimize

* clean

* clean

* clean

* clean

* try

* move log_index to own stage

* move log_index to own stage

* integration add log_index stage

* integration add log_index stage

* clean

* clean

* print timing

* remove duplicates at unwind

* extract truncateBitmaps func

* try detect

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* add blackList of topics

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* clean

* sharding 1

* sharded 2

* sharded 2

* sharded 2

* sharded 2

* sharded 2

* sharded 2

* sharded 2

* sharded 2

* sharded 2

* sharded 2

* sharded 2

* sharded 2

* sharded 2

* sharded 2

* sharded 2

* sharded 2

* sharded 3

* sharded 3

* sharded 3

* speedup things by putCurrent and putReserve

* clean

* optimize trim

* clean

* remove blacklist

* add more info to err

* ?

* clean

* clean

* clean

* clean

* clean

* working version

* switch to cgo version of roaring bitmaps

* clean

* clean

* clean

* clean

* more docs

* clean

* clean

* fix logs bloom field

* Fix debug_getModifiedAccountsByNumber

* Try to fix crash

* fix problem with "absent block"

* fix problem with "absent block"

* remove optimize method call

* remove roaring iterator

* fix problem with rebuild indicess

* remove debug prints

* tests for eth_getLogs involving topics

* add tests for new stage, speparate topics into 2 buckets

* version up

* remove debug logs

* remove debug logs

* remove bloom filter implementation

* Optimisation

* Optimisatin not required, make rpctest lenient to geth errors

* Lenient to geth failures

Co-authored-by: Alexey Akhunov <akhounov@gmail.com>
2020-09-28 18:18:36 +01:00
Igor Mandrigin
eb226f9de3 linter1 2020-09-11 18:12:39 +02:00
Igor Mandrigin
9bc57439be fix tests (downloader) 2020-09-11 17:36:59 +02:00
Igor Mandrigin
6aa334f672 post-merge fixups 2020-09-11 16:46:24 +02:00
Martin Holst Swende
ea8fe080b3 eth/downloader: change intial download size (#21366)
This changes how the downloader works, a little bit. Previously, when block sync started,
we immediately started filling up to 8192 blocks. Usually this is fine, blocks are small
in the early numbers. The threshold then is lowered as we measure the size of the blocks
that are filled.

However, if the node is shut down and restarts syncing while we're in a heavy segment,
that might be bad. This PR introduces a more conservative initial threshold of 2K blocks
instead.

# Conflicts:
#	eth/downloader/downloader.go
#	eth/downloader/downloader_test.go
#	eth/downloader/testchain_test.go
2020-09-11 16:22:10 +02:00
Giuseppe Bertone
b2f258f55f "Downloader queue stats" is now provided once per minute (#21455)
* "Downloader queue stats" is now a DEBUG information

I think this info is more a DEBUG related information then an INFO. If it must remains an INFO, maybe it can be slow down to one time every 5 minutes or so.

* Update queue.go

"Downloader queue stats" information is now provided once every minute instead of once every 10 seconds.
2020-09-11 16:05:59 +02:00
Alex Sharov
50d13fd9a8
increase tx limit (#1047) 2020-09-08 07:09:33 +01:00
ledgerwatch
fe6d4b5213
Better log message about commit (#1060) 2020-09-06 14:10:33 +01:00
Igor Mandrigin
2a6478d799
turbo-api: create a second executable file with a custom stage example (#1055) 2020-09-05 18:07:27 +02:00
Igor Mandrigin
5b92d47e9d
Initialize Staged Sync with stages. (#1033)
* externalize default stages

* initialize with the right stages

* fix some bugs

* fix

* linters
2020-09-02 19:11:41 +01:00
ledgerwatch
c6975414e8
[WIP] Warmup the state bucket for HDD sync (#1032)
* Warmup

* Log the warmup

* Make warmup interruptible

* Make warmup a command line option for HDD

* Activate hdd flag
2020-09-02 12:24:27 +01:00
ledgerwatch
d8c0c16e40
Bad rewind issues fix (#1024)
* Unwind over unwound, no rollbacks

* Exclude bits only for StagedSync

* Nitpick
2020-09-01 12:50:36 +01:00
Igor Mandrigin
7bc892e886
Prefetch block bodies (#1013)
* prefetched blocks 1

* fixups

* fix logs

* fixups

* linters

* remove logs

* fix an NPE in tests

* setup the correct origin

* run blocks on prefetched bodies

* fix log

* smaller cache size
2020-08-30 18:34:40 +01:00
Igor Mandrigin
5365b8e402
stagedsync: create a StagedSync object, initialize in ProtocolManager (#1012)
* stagedsync: create a StagedSync object, initialize in ProtocolManager

* fix compile error
2020-08-30 13:24:58 +02:00
Igor Mandrigin
15e86b4b34 fix compilation issue 2020-08-29 15:30:06 +02:00
Igor Mandrigin
637493e8f1 Merge branch 'master' into geth-1.9.20 2020-08-29 15:28:03 +02:00
Igor Mandrigin
bd61245ece test fixups 2020-08-29 14:35:39 +02:00
Igor Mandrigin
4b4326020c geth compiles 2020-08-29 14:03:41 +02:00
Igor Mandrigin
948cd29be7 fixes 2020-08-29 13:43:44 +02:00
Igor Mandrigin
78e466d06a fix imports 2020-08-29 13:31:46 +02:00
Martin Holst Swende
fa3ee4bf6b eth: utilize sync bloom for getNodeData (#21445)
* eth/downloader, eth/handler: utilize sync bloom for getNodeData

* trie: handle if bloom is nil

* trie, downloader: check bloom nilness externally
# Conflicts:
#	eth/handler.go
2020-08-29 13:26:15 +02:00
gary rong
550bd11f9d core, eth, les, trie: add a prefix to contract code (#21080)
# Conflicts:
#	cmd/evm/internal/t8ntool/execution.go
#	consensus/clique/clique.go
#	consensus/ethash/consensus.go
#	core/block_validator.go
#	core/blockchain.go
#	core/blockchain_test.go
#	core/genesis.go
#	core/rawdb/accessors_indexes_test.go
#	core/rawdb/accessors_metadata.go
#	core/rawdb/chain_iterator_test.go
#	core/rawdb/database.go
#	core/rawdb/schema.go
#	core/state/database.go
#	core/state/iterator_test.go
#	core/state/statedb.go
#	core/state/sync.go
#	core/state/sync_test.go
#	core/tx_pool_test.go
#	core/types/block_test.go
#	core/types/derive_sha.go
#	eth/downloader/downloader.go
#	eth/downloader/queue.go
#	eth/downloader/statesync.go
#	eth/fetcher/block_fetcher.go
#	eth/fetcher/block_fetcher_test.go
#	eth/handler.go
#	les/odr_requests.go
#	les/server_handler.go
#	light/odr.go
#	light/odr_test.go
#	light/trie.go
#	miner/worker.go
#	trie/database.go
#	trie/secure_trie.go
#	trie/sync.go
#	trie/sync_bloom.go
#	trie/sync_test.go
2020-08-29 13:25:20 +02:00
Martin Holst Swende
b670cc44a5 eth/downloader: fix rollback issue on short chains 2020-08-29 12:30:17 +02:00
Péter Szilágyi
bfac425c87 core: define and test chain rewind corner cases (#21409)
* core: define and test chain reparation cornercases

* core: write up a variety of set-head tests

* core, eth: unify chain rollbacks, handle all the cases

* core: make linter smile

* core: remove commented out legacy code

* core, eth/downloader: fix review comments

* core: revert a removed recovery mechanism
# Conflicts:
#	core/blockchain.go
#	core/blockchain_test.go
#	core/headerchain.go
#	core/rawdb/database.go
#	core/rawdb/freezer.go
#	core/rawdb/schema.go
#	eth/downloader/downloader.go
#	eth/sync.go
#	trie/sync.go
2020-08-29 12:29:00 +02:00
Alex Sharov
46a5d9c275
clean (#1001) 2020-08-29 17:07:12 +07:00
Alex Sharov
ca0bc897dc
clear logs (#1000) 2020-08-29 17:06:53 +07:00
Alex Sharov
07ca5c643a
eth_syncing (#991)
* eth_syncing

* linters

* fix readme

* cleanup cli params

* go mod tidy

* remove memsize ui dep

* remove bloomfilter

* implement net_peerCount

* remove legacy flags
2020-08-29 08:24:50 +01:00
Alex Sharov
de16812a94
move tx limit from 16 to 32 blocks (#988) 2020-08-28 07:28:08 +01:00
Alex Sharov
df05a581dd
Add tx pool stage to transaction (#981)
* add tx_pool stage to tx

* clean

* don't call commit in read tx

* don't call commit in read tx

* clean

* more logs

* fix tx pool race

* more logs

* clean
2020-08-28 07:27:48 +01:00
Alex Sharov
714e5041e2
Better logs3 (#976) 2020-08-26 19:06:51 +07:00
Alex Sharov
522287ac18
Transactional cycle (#966)
* v0

* v1

* v3

* v4

* clean

* temporary fix of txpool

* Add debug logs about tx start/commit

* Add debug logs about tx start/commit

* Add debug logs about tx start/commit

* add condition

* tx pool to not hold own db

* try to enable TxPool in integration

* exclude tx pool from tx

* exclude tx pool from integration

* reduce limit

* fix integration

* clean

* clean

* clean

* clean

* clean

* exclude tx pool unwind

* exclude tx pool unwind in integration

* fix integration tx pool

* fix commit

* fix current stage after unwind

* fix current stage after unwind

* fix linter

* move unwind of tx_pool after unwind of unwind of senders, then all stages from body to tx_pool will be inside tx.

* move body and headers unwind out of tx

* fix unwind order after reboot

* add support external tx to exec stage

* clean

* clean

* clean

* clean

* clean

* add logs

* better id check

* better id check
2020-08-26 07:02:10 +01:00
ledgerwatch
8728e54a72
Another step in migrating tests to staged sync (#970)
* Log in GetAsOf

* Default plain state

* trace

* More test fixes

* Fix lint

* Fix

* Fix lint

* Fix lint

* Fix lint

* Fix lint

* Fix for events

* Repair events

* Fix lint

* Fix lint

* Change back to InsertChain
2020-08-24 18:00:40 +01:00
Igor Mandrigin
db6a0c43ee linter 2020-08-15 22:17:38 +02:00
Igor Mandrigin
9cc5690483 fix downloader tests 2020-08-15 20:32:50 +02:00
rene
b03de86a5c downloader: add eth65 tests (#21383)
* eth65 tests

linted

* remove non-latest eth light tests
# Conflicts:
#	eth/downloader/downloader_test.go
2020-08-14 16:39:16 +02:00
rene
018cfd0b6d eth/downloader: remove eth62 (#21378)
* init

notes

removed some mentions of eth62, bumped protocol err too old to >=63

* remove sanity checks and bump supported protocol version up to 63

* remove 62 tests, still need to add 65

* remove 65 tests
# Conflicts:
#	eth/downloader/downloader_test.go
#	eth/downloader/peer.go
2020-08-12 12:42:36 +02:00
Giulio rebuffo
057894994d
add blockhashes stage (#862)
* add blockhashes stage

* unwindOrder specified

* fixed typo

* added common.copybytes

* fixed little typo

* better progress

* better progress

* refactoring with etl

* added blockhashes to disabled stages in cmd/integration

* added migraations

* fixed go.mod

* better migrations

* rename unwind

* simplified migrations

* added onloadcommit
2020-08-10 18:46:06 +01:00