-
Notifications
You must be signed in to change notification settings - Fork 224
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
Use a shared enum for key prefixes #4689
Merged
casperlabs-bors-ng
merged 4 commits into
casper-network:feat-2.0
from
jacek-casper:key-prefix-enum
May 7, 2024
Merged
Use a shared enum for key prefixes #4689
casperlabs-bors-ng
merged 4 commits into
casper-network:feat-2.0
from
jacek-casper:key-prefix-enum
May 7, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jacek-casper
requested review from
EdHastingsCasperAssociation and
darthsiroftardis
May 1, 2024 13:57
EdHastingsCasperAssociation
requested changes
May 2, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
EdHastingsCasperAssociation
approved these changes
May 3, 2024
bors r+ |
casperlabs-bors-ng bot
added a commit
that referenced
this pull request
May 3, 2024
4640: burn implemented r=EdHastingsCasperAssociation a=hoffmannjan Implements casper-network/ceps#92 4689: Use a shared enum for key prefixes r=EdHastingsCasperAssociation a=jacek-casper I need a way to query global state by prefixes for https://app.zenhub.com/workspaces/core-protocol-60953fafb1945f0011a3592d/issues/gh/casper-network/casper-node/4686. The existing code manually encodes byte arrays wherever a lookup by prefix was needed, but that's difficult to keep track of and it's pretty prone to errors, so I decided to create an enum that represents all possible key prefix combinations (excluding ones that are too broad, like querying all system/account/contract entities). This enum allows us to have a single data type for all the prefix lookups. Its deserializer is tested against the Key serializer to ensure that it remains binary compatible with the `Key` type. This enum can also be a useful way to expose the capability of querying the GS by a prefix to binary port consumers in a safe way, because we can prevent them from making very large queries (like querying with just a key tag) and we can restrict which `KeyPrefix` variants we allow in the binary port. Co-authored-by: Jan Hoffmann <jan@hfmn.pl> Co-authored-by: Ed Hastings <ed@casperlabs.io> Co-authored-by: Jacek Malec <145967538+jacek-casper@users.noreply.github.com>
This PR was included in a batch that successfully built, but then failed to merge into feat-2.0. It will not be retried. Additional information: {"message":"Changes must be made through a pull request.","documentation_url":"https://docs.github.com/articles/about-protected-branches"} |
bors r+ |
Build succeeded: |
casperlabs-bors-ng
bot
merged commit May 7, 2024
8db0e07
into
casper-network:feat-2.0
3 checks passed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I need a way to query global state by prefixes for https://app.zenhub.com/workspaces/core-protocol-60953fafb1945f0011a3592d/issues/gh/casper-network/casper-node/4686. The existing code manually encodes byte arrays wherever a lookup by prefix was needed, but that's difficult to keep track of and it's pretty prone to errors, so I decided to create an enum that represents all possible key prefix combinations (excluding ones that are too broad, like querying all system/account/contract entities). This enum allows us to have a single data type for all the prefix lookups. Its deserializer is tested against the Key serializer to ensure that it remains binary compatible with the
Key
type.This enum can also be a useful way to expose the capability of querying the GS by a prefix to binary port consumers in a safe way, because we can prevent them from making very large queries (like querying with just a key tag) and we can restrict which
KeyPrefix
variants we allow in the binary port.