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

Support stable marshaling #133

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

benjamin99
Copy link

@benjamin99 benjamin99 commented Feb 6, 2024

Description

Hi, I am currently trying to apply the SpiceDB, which utilize vtprotovuf to marshal/unmarshal the db records. Unfortunately, the data itself contains some map fields, which in result will create the nondeterministic serialized results and mess things up when trying to determine whether the data is updated or not.
(https://github.com/authzed/spicedb/blob/5d0eb901634999bbccc7269af2ea582872812a6b/pkg/diff/caveats/diff.go#L155)

In short, I wish to have a plugin being able to support deterministic marshaling behaviors, just like what was mentioned in the issue: #82.

The PR adjusted the marshal plugin like the one in #44.

josephschorr added a commit to josephschorr/spicedb that referenced this pull request Mar 11, 2024
By making the serialized caveat expressions stable, the diff should only return a change now when the caveat expr's has actually changed, rather than pretty much always, thus reducing the storage for "changed" caveats

Fixes authzed#1742

We should go back to MarshalVT once planetscale/vtprotobuf#133 has merged
@howardjohn
Copy link
Contributor

+1, we have a similar use case of our proto wire format being hashed to compare equality where this would help.

I do wonder if we should just modify "strict" to do this as well? Maybe less desirable now that Strict is already shipped though for compatibility

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