vtprotobuf icon indicating copy to clipboard operation
vtprotobuf copied to clipboard

Support stable marshaling

Open benjamin99 opened this issue 1 year ago • 1 comments

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: https://github.com/planetscale/vtprotobuf/issues/82.

The PR adjusted the marshal plugin like the one in https://github.com/planetscale/vtprotobuf/pull/44.

benjamin99 avatar Feb 06 '24 15:02 benjamin99

+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

howardjohn avatar Mar 15 '24 13:03 howardjohn