go-ethereum/core/rawdb
Manav Darji d95c05b98a
Enable ancient block pruning (#1216)
* core/state: typo

Signed-off-by: Delweng <delweng@gmail.com>

* core/rawdb: backport from https://github.com/bnb-chain/bsc/pull/543

Signed-off-by: Delweng <delweng@gmail.com>

* eth,ethdb,node,core/state: backport from https://github.com/bnb-chain/bsc/pull/543

Signed-off-by: Delweng <delweng@gmail.com>

* eth,core: backport from https://github.com/bnb-chain/bsc/pull/543

Signed-off-by: Delweng <delweng@gmail.com>

* cmd: open db with freeze disabled

Signed-off-by: Delweng <delweng@gmail.com>

* cli: snapshot prune-block

Signed-off-by: Delweng <delweng@gmail.com>

* fix typo

Signed-off-by: Delweng <delweng@gmail.com>

* cli/snapshot: fix the issue of dup open db error

Signed-off-by: Delweng <delweng@gmail.com>

* cli/snapshot: resolve datadir and ancient before backup

Signed-off-by: Delweng <delweng@gmail.com>

* core: more prune-block log

Signed-off-by: Delweng <delweng@gmail.com>

* core: truncatetail missing f.offset

Signed-off-by: Delweng <delweng@gmail.com>

* core/rawdb: indextx adjust offset of pruned block

Signed-off-by: Delweng <delweng@gmail.com>

* core/rawdb: freezer batch should implement the offset commit, ref https://github.com/bnb-chain/bsc/pull/1005

Signed-off-by: Delweng <delweng@gmail.com>

* core: check of ancientdb, backport https://github.com/bnb-chain/bsc/pull/817

Signed-off-by: Delweng <delweng@gmail.com>

* core/state: read raw borReceipt to backup

Signed-off-by: Delweng <delweng@gmail.com>

* core/rawdb: bor receipt maybe in []Receipt or Receipt RLP format

Signed-off-by: Delweng <delweng@gmail.com>

* core/state: typo and error msg

Signed-off-by: Delweng <delweng@gmail.com>

* core/rawdb: offSet -> offset

Signed-off-by: Delweng <delweng@gmail.com>

* cli/snapshot: comment

Signed-off-by: Delweng <delweng@gmail.com>

* cli/snapshot: add prune-block doc

Signed-off-by: Delweng <delweng@gmail.com>

* docs: add prune-block document

Signed-off-by: Delweng <delweng@gmail.com>

* core/rawdb: print wrong bor-receipt length

Signed-off-by: Delweng <delweng@gmail.com>

* internal/cli: add snapshot prune block tests (referenced from bsc's PR)

* improve errors

* cmd, core, eth, internal: fix lint

* internal/cli: refactor snapshot prune block test

* fix linters in tests

* internal/cli: add inspect-ancient-db command, update docs

* pruner: use a generic function for simplification

* internal/cli: fixes for inspect-db command

* internal/cli: improve pruning tests

* core/rawdb: update end block calculation logic in inspect command

* core/rawdb: improve checks db initialisation

* core/rawdb: remove offset check

* update mocks for span, ethdb and add command in makefile

* docs/cli: update docs with inspect command

* go mod tidy

* refactor and resolve conflicts

* resolve more conflicts

* refactor

* explicitly read node for hash scheme

* add check for hash scheme, fix tests

* fix typo

* update docs and add warning

* raise error if pbss is enabled

* revert read raw bor receipt change

* consensus/bor: handle nil header case in get root hash

* address comments

* core/rawdb: check chain continuity by matching parent hash

* core/rawdb: account for pruned ancient blocks

* go mod tidy

* fix tests

* fix tests

---------

Signed-off-by: Delweng <delweng@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
2024-05-09 11:19:34 +05:30
..
testdata core/rawdb: avoid unnecessary receipt processing for log filtering (#23147) 2021-09-28 12:54:49 +02:00
accessors_chain.go Enable ancient block pruning (#1216) 2024-05-09 11:19:34 +05:30
accessors_chain_test.go Enable ancient block pruning (#1216) 2024-05-09 11:19:34 +05:30
accessors_indexes.go merge geth v1.12.2 into develop 2023-08-18 14:05:34 +05:30
accessors_indexes_test.go merge geth v1.12.2 into develop 2023-08-18 14:05:34 +05:30
accessors_metadata.go Merge tag 'v1.13.5' of https://github.com/ethereum/go-ethereum into shivam/upstream-geth-1.13.5 2023-12-15 13:55:57 +05:30
accessors_snapshot.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
accessors_state.go merge geth v1.12.2 into develop 2023-08-18 14:05:34 +05:30
accessors_sync.go Merge tag 'v1.13.5' of https://github.com/ethereum/go-ethereum into shivam/upstream-geth-1.13.5 2023-12-15 13:55:57 +05:30
accessors_trie.go Merge tag 'v1.13.5' of https://github.com/ethereum/go-ethereum into shivam/upstream-geth-1.13.5 2023-12-15 13:55:57 +05:30
ancient_scheme.go Merge tag 'v1.13.5' of https://github.com/ethereum/go-ethereum into shivam/upstream-geth-1.13.5 2023-12-15 13:55:57 +05:30
ancient_utils.go Merge tag 'v1.13.5' of https://github.com/ethereum/go-ethereum into shivam/upstream-geth-1.13.5 2023-12-15 13:55:57 +05:30
bor_receipt.go Enable ancient block pruning (#1216) 2024-05-09 11:19:34 +05:30
chain_freezer.go Enable ancient block pruning (#1216) 2024-05-09 11:19:34 +05:30
chain_iterator.go Enable ancient block pruning (#1216) 2024-05-09 11:19:34 +05:30
chain_iterator_test.go merge geth v1.12.2 into develop 2023-08-18 14:05:34 +05:30
checkpoint.go all: implement milestones (#961) 2023-08-28 18:42:21 +05:30
database.go Enable ancient block pruning (#1216) 2024-05-09 11:19:34 +05:30
database_test.go all: update license headers and AUTHORS from git history (#24947) 2022-05-24 20:39:40 +02:00
freezer.go Enable ancient block pruning (#1216) 2024-05-09 11:19:34 +05:30
freezer_batch.go Enable ancient block pruning (#1216) 2024-05-09 11:19:34 +05:30
freezer_meta.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
freezer_meta_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
freezer_resettable.go Enable ancient block pruning (#1216) 2024-05-09 11:19:34 +05:30
freezer_resettable_test.go dev: fix: all remaining lint issues 2023-06-19 11:39:59 +02:00
freezer_table.go Enable ancient block pruning (#1216) 2024-05-09 11:19:34 +05:30
freezer_table_test.go Enable ancient block pruning (#1216) 2024-05-09 11:19:34 +05:30
freezer_test.go Enable ancient block pruning (#1216) 2024-05-09 11:19:34 +05:30
freezer_utils.go Merge tag 'v1.13.5' of https://github.com/ethereum/go-ethereum into shivam/upstream-geth-1.13.5 2023-12-15 13:55:57 +05:30
freezer_utils_test.go dev: fix: all remaining lint issues 2023-06-19 11:39:59 +02:00
key_length_iterator.go V0.2.16 candidate (#373) 2022-05-06 12:31:48 +02:00
key_length_iterator_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
milestone.go fix testcase syntax 2023-09-20 15:57:37 +05:30
schema.go Enable ancient block pruning (#1216) 2024-05-09 11:19:34 +05:30
table.go Enable ancient block pruning (#1216) 2024-05-09 11:19:34 +05:30
table_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00