Commit Graph

12755 Commits

Author SHA1 Message Date
kyrie-yl
aecb61296d
fix cache key do not have hash func (#455)
Signed-off-by: kyrie-yl <yl.on.the.way@gmail.com>
2021-10-15 18:10:58 +08:00
zjubfd
8f605f5904
fix cache key (#454) 2021-10-15 17:04:30 +08:00
Steven Tran
31463f8dd1
parallel bloom calculation (#445)
* parallel bloom calculation

* indent

* add condition if bloomJobs not nil

* add handler for worker

* fix format

* bloomWorker should exit when all txs have been processed

* rename BloomPair => BloomHash

* add size to map

* rename & unique variable

* bloomJobs => bloomProcessors

* fix

* only assign bloom if empty

* abstraction method for processing receipt bloom

* remove duplicate receipt_processor

* rename Processor

* fix  ReceiptProcessor

* fix ReceiptBloomGenertor typo

* reduce worker to 1

* remove empty wg

* add defence code to check if channel is closed

* remove nil

* format fix

* remove thread pool

* use max 100 worker capacity

* reduce worker size

* refactor startWorker
2021-10-15 16:30:44 +08:00
kyrie-yl
33aa77949f
cache bitmap and change the cache type of GetCode (#449)
* change cache type of GetCode from fastcache to lrucache

Signed-off-by: kyrie-yl <yl.on.the.way@gmail.com>

* add cache for contract code bitmap

Signed-off-by: kyrie-yl <yl.on.the.way@gmail.com>

* core/vm: rework jumpdest analysis benchmarks (#23499)

* core/vm: rework jumpdest analysis benchmarks

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB
and classic benchmark loop.

* core/vm: clear bitvec in jumpdest analysis benchmark

Co-authored-by: Paweł Bylica <chfast@gmail.com>
2021-10-15 15:12:14 +08:00
yutianwu
610f6a5e63
[R4R] add extension in eth protocol handshake to disable tx broadcast (#412)
* add extension for eth protocol handshake

* fix comments
2021-10-13 11:30:19 +08:00
yutianwu
c737f66839
Merge pull request #426 from binance-chain/improve_backoff
[R4R] add block proccess backoff time when validator is not in turn and received in turn block
2021-10-13 09:54:33 +08:00
zjubfd
5e210b311b
fix concurrent write seen of subfetcher (#446) 2021-10-12 11:29:17 +08:00
KeefeL
59d3b537a5
Merge pull request #442 from KeefeL/diff_accouts
ignore empty tx in GetDiffAccountsWithScope
2021-10-11 11:56:16 +08:00
zjubfd
03febe17c2
fix blockhash not correct for the logs of system tx receipt (#444) 2021-10-11 10:55:52 +08:00
Keefe-Liu
0315f60924 ignore empty tx in GetDiffAccountsWithScope
Signed-off-by: Keefe-Liu <bianze.kernel@gmail.com>
2021-10-08 17:41:55 +08:00
KeefeL
b2f1d25f83
Export get diff accounts in block api (#431)
* support get diff accounts

Signed-off-by: Keefe-Liu <bianze.kernel@gmail.com>

* add testcase for diff accounts

Signed-off-by: Keefe-Liu <bianze.kernel@gmail.com>
2021-10-08 12:29:38 +08:00
zjubfd
1ded097733
[R4R]implement diff sync (#376)
* implement block process part of light sync

* add difflayer protocol

* handle difflayer and refine light processor

* add testcase for diff protocol

* make it faster

* allow validator to light sync

* change into diff sync

* ligth sync: download difflayer (#2)

* ligth sync: download difflayer

Signed-off-by: kyrie-yl <lei.y@binance.com>

* download diff layer: fix according to the comments

Signed-off-by: kyrie-yl <lei.y@binance.com>

* download diff layer: update

Signed-off-by: kyrie-yl <lei.y@binance.com>

* download diff layer: fix accroding comments

Signed-off-by: kyrie-yl <lei.y@binance.com>

Co-authored-by: kyrie-yl <lei.y@binance.com>

* update light sync to diff sync

* raise the max diff limit

* add switcher of snap protocol

* fix test case

* make commit concurrently

* remove peer for diff cache when peer closed

* consensus tuning

* add test code

* remove extra message

* fix testcase and lint

make diff block configable

wait code write

fix testcase

resolve comments

resolve comment

* resolve comments

* resolve comments

* resolve comment

* fix mistake

Co-authored-by: kyrie-yl <83150977+kyrie-yl@users.noreply.github.com>
Co-authored-by: kyrie-yl <lei.y@binance.com>
2021-09-28 16:03:38 +08:00
yutianwu
7f9cdc4ae5 minor update 2021-09-27 10:50:13 +08:00
yutianwu
77f19d435d wait if td is the same 2021-09-26 19:09:31 +08:00
yutianwu
065e69e320 fix comments 2021-09-26 18:23:58 +08:00
yutianwu
4a84cfdf62 add more log 2021-09-24 14:29:16 +08:00
yutianwu
e0e58b2345 update comment 2021-09-23 19:12:34 +08:00
yutianwu
88ba737a46 add block proccess backoff time when validator is not in turn 2021-09-23 16:05:09 +08:00
Ikko Ashimine
bca9678547
core/state/snapshot: fix typo (#408)
strorage -> storage
2021-09-06 11:22:21 +08:00
zjubfd
1540ad932d
fix nil point in downloader (#409) 2021-09-06 10:37:16 +08:00
dylanhuang
2d2740e2a2
Merge pull request #399 from j75689/fix/issue_388
fix: nil pointer issue (#388)
2021-09-01 22:04:04 +08:00
j75689
6e960cc850 Revert "fix potential deadlock of pub/sub module"
This reverts commit 3d3f9694a426eafc32640a643b5399a58209da1c.
2021-08-31 16:59:46 +08:00
dylanhuang
3a8bf73b0b
Merge pull request #398 from j75689/release_ci_pipeline
ci pipeline for release page
2021-08-31 14:07:45 +08:00
j75689
55775d9aee ci pipeline for release page 2021-08-31 12:07:24 +08:00
zjubfd
c4f9312129
prepare for release 1.1.2 (#381) v1.1.2 2021-08-25 10:13:43 +08:00
kyrie-yl
8fd77bcdcd
Merge pull request #379 from guagualvcha/faster_analysis
[R4R]core/vm: faster code analysis (#23381)
2021-08-24 18:59:25 +08:00
Martin Holst Swende
57632c94e8 core/vm: faster code analysis (#23381)
* core/vm: more detailed benchmark for jumpdest analysis

* core/vm: make jd analysis benchmark alloc free

* core/vm: improve jumpdest analysis

* core/vm: improve worst-case

* core/vm: further improvements in analysis

* core/vm: improve jumpdest analysis >PUSH15

* core/vm: make jd analysis ref by value

* core/vm: fix misspell

* core/vm: improve set8 and set16 a bit

* core/vm: reduce amount of code

* core/vm: optimize byte copying
2021-08-24 15:55:20 +08:00
Alexandr
804c853537
fix: tracing system transactions failed due to wrong state (#374)
* fixed wrong state creation which resulted in fail of tracing transaction

* sorted package imports

* added the check to `standardTraceBlockToFile` that resolves the #314

Co-authored-by: alexqrid <>
2021-08-22 18:55:04 +08:00
zjubfd
03f7b318d9
format changelog (#367) v1.1.1 2021-08-13 10:37:58 +08:00
zjubfd
a3320d6f6e
prepare release v1.1.1 (#362) 2021-08-13 10:20:35 +08:00
zjubfd
504424dc7c
fix doube close channel of subfetcher (#366) 2021-08-13 10:18:17 +08:00
kyrie-yl
8d5f2ba90d
Merge pull request #360 from guagualvcha/fix_win_prune
fix syc failed on windows when prune
2021-08-10 21:28:14 +08:00
fudongbai
29707b9252 fix syc failed on windows when prune 2021-08-10 15:19:32 +08:00
zjubfd
6fcce0dce9
fix pending block null issue (#358) 2021-08-10 12:03:15 +08:00
zjubfd
955c78bde0
[R4R] the miner module should propose block on a proper fork (#355)
* change Canon chain condition

* resolve comment
2021-08-10 10:33:00 +08:00
barryz
3bd4e29954
fix: TriesInmemory specified but not work (#350)
* fix: TriesInmemory specified but not work

* change warning log when TriesInMemory isn't default
2021-08-09 13:48:43 +08:00
zjubfd
69ce7f1e5e
prepare release 1.1.1-beta (#334) v1.1.1-beta 2021-07-29 18:53:24 +08:00
dylanhuang
7e8d9fb51d
fix: block fetcher efficiency (#333) 2021-07-29 17:17:11 +08:00
zjubfd
2ce00adb55
[R4R] performance improvement in many aspects (#257)
* focus on performance improvement in many aspects.

1. Do BlockBody verification concurrently;
2. Do calculation of intermediate root concurrently;
3. Preload accounts before processing blocks;
4. Make the snapshot layers configurable.
5. Reuse some object to reduce GC.

add

* rlp: improve decoder stream implementation (#22858)

This commit makes various cleanup changes to rlp.Stream.

* rlp: shrink Stream struct

This removes a lot of unused padding space in Stream by reordering the
fields. The size of Stream changes from 120 bytes to 88 bytes. Stream
instances are internally cached and reused using sync.Pool, so this does
not improve performance.

* rlp: simplify list stack

The list stack kept track of the size of the current list context as
well as the current offset into it. The size had to be stored in the
stack in order to subtract it from the remaining bytes of any enclosing
list in ListEnd. It seems that this can be implemented in a simpler
way: just subtract the size from the enclosing list context in List instead.

* rlp: use atomic.Value for type cache (#22902)

All encoding/decoding operations read the type cache to find the
writer/decoder function responsible for a type. When analyzing CPU
profiles of geth during sync, I found that the use of sync.RWMutex in
cache lookups appears in the profiles. It seems we are running into
CPU cache contention problems when package rlp is heavily used
on all CPU cores during sync.

This change makes it use atomic.Value + a writer lock instead of
sync.RWMutex. In the common case where the typeinfo entry is present in
the cache, we simply fetch the map and lookup the type.

* rlp: optimize byte array handling (#22924)

This change improves the performance of encoding/decoding [N]byte.

    name                     old time/op    new time/op    delta
    DecodeByteArrayStruct-8     336ns ± 0%     246ns ± 0%  -26.98%  (p=0.000 n=9+10)
    EncodeByteArrayStruct-8     225ns ± 1%     148ns ± 1%  -34.12%  (p=0.000 n=10+10)

    name                     old alloc/op   new alloc/op   delta
    DecodeByteArrayStruct-8      120B ± 0%       48B ± 0%  -60.00%  (p=0.000 n=10+10)
    EncodeByteArrayStruct-8     0.00B          0.00B          ~     (all equal)

* rlp: optimize big.Int decoding for size <= 32 bytes (#22927)

This change grows the static integer buffer in Stream to 32 bytes,
making it possible to decode 256bit integers without allocating a
temporary buffer.

In the recent commit 088da24, Stream struct size decreased from 120
bytes down to 88 bytes. This commit grows the struct to 112 bytes again,
but the size change will not degrade performance because Stream
instances are internally cached in sync.Pool.

    name             old time/op    new time/op    delta
    DecodeBigInts-8    12.2µs ± 0%     8.6µs ± 4%  -29.58%  (p=0.000 n=9+10)

    name             old speed      new speed      delta
    DecodeBigInts-8   230MB/s ± 0%   326MB/s ± 4%  +42.04%  (p=0.000 n=9+10)

* eth/protocols/eth, les: avoid Raw() when decoding HashOrNumber (#22841)

Getting the raw value is not necessary to decode this type, and
decoding it directly from the stream is faster.

* fix testcase

* debug no lazy

* fix can not repair

* address comments

Co-authored-by: Felix Lange <fjl@twurst.com>
2021-07-29 17:16:53 +08:00
John.h
f124267144
eth/tracers: improve tracing performance (#23016) (#326)
* eth/tracers: improve tracing performance (#23016)

Improves the performance of debug.traceTransaction

* Update the import order

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: John.H <john.h@binance.com>
2021-07-29 17:08:41 +08:00
dylanhuang
7822e9e2a1
Merge pull request #324 from binance-chain/release_v1.1.0
Release v1.1.0 stable version
v1.1.0
2021-07-26 14:10:10 +08:00
j75689
7c2cca285b release v1.1.0 2021-07-26 12:51:46 +08:00
zjubfd
6ce2cef425
Merge pull request #282 from binance-chain/discord_link
[R4R]update discord link
2021-06-10 15:42:55 +08:00
fudongbai
1bde62fe87 update discord link 2021-06-10 14:00:06 +08:00
zjubfd
3a87f6256a
Merge pull request #280 from binance-chain/discord_link
[R4R]update discord link
2021-06-10 10:34:28 +08:00
fudongbai
72dfda0e88 update discord link 2021-06-10 10:19:17 +08:00
zjubfd
b67a129e5b
Merge pull request #227 from binance-chain/cache_write_policy
[R4R]use more aggressive write cache policy
2021-05-24 16:28:11 +08:00
fudongbai
571a317092 fix ungraceful shutdown issue 2021-05-19 11:46:46 +08:00
fudongbai
1f3e0606ee use more aggressive write cache policy 2021-05-17 19:32:39 +08:00
zjubfd
032970b2de
Merge pull request #152 from binance-chain/upgrade_1.10.2
[R4R] Upgrade to 1.10.3
v1.1.0-beta
2021-05-10 17:11:01 +08:00