planetscale / planetscale/vtprotobuf

Deterministic mode

Open
#82 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.1k
Forks
112
PR merge metrics
No merged PRs in 30d

Description

Upstream proto has a "deterministic" mode: https://github.com/protocolbuffers/protobuf-go/blob/f221882bfb484564f1714ae05f197dea2c76898d/proto/encode.go#L50

I think this is more-strict than marshal_strict (but I could be wrong) in that it also sorts maps.

Interestingly, there is a "Stable" field here: https://github.com/planetscale/vtprotobuf/blob/96ede25e29a0325741fd05d6e9e48364d65ea137/features/marshal/marshalto.go#L43. but its never used.

It might be nice to add this option, or if its already possible documentation around it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the upstream deterministic mode in proto/encode.go with features/marshal/marshalto.go, including the unused Stable field. Determine whether deterministic behavior is already available or requires a new option, then define completion as either implementing that option or documenting the existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.