Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: reduce the chain db size #816

Merged
merged 3 commits into from
Jan 24, 2025

Conversation

gzliudan
Copy link
Collaborator

@gzliudan gzliudan commented Jan 23, 2025

Proposed changes

This PR fixes the issue #570. It reduces the size of chain database by the following PRs from geth:

Changelog:

  • database version 4
    • the BlockNumber, TxHash, TxIndex, BlockHash and Index fields of log are deleted
    • the Bloom field of receipt is deleted
    • the BlockIndex and TxIndex fields of txlookup are deleted
  • database version 5
    • the TxHash, GasCost, and ContractAddress fields are no longer stored for a receipt
    • the TxHash, GasCost, and ContractAddress fields are computed by looking up the receipts' corresponding block
  • database version 6
    • Transaction lookup information stores the corresponding block number instead of block hash

Notice: this PR only make new data smaller, we will reduce the old data in another PR later.

Types of changes

What types of changes does your code introduce to XDC network?
Put an in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)
  • Regular KTLO or any of the maintaince work. e.g code style
  • CICD Improvement

Impacted Components

Which part of the codebase this PR will touch base on,

Put an in the boxes that apply

  • Consensus
  • Account
  • Network
  • Geth
  • Smart Contract
  • External components
  • Not sure (Please specify below)

Checklist

Put an in the boxes once you have confirmed below actions (or provide reasons on not doing so) that

  • This PR has sufficient test coverage (unit/integration test) OR I have provided reason in the PR description for not having test coverage
  • Provide an end-to-end test plan in the PR description on how to manually test it on the devnet/testnet.
  • Tested the backwards compatibility.
  • Tested with XDC nodes running this version co-exist with those running the previous version.
  • Relevant documentation has been updated as part of this PR
  • N/A

@gzliudan gzliudan force-pushed the reduce_chaindb_size branch from 35b8bc4 to 4e5a7fa Compare January 23, 2025 02:36
@gzliudan gzliudan changed the title all: reduce chain database size all: reduce the chain database's size Jan 23, 2025
@gzliudan gzliudan changed the title all: reduce the chain database's size [In Test] all: reduce the chain database's size Jan 23, 2025
@gzliudan gzliudan force-pushed the reduce_chaindb_size branch 2 times, most recently from 4d1b40f to a88e48f Compare January 23, 2025 07:45
@gzliudan gzliudan changed the title [In Test] all: reduce the chain database's size [In Test] all: reduce the chain db size Jan 23, 2025
@gzliudan gzliudan changed the title [In Test] all: reduce the chain db size all: reduce the chain db size Jan 24, 2025
@gzliudan gzliudan force-pushed the reduce_chaindb_size branch from a88e48f to 85fc567 Compare January 24, 2025 07:53
@gzliudan gzliudan merged commit 6e6c8d2 into XinFinOrg:dev-upgrade Jan 24, 2025
13 checks passed
@gzliudan gzliudan deleted the reduce_chaindb_size branch January 24, 2025 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants