Add type files for proving system, compliance proving system, delta, and kind.#344
Add type files for proving system, compliance proving system, delta, and kind.#344AHartNtkn wants to merge 15 commits into
Conversation
|
The typecheck failed. Please check the logs. However, the preview is available at https://specs.anoma.net/pr-344/. |
|
|
||
| ### Consumed Resource Witness | ||
|
|
||
| The doc states that each consumed resource has five data points in the witness: |
There was a problem hiding this comment.
Which doc? This sentence sounds like a leftover
There was a problem hiding this comment.
I expect everything I wrote to eventually be overwritten. Copy/editing for leftovers is a waste of time at this point.
There was a problem hiding this comment.
compliance_proof.juvix.md
| Merkle path validity, logic integrity, and delta correctness. | ||
|
|
||
| Below we define the data types for the compliance instance and witness, as | ||
| described in the compliance proof documentation, and then provide a |
There was a problem hiding this comment.
Would a link to the compliance proof documentation make sense here??
|
|
||
| ### ComplianceWitness | ||
|
|
||
| The doc merges all consumed resource witness data and created resource witness |
There was a problem hiding this comment.
Which doc? (See above)
I will stop marking this in the following
There was a problem hiding this comment.
compliance_proof.juvix.md
| 2. `nullifierKey` | ||
| 3. `CTreePath` | ||
| 4. `commitment` | ||
| 5. opening of `logicRefHash` (stored as `ByteString` below) |
There was a problem hiding this comment.
Good question! I have no idea, and it's not explained. It's mentioned in compliance_proof.juvix.md under Witness.
| There also has to exist some method to dereference resources. | ||
|
|
||
| ```juvix | ||
| axiom dereferenceNullifier : LogicRef -> Nullifier; |
There was a problem hiding this comment.
| axiom dereferenceNullifier : LogicRef -> Nullifier; | |
| axiom dereferenceNullifier : NullifierRef -> Nullifier; |
| (List (ConsumedResourceWitness A)) | ||
| (List CreatedResourceWitness); |
There was a problem hiding this comment.
Are these the same? compliance_proof.juvix.md doesn't mention Action when defining the components of witnesses under the #### Witness section. All it says about Action is
Compliance proofs must be composition-independent: composing two actions, the compliance proof sets can be simply united to provide a valid composed action compliance proof set.
otherwise, actions aren't mentioned. I also can't claim to know what actions are supposed to be in the first place.
|
|
||
| The doc’s constraints for each consumed resource: | ||
|
|
||
| 1. `resourceNullifier(r, nk) == nfRef` |
There was a problem hiding this comment.
| 1. `resourceNullifier(r, nk) == nfRef` | |
| 1. `resourceNullifier(r, nk) == nf` |
Why does this return a reference? This appears again later. Am I missing something? An explanation would be great.
There was a problem hiding this comment.
Hmm... the relevant page is compliance_proof.juvix.md. The actual constraint there is
r.nullifier(nullifierKey) is in consumedResourceTagSet
I think I may have also been looking at
r.nullifier(nullifierKey) = nullifierHash(nullifierKey, r)
from nullifier.juvix.md which seems to identify a nullifier with its hash.
I decided to leave these unfinished since I realized I was wasting time thinking about constraints when my job was to make sure the types make sense. Really, these lines should have all been deleted before I pushed.
| The doc’s constraints for each consumed resource: | ||
|
|
||
| 1. `resourceNullifier(r, nk) == nfRef` | ||
| 2. `resourceCommitment(r) == cm` |
There was a problem hiding this comment.
Why is this needed? More explanation would be helpful.
Is this check making sure that the consumed resource has existed before being consumed?
We should also explain what happens in the case of ephemeral resources.
There was a problem hiding this comment.
It's copy/pasted from somewhere in the docs, with slight modification. Specifically, it comes from this line from compliance_proof.juvix.md
2. Consumed commitment integrity: `r.commitment() = cm`
Why is it there? I don't know. You shouldn't be asking me, because I had no input on it in the first place. It was something I was given.
| case nfRefAndRootRef of { | ||
| | (nfRef, rootRf) := | ||
| let | ||
| passNF : Bool := nfRef == resourceNullifier r nk; |
There was a problem hiding this comment.
| passNF : Bool := nfRef == resourceNullifier r nk; | |
| passNF : Bool := nf == resourceNullifier r nk; |
I am also in favour of longer, more explicit naming.
The time being lost on misinterpretations by different teams outweighs the time to write slightly longer names by orders of magnitude.
IMO nullifierDerivationCheck would be a much better name than passNF.
It also makes things more searchable.
… anthony/types_1
Co-authored-by: Michael <20623991+heueristik@users.noreply.github.com>
- fix github workflow error due to deprecated action versions - all workflows: use latest major versions of actions - PR: mkdocs builds in parallel as separate jobs to reduce build time (to 20min from 30min) - PR: do not trigger workflow when PR is edited or marked ready for review ## Error when buildings PRs > Error: This request has been automatically failed because it uses a deprecated version of `actions/cache: v4.0.2`. > Please update your workflow to use v3/v4 of actions/cache to avoid interruptions. > Learn more: https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down ## PR Todo List - **Type of Change**: Mark the relevant option(s) with 'x': - [ ] System Architecture Change - [ ] Node Architecture Change - [ ] Tutorial Enhancement - [ ] Juvix Types/Package Update - [ ] Repository Maintenance - **PR Management**: - [ ] Provide a clear and concise description of the changes. - [ ] Link to important pages of the PR preview if available. - [ ] Add the changelog entry by running the `unclog` command, after creating the PR so that the PR number is taken into account. - [ ] Add the appropriate labels to the PR. - [ ] Assign the PR to the correct person, typically the author. - [ ] Set the milestone for the PR, ensuring it aligns with the next release. - [ ] Confirm if the PR is ready for review; if not, mark it as a draft. - [ ] Ensure the PR title and description are clear and concise. - [ ] Verify that changes are closely related to the PR title and description, focusing on a single change topic per PR. - **Grammar Checks**: Ensure that all text in the PR is grammatically correct. - **Whitespace**: Verify that there are no unnecessary whitespaces in the code. Although, this is may be done automatically by the CI/CD pipeline.

Adds four files to the types folder, corresponding to proving system, compliance proving system, delta, and kind from the RM specs. I'll be honest, I don't know how well I succeeded, or how well it would even be possible to succeed. I did my best; hopefully it's enough to move on.
PR Todo List
unclogcommand, after creatingthe PR so that the PR number is taken into account.
focusing on a single change topic per PR.
code. Although, this is may be done automatically by the CI/CD pipeline.