Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[PAN-2952] Add storage key preimage tracking #1772

Merged
merged 14 commits into from
Jul 29, 2019

Conversation

mbaxter
Copy link
Contributor

@mbaxter mbaxter commented Jul 26, 2019

PR description

This PR enables debug_storageRangeAt to display storage trie key preimages by adding a new storage class: WorldStatePreimageStorage. This class is backed by a new type of KeyValueStorage (LimitedInMemoryKeyValueStorage) which caps the amount of data kept in-memory. This new storage object is provided to WorldStateArchive which passes it to any WorldState instances created from the archive. Accounts returned from WorldState instances then use this preimage storage to return AccountStorageEntry's with optional key preimages from storageEntriesFrom().

@mbaxter mbaxter marked this pull request as ready for review July 29, 2019 14:50
@@ -31,38 +32,58 @@
import org.apache.logging.log4j.Logger;

public class RocksDbStorageProvider {
public static long DEFAULT_WORLD_STATE_PREIMAGE_CACHE_SIZE = 5_000L;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to expose a --X option for this value? Either as the default or the value that is wired into the world state storage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe? I think we should be adding those options on an as-needed basis for the time being, so I'll leave it for a potential follow-up PR.

@mbaxter mbaxter merged commit 4abacc3 into PegaSysEng:master Jul 29, 2019
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