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

CSPR Burning #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

CSPR Burning #92

wants to merge 1 commit into from

Conversation

devendran-m
Copy link

@devendran-m devendran-m commented Feb 21, 2024

casperlabs-bors-ng bot added a commit to casper-network/casper-node 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 <[email protected]>
Co-authored-by: Ed Hastings <[email protected]>
Co-authored-by: Jacek Malec <[email protected]>
casperlabs-bors-ng bot added a commit to casper-network/casper-node that referenced this pull request May 6, 2024
4640: burn implemented r=EdHastingsCasperAssociation a=hoffmannjan

Implements casper-network/ceps#92

Co-authored-by: Jan Hoffmann <[email protected]>
Co-authored-by: Ed Hastings <[email protected]>
casperlabs-bors-ng bot added a commit to casper-network/casper-node that referenced this pull request May 6, 2024
4640: burn implemented r=EdHastingsCasperAssociation a=hoffmannjan

Implements casper-network/ceps#92

Co-authored-by: Jan Hoffmann <[email protected]>
Co-authored-by: Ed Hastings <[email protected]>
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.

2 participants