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

Db namespaces added to newKvt API #2068

Closed
wants to merge 11 commits into from
Closed

Conversation

web3-developer
Copy link
Contributor

@web3-developer web3-developer commented Mar 12, 2024

This change adds a namespace parameter to the newKvt API. The namespace parameter is a required field and so must be provided. For convenience I've created another proc called newDefaultKvt which will use the default namespace. The older kvt legacy kvt API doesn't have this namespace parameter so we don't need to update all the existing code that uses the older API. Inside the legacy backend the kvtMethods proc checks the namespace and if it is not equal to the default namespace then it adds the prefix byte to the key. This is done to keep the functionality the same while allowing us to change the way we use the newKvt API. When using the new API and setting a non default namespace we should not add the prefix byte before passing in the key.

Currently the legacy database and many of the tests rely on the use of the prefix byte existing in the keys and so it is very difficult to introduce the namespace and remove the byte prefix all at once so I've opted to do the change in smaller steps. This change doesn't yet use the column families in RocksDb, it simply introduces changes to the newKvt API.

Next steps:

  • Add support for the RocksDb column families in the Aristo backend
  • Over time update all the existing code to use the newKvt API and cleanup the code that is setting the prefix byte before passing in the keys.
  • Once all existing code is using the newKvt API then Nimbus could switch over to the Aristo backend.

@web3-developer web3-developer changed the title Db namespaces Db namespaces added to newKvt API Mar 12, 2024
@web3-developer web3-developer marked this pull request as draft March 12, 2024 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant