rjl493456442
8b53b92eb4
core, trie: rework trie committer ( #25320 )
...
* all: rework trie and trie committer
* all: get rid of internal cache in trie
* all: fixes
* trie: polish
* core, trie: address comments
* trie: fix imports
* core/state: address comments
* core/state/snapshot: polish
* trie: remove unused code
* trie: update tests
* trie: don't set db as nil
* trie: address comments
* trie: unskip test
2 years ago
rjl493456442
9d76a9b94f
core, trie, eth, cmd: rework preimage store ( #25287 )
...
* core, trie, eth, cmd: rework preimage store
* trie: address comment
2 years ago
Delweng
b196ad1c16
all: add whitespace linter ( #25312 )
...
* golangci: typo
Signed-off-by: Delweng <delweng@gmail.com>
* golangci: add whietspace
Signed-off-by: Delweng <delweng@gmail.com>
* *: rm whitesapce using golangci-lint
Signed-off-by: Delweng <delweng@gmail.com>
* cmd/puppeth: revert accidental resurrection
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2 years ago
rjl493456442
1657e43931
core, les, eth: port snap sync changes ( #24898 )
...
core, eth, les, trie: rework snap sync
2 years ago
Seungbae.yu
44893be0d6
core, eth: pre-allocate map in storage copy ( #25279 )
2 years ago
aaronbuchwald
300f6121ad
core/rawdb: simplify TestDiskSeek to use memorydb ( #25182 )
2 years ago
Martin Holst Swende
a907d7e81a
all: more linters ( #24783 )
...
This enables the following linters
- typecheck
- unused
- staticcheck
- bidichk
- durationcheck
- exportloopref
- gosec
WIth a few exceptions.
- We use a deprecated protobuf in trezor. I didn't want to mess with that, since I cannot meaningfully test any changes there.
- The deprecated TypeMux is used in a few places still, so the warning for it is silenced for now.
- Using string type in context.WithValue is apparently wrong, one should use a custom type, to prevent collisions between different places in the hierarchy of callers. That should be fixed at some point, but may require some attention.
- The warnings for using weak random generator are squashed, since we use a lot of random without need for cryptographic guarantees.
2 years ago
Gustavo Silva
eb94896270
Chore: Minimal gramatical errors (signleton -> singleton) ( #25057 )
...
core: fix typos
2 years ago
rjl493456442
22defa5af7
all: introduce trie owner notion ( #24750 )
...
* cmd, core/state, light, trie, eth: add trie owner notion
* all: refactor
* tests: fix goimports
* core/state/snapshot: fix ineffasigns
Co-authored-by: Martin Holst Swende <martin@swende.se>
2 years ago
Martin Holst Swende
c375ee91e9
cmd/geth, core/state/snapshot: rework journal loading, implement account-check ( #24765 )
...
* cmd/geth, core/state/snapshot: rework journal loading, implement account-check
* core/state/snapshot, cmd/geth: polish code (#37 )
* core/state/snapshot: minor nits
* core/state/snapshot: simplify error logic
* cmd/geth: go format
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2 years ago
Felix Lange
9244d5cd61
all: update license headers and AUTHORS from git history ( #24947 )
2 years ago
rjl493456442
59ac229f87
core/state/snapshot: detect and clean up dangling storage snapshot in generation ( #24811 )
...
* core/state/snapshot: check dangling storages when generating snapshot
* core/state/snapshot: polish
* core/state/snapshot: wipe the last part of the dangling storages
* core/state/snapshot: fix and add tests
* core/state/snapshot: fix comment
* README: remove mentions of fast sync (#24656 )
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
* core, cmd: expose dangling storage detector for wider usage
* core/state/snapshot: rename variable
* core, ethdb: use global iterators for snapshot generation
* core/state/snapshot: polish
* cmd, core/state/snapshot: polish
* core/state/snapshot: polish
* Update core/state/snapshot/generate.go
Co-authored-by: Martin Holst Swende <martin@swende.se>
* ethdb: extend db test suite and fix memorydb iterator
* ethdb/dbtest: rollback changes
* ethdb/memorydb: simplify iteration
* core/state/snapshot: update dangling counter
* core/state/snapshot: release iterators
* core/state/snapshot: update metrics
* core/state/snapshot: update time metrics
* metrics/influxdb: temp solution to present counter meaningfully, remove it
* add debug log, revert later
* core/state/snapshot: fix iterator panic
* all: customized snapshot iterator for backward iteration
* core, ethdb: polish
* core/state/snapshot: remove debug log
* core/state/snapshot: address comments from peter
* core/state/snapshot: reopen the iterator at the next position
* ethdb, core/state/snapshot: address comment from peter
* core/state/snapshot: reopen exhausted iterators
Co-authored-by: Tbnoapi <63448616+nuoomnoy02@users.noreply.github.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Martin Holst Swende <martin@swende.se>
3 years ago
Marius van der Wijden
86d5477079
core/state/snapshot: fix race condition ( #24685 )
...
Fixes three race conditions found through fuzzing by David Theodore
3 years ago
s7v7nislands
5a584c2133
all: use common.FileExist for checking file existence ( #24748 )
3 years ago
Martin Holst Swende
0914234d10
cmd/geth, core/state/snapshot: fix flaw in dangling-storage check + inspect difflayers ( #24677 )
...
This PR fixes the flaw that @rjl493456442 found in https://github.com/ethereum/go-ethereum/pull/#issuecomment-1093817551 , namely, that the snapshot iterator uses the combined (disk + difflayers) 'view', wheres the raw iterator uses only the disk 'view'.
This PR instead splits up the work: one phase is iterating the disk layer data, another phase is loading the journalled difflayers and performing the same check there.
3 years ago
Eng Zer Jun
8d066f1f42
all: use T.TempDir to create temporary test directories ( #24633 )
...
This commit replaces ioutil.TempDir with t.TempDir in tests. The
directory created by t.TempDir is automatically removed when the test
and all its subtests complete.
Prior to this commit, temporary directory created using ioutil.TempDir
had to be removed manually by calling os.RemoveAll, which is omitted in
some tests. The error handling boilerplate e.g.
defer func() {
if err := os.RemoveAll(dir); err != nil {
t.Fatal(err)
}
}
is also tedious, but t.TempDir handles this for us nicely.
Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
3 years ago
Péter Szilágyi
f6891ba40d
core/state/snapshot: remove noop map item assignment
3 years ago
rjl493456442
25bd17d725
core/state/snapshot: clean up the generation code ( #24479 )
3 years ago
aaronbuchwald
c3701b265e
core/rawdb: add specified key length iterator ( #24535 )
3 years ago
Ceyhun Onur
8401e4277a
core/rawdb: add HasCode, HashTrieNode and use them where possible ( #24454 )
3 years ago
Péter Szilágyi
48605b5f61
core/statedb: always clear out access list when setting a new one
3 years ago
Martin Holst Swende
51e7968b8b
core/state: fix read-meters + simplify code ( #24304 )
3 years ago
Martin Holst Swende
51eb5f8ca8
cmd/geth: add db cmd to show metadata ( #23900 )
...
* cmd/geth: add db cmd to show metadata
* cmd/geth: better output generator status
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
* cmd: minor
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
3 years ago
Péter Szilágyi
58d1988349
core, eth, les, trie: remove the sync bloom, used by fast sync
3 years ago
Taeik Lim
85064ed09b
all: fix 'the the' in comments ( #24036 )
3 years ago
Martin Holst Swende
9055cc14ec
core/vm, core/state/snapshot: remove unused code ( #23956 )
...
* core/state/snapshot: remove wiper functionality
* core/vm: remove unused 'unofficial' opcodes
3 years ago
Martin Holst Swende
526c3f6b9e
core/state/snapshot: fix benchmarks ( #23804 )
3 years ago
Ziyuan Zhong
312e02bca9
core/state/snapshot: fix BAD BLOCK error when snapshot is generating ( #23635 )
...
* core/state/snapshot: fix BAD BLOCK error when snapshot is generating
* core/state/snapshot: alternative fix for the snapshot generator
* add comments and minor update
Co-authored-by: Martin Holst Swende <martin@swende.se>
3 years ago
rjl493456442
f915f6873f
core/state/snapshot: fix data race in layer flattening ( #23628 )
...
* core/state/snapshot: fix data race in layer flattening
* core/state/snapshot: fix typo
3 years ago
hsyodyssey
84bccd0900
core/state: fix typos in comments ( #23702 )
3 years ago
hsyodyssey
12f971fb2d
core/state: fix typo in comment ( #23665 )
3 years ago
Guillaume Ballet
443afc975c
core/state: move state account to core/types + abstracted "write account to trie" ( #23567 )
...
* core/state: abstracted "write account to trie" method
* fix appveyor build
* Apply suggestions from code review
Co-authored-by: Martin Holst Swende <martin@swende.se>
* review feedback
* core/state/accounts: move Account to core/types
* core/types: rename Account -> StateAccount
* core/state: restore EncodeRLP for stateObject
* core/types: add the missing file
* more review feedback
* more review feedback
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
3 years ago
Ikko Ashimine
31be5d41d9
core: fix typo in iterator.go ( #23502 )
...
strorage -> storage
3 years ago
gary rong
a5a5237178
core, light, tests, trie: add state metrics ( #23433 )
3 years ago
Péter Szilágyi
9d6480c3cd
core/state/snapshot: gofmt
3 years ago
Tyler Chambers
66948316f7
core/state/snapshot: clarify comment about snapshot repair ( #23305 )
...
Co-authored-by: Tyler Chambers <me@tylerchambers.net>
Co-authored-by: Felix Lange <fjl@twurst.com>
3 years ago
Ziyuan Zhong
57d9e0ac75
core/state/snapshot: fix typo in comment ( #23219 )
3 years ago
Péter Szilágyi
3b38a83274
core/state/pruner: fix state bloom sync permission in Windows
3 years ago
Marius van der Wijden
28ba686cbf
core/state: add trie prefetcher tests ( #23216 )
...
* core/state: add trie prefetcher tests
* core/state: add missing license
3 years ago
aaronbuchwald
82c5085399
cre/state: fix outdated statedb Prepare comment ( #23320 )
3 years ago
Marius van der Wijden
8fe47b0a0d
core/state: avoid unnecessary alloc in trie prefetcher ( #23198 )
3 years ago
Marius van der Wijden
686b2884ee
all: removed blockhash from statedb ( #23126 )
...
This PR removes the blockhash from the statedb
3 years ago
Li Dongwei
bca8c03e57
core/state: remove unused methods ReturnGas, GetStorageProofByHash ( #23092 )
...
Co-authored-by: lidongwei <lidongwei@huobi.com>
3 years ago
Guillaume Ballet
2cde472650
core/state: fix typos in test error message ( #22962 )
3 years ago
gary rong
c73652da0b
core/state/snapshot: fix flaky tests ( #22944 )
...
* core/state/snapshot: fix flaky tests
* core/state/snapshot: fix tests
4 years ago
Martin Holst Swende
addd8824cf
cmd/geth, eth, core: snapshot dump + unify with trie dump ( #22795 )
...
* cmd/geth, eth, core: snapshot dump + unify with trie dump
* cmd/evm: dump API fixes
* cmd/geth, core, eth: fix some remaining errors
* cmd/evm: dump - add limit, support address startkey, address review concerns
* cmd, core/state, eth: minor polishes, fix snap dump crash, unify format
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
4 years ago
Martin Holst Swende
cc606be74c
all: define London+baikal, undefine yolov3, add london override flag ( #22822 )
...
* all: define London+baikal, undefine yolov3, add london override flag
* cmd, core, params: add baikal genesis definition
4 years ago
Péter Szilágyi
745757ac6b
core, eth: abort snapshot generation on snap sync and resume later
4 years ago
aaronbuchwald
bbb57fd64b
core/state: remove toAddr helper in tests ( #22772 )
4 years ago
Péter Szilágyi
fae165a5de
core, eth, ethdb, trie: simplify range proofs
4 years ago