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

Clarify & strengthen spec around read-write symmetry & canonical encodings #406

Open
verios-google opened this issue Dec 9, 2022 · 1 comment

Comments

@verios-google
Copy link
Contributor

While reading the P4 runtime specification to understand the property of read-write symmetry and the use of canonical encodings, it felt like the specification could be clarified and strengthened around these topics. Specifically, the following concerns were identified and solutions proposed:

Concern 0: Clarify that read-write symmetry excludes read-only property,in other words, it applies only to writable properties. Introduce the notion of read-only vs writable properties. An example of a read-only property is counters.
Concern 1: Read-write symmetry is not strictly required today; would be nice if it was.
Concern 2: Without imposing additional constraints on the client, we cannot ensure canonical forms & read-write symmetry at the same time. Need to decide which one to prefer or be willing to make a breaking change.

Straw-man Proposal:
Server guarantees read-write symmetry, regardless of whether writes were in canonical representation or not.
Proposal 1:
Assuming last write/update was in canonical form, server guarantees that read will be in canonical form (and hence read-write symmetry) for a writable property; otherwise all bets are off (with respect to canonicity & read-write symmetry)
   -Weakest approach
   -Harder to express
   -Not a breaking change
Proposal 2:
Servers must unconditionally use canonical encodings. Similar to proposal 1, read-write symmetry is achieved when clients write/update in canonical form.
   -Stronger approach
   -Easier to express
   -Not a breaking change (although more likely for servers to be non-compliant)
Proposal 3:
Clients and servers must both unconditionally use canonical encodings therefore always ensuring read-write symmetry. Servers return an error message when receiving non-canonical messages from clients.
   -Strongest approach
   -Easiest to express
   -Breaking change

@chrispsommers
Copy link
Collaborator

@verios-google Hi, any update/progress?

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

No branches or pull requests

2 participants