-
Notifications
You must be signed in to change notification settings - Fork 17
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
Codec Vectors #12
Codec Vectors #12
Conversation
I believe the disputes_exstrinsic.json test is wrong. the encoded value starts with that According to 272, looks like E_4 was applied instead of E |
@vekexasia I think eq. 277 encoding of From (272)
Which make sense. |
ha! yes sorry the |
Also I think i found another 2 issues while tesitng assurances.
|
This situation is analogous to the previous one. I align with the guidance provided in the GP, just below equation 272, which I report here:
Introducing variable-length encoding for arbitrary fields (e.g., using While it's true that, the given vector has at most For now, I'll adhere to the guidance provided just below equation 272. Should it become a requirement, ideally with a clear rationale, I will gladly adjust the vectors accordingly. :-) If is not required then maybe is the case to make it explicit in the GP. cc @gavofyork ^^^
If you are referring to In the proposed vectors, C is 2. I've updated the README with some notes about this subject |
oh my. I'm sorry I must have missed this from your previous statement. I must also have missed it from the graypaper when I implemented the codecs a while ago. Ultimately it makes sense to have a stricter codec ( Eg: E2 instead of For example it makes a lot of sense to use E2 for the I believe one of the reasons the graypaper exists is to have a formal specification and avoid relying on "pseudocode" or reference implementation. |
Question. https://github.com/davxy/jam-test-vectors/blob/codec-vectors/codec/data/work_result_1.json#L1-L9 I see you set I know the readme states that values may conflict but if my previous statement above is right, the codec should also forbid encoding negative values: |
@vekexasia fixed |
hey @davxy looks like the work report (Set According to (283) first entry should be xa while it seems your binary has xs as first entry |
@vekexasia this has been reported here #9 (comment) see this gavofyork/graypaper#67 for a modification proposal to the GP |
Co-authored-by: Xiliang Chen <[email protected]>
[ | ||
{ | ||
"anchor": "0x0cffbf67aae50aeed3c6f8f0d9bf7d854ffd87cef8358cbbaa587a9e3bd1a776", | ||
"bitfield": "0x01", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we'd like to be more explicit about the actual value of the bitsequence bitfield
(and not the octet representation, I'd change this JSON-testvector to show the following value. The size of the fixed length bitsequence is set to 2 (GP_constant_C). The suggested change below avoids any confusion about its length. That said, this is not really necessary, since the byte representation is also correct (and JSON will eventually not be used).
"bitfield": [
true,
false
],
@davxy I have a question regarding the header binary test vectors: I'm curious as to why we use four bytes to encode an integer as defined in (272) when a single byte would suffice. We can determine the length by reading the prefix, even though it's defined as a |
@boymaas The reasons are design decisions, so you should eventually raise your concerns in the graypaper. In any case, IMHO, it is better to maintain a uniform design for u16/u32 encoding in the protocol rather than saving 1 byte here and there by introducing pitfalls related to variable-length encoding. |
This should be good to merge? |
@xlc As far as I'm concerned, yes, I have nothing to add to this PR, and we haven't received any pushback so far. |
Now is ready :-) |
README first
Once successfully processed by some of the teams, the codec will be applied to:
Partially address #10