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

Fix store #3149

Merged
merged 4 commits into from
Feb 21, 2024
Merged

Fix store #3149

merged 4 commits into from
Feb 21, 2024

Conversation

shargon
Copy link
Member

@shargon shargon commented Feb 20, 2024

@@ -20,7 +19,7 @@ namespace Neo;
static class Benchmarks
{
private static readonly ProtocolSettings protocol = ProtocolSettings.Load("config.json");
private static readonly NeoSystem system = new(protocol, new MemoryStore());
private static readonly NeoSystem system = new(protocol, (string)null);
Copy link
Member

Choose a reason for hiding this comment

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

So, what will be the default store?

Copy link
Member Author

Choose a reason for hiding this comment

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

Memory

Copy link
Member

@vncoelho vncoelho left a comment

Choose a reason for hiding this comment

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

It is related to the PR that made MemoryStore the default one, right?

So, let's change the .config.json default to be MemoryStore, in this way we remove LevelDB dependency, keeping the idea behind the original change.

Copy link
Member

@vncoelho vncoelho left a comment

Choose a reason for hiding this comment

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

It is working, @shargon, fix the problem, but I am not sure about the default

/// <param name="storageProvider">The storage engine used to create the <see cref="IStoreProvider"/> objects. If this parameter is <see langword="null"/>, a default in-memory storage engine will be used.</param>
/// <param name="storagePath">The path of the storage. If <paramref name="storageProvider"/> is the default in-memory storage engine, this parameter is ignored.</param>
public NeoSystem(ProtocolSettings settings, string? storageProvider = null, string? storagePath = null) :
this(settings, StoreFactory.GetStoreProvider(storageProvider ?? nameof(MemoryStore)), storagePath)
Copy link
Member Author

Choose a reason for hiding this comment

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

@vncoelho the default is memory

Copy link
Member

@superboyiii superboyiii left a comment

Choose a reason for hiding this comment

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

Tested. This works!

@shargon shargon added the Bug Used to tag confirmed bugs label Feb 21, 2024
@shargon shargon merged commit ffa9064 into master Feb 21, 2024
7 checks passed
@shargon shargon deleted the core-fix-store branch February 21, 2024 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Used to tag confirmed bugs Waiting for Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DBFT plugin can't be loaded correctly
4 participants