[Storehouse] 015 - add util to extract payloadless - #8608
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
||
| log.Info().Msg("loading V7 checkpoint and replaying WAL until the target trie is found") | ||
|
|
||
| found, err := diskWal.ReplayOnPayloadlessForestUntil(forest, targetRootHash) |
There was a problem hiding this comment.
We use a different replay function because the original replay would always replay ALL wal files, even if we have found a trie root hash.
For instance, given we have a root.checkpoint.v7 file and 3 wal files: 000, 001, 002. And wal file 001 contains a trie update of root hash A. If we need to extract state for root hash A, the original replay would initialize the DiskWAL by replaying all 3 wal files, if 002 has 1000 trie updates, then the final forest will not include A. However, we could stop wal replaying as soon as replaying 001 and found root hash A, so that the final forest has A as last trie's root hash, and can be used for extracting state.
415f130 to
8a646c8
Compare
92167ff to
3f7b070
Compare
8a646c8 to
2998458
Compare
3f7b070 to
9269e95
Compare
2998458 to
58dc7cd
Compare
9269e95 to
ccdfa7e
Compare
This PR adds a
execution-state-extract-payloadlessutil to extract a v7 checkpoint (payloadless) from wal files.It does not support migration, because migration can be done by generating a wal file with migrated trie updates.