Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

ledger-tool create-snapshot uses write cache #29119

Merged
merged 2 commits into from
Dec 8, 2022

Conversation

jeffwashington
Copy link
Contributor

@jeffwashington jeffwashington commented Dec 6, 2022

Problem

Migrating everything to use write cache so we can eliminate the old code path.
ledger-tool create-snapshot does not use the write cache.
The biggest hang up with using the write cache is a call to calculate_capitalization. That tries to scan storages. But, if we have not written to storages yet because we're using the write cache, then we can't calculate cap correctly. But, if we flush to the write cache, then we later update sys vars in the same slot. As a result, we violate some design constraints by writing to a slot that has already been flushed from the write cache.
A solution to this is to have calculate_capitalization use the index to calculate that capitalization. This could be revisited later but is sufficient for now since it does not affect any real validators.

Summary of Changes

Fixes #

@jeffwashington jeffwashington force-pushed the nov50_16_2 branch 2 times, most recently from 8541aae to fac19d0 Compare December 6, 2022 20:57
@jeffwashington jeffwashington marked this pull request as ready for review December 7, 2022 17:00
Copy link
Contributor

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jeffwashington jeffwashington merged commit 2f47315 into solana-labs:master Dec 8, 2022
gnapoli23 pushed a commit to gnapoli23/solana that referenced this pull request Dec 16, 2022
* ledger-tool create-snapshot uses write cache

* ledger tool create snapshot works with write cache
nickfrosty pushed a commit to nickfrosty/solana that referenced this pull request Jan 4, 2023
* ledger-tool create-snapshot uses write cache

* ledger tool create snapshot works with write cache
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants