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

Provide an option that disables ledger state #905

Closed
kderme opened this issue Oct 21, 2021 · 0 comments
Closed

Provide an option that disables ledger state #905

kderme opened this issue Oct 21, 2021 · 0 comments
Labels
audit issues raised as a result of internal or external audit enhancement New feature or request

Comments

@kderme
Copy link
Contributor

kderme commented Oct 21, 2021

db-sync maintains a ledger state internally and applies each block it receives to it. This is done to extract a number of data that are not included in the block, like rewards, stake distribution, deposits refunds and a number of ledger events, which are the byproduct of block application to a ledger.

Ledger has become pretty big in memory and block application takes a big chunk of the total db-sync syncing. At the same time db-sync is used for many different reason, like data analysis, by light wallets, and recently for smash. Many of the above never use the table fields that require the ledger state. Resources can be drastically reduced by running a flavour that doesn't maintain ledger state.

Changes that this will be required to provide this option:

  • ledger states disk snapshots will not be necessary
  • rewards validation will not be executed, since stake accounting requires ledger state.
  • some table fields may need to become nullable. We can't have different schemas, so we will need to fit all options to the same schema.
  • We will need good documentation to make sure users know what is and what is not available in the db and what queries are valid, based on the options provided. We already do something like this with the extended version.
  • Probably we need to merge first https://github.com/input-output-hk/cardano-db-sync/pull/904/files which is a big simplification of the db-sync codebase.

snapshots will still be compatible with all options.

@kderme kderme added bug Something isn't working audit issues raised as a result of internal or external audit enhancement New feature or request and removed bug Something isn't working labels Oct 21, 2021
@kderme kderme mentioned this issue May 26, 2022
7 tasks
@kderme kderme closed this as completed Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit issues raised as a result of internal or external audit enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant