Commit Graph

2036 Commits

Author SHA1 Message Date
yutianwu
d065c4859e
feats: add ics23 proof support for cross chain packages (#1149) 2023-03-01 15:49:05 +08:00
dylanhuang
e2e1147a41
mointor: implement double sign monitor (#1199) 2023-02-03 15:53:36 +08:00
dylanhuang
bf68be2bd9
dep: bump the version of several important library (#1274)
* dep: upgrade secp256k1 to use btcec/v2 v2.3.2 and update insecurity pkg

* build ci: upgrade go to 1.19 and golangci-lint to 1.50.1

* docs: fix format that does not follow the goimports

* dep: redirect github.com/bnb-chain/tendermint to v0.31.13

* ci: disable GOPROXY
2023-02-02 19:36:37 +08:00
joeycli
30369897f2 fix comments: prune ancient compatibility, add prune ancient comments 2022-12-22 20:07:55 +08:00
WayToFuture
154f339ce3
comments: add comments to clarify flags and byte codes (#1245) 2022-12-22 12:39:36 +08:00
Seungbae Yu
e9a04cca30 core: preallocate batch size in bloomIndexer (#25289)
This change reduces allocations when committing bloombits indexes
by creating the database batch with a larger initial size.
2022-12-16 17:30:34 +08:00
rjl493456442
da977e9cdc core, ethdb, tests, trie: implement NewBatchWithSize API for batcher (#24392)
This PR adds an addtional API called `NewBatchWithSize` for db
batcher. It turns out that leveldb batch memory allocation is
super inefficient. The main reason is the allocation step of
leveldb Batch is too small when the batch size is large. It can
take a few second to build a leveldb batch with 100MB size.

Luckily, leveldb also offers another API called MakeBatch which can
pre-allocate the memory area. So if the approximate size of batch is
known in advance, this API can be used in this case.

It's needed in new state scheme PR which needs to commit a batch of
trie nodes in a single batch. Implement the feature in a seperate PR.
2022-12-16 17:30:34 +08:00
setunapo
58644491ad worker: reused triePrefetch when multi-fillTransactions to mine a block.
avoid too much trie prefetch routines when several fillTransactions are called.
2022-11-28 13:21:14 +08:00
Roshan
db4cb1df26 upgrade: update Gibbs fork height and system contract code 2022-11-21 19:42:35 +08:00
ycyraum
48b6db9f63 core/genesis: remove calaverasAllocData (#25516)
core/genesis: calaverasAllocData no longer used
2022-11-18 11:16:03 +08:00
Leon
dbc70ee1e2
core/forkid: refactor nextForkHash (#1177) 2022-11-17 12:12:12 +08:00
Seungbae.yu
0f96641ae4 core, eth: pre-allocate map in storage copy (#25279) 2022-11-15 11:54:31 +08:00
henridf
c2c22c5947 core: remove lock in BlockChain.ExportN (#25254)
* Remove locking in (*BlockChain).ExportN

Since ExportN is read-only, it shouldn't need the lock. (?)

* Add hash check to detect reorgs during export.

* fix check order

* Update blockchain.go

* Update blockchain.go

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2022-11-15 11:54:31 +08:00
zjubfd
4e2f5c6263 merge with master branch 2022-10-31 15:12:21 +08:00
zjubfd
6b83c41123
Merge pull request #1146 from qinglin89/develop-upstream20
all: sync with upstream
2022-10-31 14:05:09 +08:00
Leon
bed1a57766
core:remove redundant func (#1159) 2022-10-31 14:03:45 +08:00
lmittmann
2003d543e8 all: prefer new(big.Int) over big.NewInt(0) (#25087)
minor performance improvement: `big.NewInt(0).Xxx` -> `new(big.Int).Xxx`
2022-10-28 09:03:38 +08:00
Rajaram Gaunker
978790b0b6 core/types: remove unused field 'td' in Block (#25010) 2022-10-28 09:03:21 +08:00
Paweł Bylica
2904f20dfc core/vm: optimize jumpdest analysis (#23500)
core/vm: optimize PUSH opcode discrimination
2022-10-28 09:03:21 +08:00
Marius van der Wijden
f863682795 core: use less memory during reorgs (#24616)
This PR significantly reduces the memory consumption of a long reorg
2022-10-28 09:03:21 +08:00
aaronbuchwald
8c90dc946a core/rawdb: simplify TestDiskSeek to use memorydb (#25182) 2022-10-21 14:23:12 +08:00
zjubfd
cb131fabe5
vm: add two proof verifier to fix the vulnerability in range proof (#1121) 2022-10-11 11:16:30 +08:00
zjubfd
5b35b39023
nanofork: add black list account (#1109) 2022-10-07 11:46:38 +08:00
dylanhuang
816e30108a
tracers ci: drop duktape engine (#24934) and add linux-arm binaries to releases page (#1100) 2022-09-26 17:31:16 +08:00
Leon
3c7bccbd73 core: fix potential goroutine leak (#1079)
* core: fix potential goroutine leak

* core: fix 0 index, and add ut for routineleaking
2022-09-21 17:02:02 +08:00
zhaochonghe
b051dc60dd core: fix the order of address in queue (#24907)
reverse the order of address in queue
2022-09-21 17:02:02 +08:00
Håvard Anda Estensen
4fb1e9d25a all: use strings.EqualFold for string comparison (#24890) 2022-09-21 17:02:02 +08:00
s7v7nislands
57da9c016c core/asm: use strings.Builder and fix godoc issues (#24861) 2022-09-21 17:02:02 +08:00
s7v7nislands
461835ae71 core/vm: clean up some dead functions (#24851) 2022-09-21 17:02:02 +08:00
aaronbuchwald
4feeaf3545 core/vm: update benchmark to use Errorf instead of Sprintf (#24845) 2022-09-21 17:02:02 +08:00
Marius van der Wijden
e8b93382da core/state/snapshot: fix race condition (#24685)
Fixes three race conditions found through fuzzing by David Theodore
2022-09-21 17:02:02 +08:00
tia-99
34420d03c5 core/types: fix unhandled errors in TestTransactionCoding (#24692) 2022-09-21 17:02:02 +08:00
rjl493456442
a72324355a core: fix benchmark panic (#24657)
This PR fixes a few panics in the chain marker benchmarks. The root
cause for panic is in chain marker the genesis header/block is not
accessible, while it's expected to be obtained in tests. So this PR
avoids touching genesis header at all to avoid panic.
2022-09-21 17:02:02 +08:00
Felix Lange
f37f2a9fbe core/types: make "miner" optional in Header JSON (#24666)
"miner" is not set for pending block responses in some cases.

Fixes #24632
2022-09-21 17:02:02 +08:00
Péter Szilágyi
f310921b41 core/state/snapshot: remove noop map item assignment 2022-09-21 17:02:02 +08:00
Roshan
fd6fa7c9ce
fix: update cross chain logic of native stake (#1066) 2022-08-31 14:42:23 +08:00
zjubfd
755df16c9a
Merge pull request #1068 from qinglin89/dev-rlp 2022-08-31 13:30:59 +08:00
Leon
64549a75eb
statedb: get rid of activestate, stopPrefetcher manually (#1006) 2022-08-31 13:30:25 +08:00
bittrainee
b485651b86
fix: fix potential goroutine leak (#1067) 2022-08-31 12:38:09 +08:00
dylanhuang
f45759858d
txpool: reheap the priced list if london fork not enabled (#1070) 2022-08-31 12:37:20 +08:00
Felix Lange
25337f5aba core/types: faster RLP encoding of Header, StateAcccount, Re... (#24420)
This change makes use of the new code generator rlp/rlpgen to improve the
performance of RLP encoding for Header and StateAccount. It also speeds up
encoding of ReceiptForStorage using the new rlp.EncoderBuffer API.

The change is much less transparent than I wanted it to be, because Header and
StateAccount now have an EncodeRLP method defined with pointer receiver. It
used to be possible to encode non-pointer values of these types, but the new
method prevents that and attempting to encode unadressable values (even if
part of another value) will return an error. The error can be surprising and may
pop up in places that previously didn't expect any errors.

To make things work, I also needed to update all code paths (mostly in unit tests)
that lead to encoding of non-pointer values, and pass a pointer instead.

Benchmark results:

    name                             old time/op    new time/op    delta
    EncodeRLP/legacy-header-8           328ns ± 0%     237ns ± 1%   -27.63%  (p=0.000 n=8+8)
    EncodeRLP/london-header-8           353ns ± 0%     247ns ± 1%   -30.06%  (p=0.000 n=8+8)
    EncodeRLP/receipt-for-storage-8     237ns ± 0%     123ns ± 0%   -47.86%  (p=0.000 n=8+7)
    EncodeRLP/receipt-full-8            297ns ± 0%     301ns ± 1%    +1.39%  (p=0.000 n=8+8)

    name                             old speed      new speed      delta
    EncodeRLP/legacy-header-8        1.66GB/s ± 0%  2.29GB/s ± 1%   +38.19%  (p=0.000 n=8+8)
    EncodeRLP/london-header-8        1.55GB/s ± 0%  2.22GB/s ± 1%   +42.99%  (p=0.000 n=8+8)
    EncodeRLP/receipt-for-storage-8  38.0MB/s ± 0%  64.8MB/s ± 0%   +70.48%  (p=0.000 n=8+7)
    EncodeRLP/receipt-full-8          910MB/s ± 0%   897MB/s ± 1%    -1.37%  (p=0.000 n=8+8)

    name                             old alloc/op   new alloc/op   delta
    EncodeRLP/legacy-header-8           0.00B          0.00B           ~     (all equal)
    EncodeRLP/london-header-8           0.00B          0.00B           ~     (all equal)
    EncodeRLP/receipt-for-storage-8     64.0B ± 0%      0.0B       -100.00%  (p=0.000 n=8+8)
    EncodeRLP/receipt-full-8             320B ± 0%      320B ± 0%      ~     (all equal)
2022-08-26 14:44:54 +08:00
zjubfd
f2b1f3f128
Merge pull request #1061 from qinglin89/dev-merge
fix: upstream patches
2022-08-23 10:43:14 +08:00
Zhang Zhuo
94885ae9ca core/vm: fix sstore gas comment type (#24583) 2022-08-22 14:43:14 +08:00
rjl493456442
9c72720d9f eth/downloader: ignore zero size header batch for importing (#24569)
* eth/downloader: ignore zero size header batch for importing

* core, light: reject empty header batch for importing
2022-08-22 14:43:14 +08:00
Ceyhun Onur
413a42d9ce core/rawdb: add HasCode, HashTrieNode and use them where possible (#24454) 2022-08-22 14:43:14 +08:00
dylanhuang
c3e3b1128d
consensus: fix the GasLimitBoundDivisor (#1060) 2022-08-22 11:24:50 +08:00
Martin Holst Swende
788b77115c core/state: fix read-meters + simplify code (#24304) 2022-08-19 07:31:35 +08:00
Roshan
11d2bae157
bep153: Native Staking on BSC (#1051) 2022-08-18 14:36:45 +08:00
joeycli
895c077f8a fix bug #1034, offline tool start failed when start with pruneancient 2022-08-16 14:02:45 +08:00
Leon
76e3c9071a [R4R] Pipecommit enable trie prefetcher (#992) 2022-08-01 17:41:50 +08:00