feat: remaining record content types to support #79
No reviewers
Labels
No Label
bug
C:CLI
C:Crypto
C:Encoding
C:Proto
C:Types
dependencies
docker
documentation
duplicate
enhancement
go
good first issue
help wanted
high priority
in progress
invalid
javascript
low priority
medium priority
question
Status: Stale
Type: ADR
Type: Build
Type: CI
Type: Docs
Type: Tests
urgent
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/laconicd-deprecated#79
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "murali/record-attributes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes: #51
Description
Record attributes indexing for remaining defined type of records.
For contributor use:
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerFor admin use:
WIP
,R4R
,docs
, etc)This all looks great! I made some comments to fill in a few fields that were missing in the specification or under/mis-specified, also suggest clarifying which fields are content hash references (renaming to e.g.
hash_reference
) so went through and noted all of the linkages.@ -23,3 +29,3 @@
}
message WebsiteRegistrationRecord {
This was underspecified on my part, instead of a
raw_multicodec
field and araw_binary
field, all we need is ahash_reference
field. And this reference will be a CID or multihash which uses the raw mutliformat prefix and references the binary as an IPLD object.Let's rename this to
JSPackage
and add astring name=5;
fieldThis will reference a registered
GitRepository
record by CID/multihashGitRepository
also has arepo_reference
field which will contain a qualitative/non-content-hash-reference e.g. a github or gitea web url.It might be helpful to signal in the naming of the various
reference
fields which references are content-hash => content references vs one's that are not. E.g.hash_reference
vsreference
.Note:
hash_reference
to aGitRepository
IPLD objectNote:
hash_reference
to binary IPLD objectNote:
hash_reference
to aGitRepository
IPLD objectNote:
hash_reference
to aChainRegistrationRecord
IPLD objectNote:
hash_reference
to a WASM IPLD objectNote:
hash_reference
toServiceProviderRecord
IPLD objectNote:
hash_reference
toWatcherRegistrationRecord
IPLD objectNote:
hash_reference
to auction result IPLD objectNote:
hash_reference
toJSPackage
IPLD objectLet's add fields:
string chain_id
string network_id
string genesis_hash
@0xmuralik for all of the
reference
fields that are hash-links, we should considering using the previous convention with "/"E.g.
npm_package_ref
renamed tohash_reference
(or not, since now the "/" already signifies the hash-link nature of the reference) withhash_reference
a map of "/" to the CID. This should prevent the need for https://github.com/cerc-io/laconicd/issues/78.@ -23,3 +29,3 @@
}
message WebsiteRegistrationRecord {
There is also a npm_package_reference (CID) in this message. Should we go with renaming repo_reference with repo_hash_reference and npm_package_reference with js_package_hash_ref?
is the genesis_hash a CID reference or just a hash string?
@i-norden Can you suggest a preffered method here?
@i-norden Can you suggest a preffered method here?
Good question... let's go with full CID for now
Hmm I'm not sure, it is not apparent to me what the
tags
oraddresses
fields are supposed to represent in theTag
message. I see the new examples you have created, was there an old example .yml for this type?Same here unfortunately, not familiar with these types and isn't obvious to me what
ref
andos
are supposed to represent in these mappings. Going to ask Ashwin.@ -23,3 +29,3 @@
}
message WebsiteRegistrationRecord {
We can avoid adding
hash
to the field names and instead we should revert to using a/
sub-mapping to denote CID/linkBlocklisted import reflect
Blocklisted import reflect
Show more details
expected exactly 1 statement (either append, delete, or copying to another map) in a range with a map, got 2
expected exactly 1 statement (either append, delete, or copying to another map) in a range with a map, got 2
Show more details
Sensitive package import
Certain system packages contain functions which may be a possible source of non-determinism
Show more details
Iteration over map
Iteration over map may be a possible source of non-determinism
Show more details
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
Additional details and impacted files
48.20% <52.63%> (-0.72%)
96.21% <100.00%> (ø)
89.27% <100.00%> (ø)
96.99% <100.00%> (ø)
@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"reflect" // #nosec G702 This is also used in eip712 antehandler code. No new risk introduced.
Sensitive package import
Certain system packages contain functions which may be a possible source of non-determinism
Show more details
Thanks Murali! Before we merge this, we need to make the corresponding changes in laconic-sdk and laconic-cli-registry and run their tests to ensure these changes work with those.
Let's hold off in this for now as Michael is working on squashing some intercompatibility bugs due to not doing this in the past, and it will be cleaner to work off of his results than to begin in parallel.
@i-norden @ABastionOfSanity @aleem1314
TODO: Merge https://github.com/cerc-io/laconic-sdk/pull/27
@0xmuralik I haven't dug into this again fully yet, but before doing so let's revert back to the
"/" usage for link delineation in order to fix this bug: https://github.com/cerc-io/laconicd/issues/78 (and also will be useful elsewhere).
To use "/" we'll have to use a map for hash references. As using maps in cosmos-sdk might lead to non determinism and is not recommended, I have taken this approach. Even though there will be only one item in this map of references and we don't have any risk of non-determinisim, I thought its safer to avoid maps and just change the getReference logic in GQL to support the new
HashReference
type.@0xmuralik let's revert to using "/" please, it was a mistake on my part to suggest we move away from this standard in the first place. I appreciate the concerns for non-determinism, but as you said since it only contains a single entry this is not an issue. This will fix the issue in https://github.com/cerc-io/laconicd/issues/78 and will prevent similar issues from cropping up downstream. In general, we need some way of detecting whether or not a field in these records is a link without knowing the the specifics of the field (e.g. name), this will be useful once we move to more generic type support. Using "/" to delineate a link is also the standard in the IPLD domain.
@i-norden @aleem1314 getting error while using map[] in txs
vulcanize.registry.v1beta1.WebsiteRegistrationRecord.RepoReferenceEntry" does not implement proto.Message
atf71df80e93/x/auth/tx/decoder.go (L40)
Same error is returned when @aleem1314 tried with a unit test inculing map[] on cosmos-sdk for
f71df80e93/codec/unknownproto/unknown_fields.go (L41)
Submitted issue to cosmos-sdk
https://github.com/cosmos/cosmos-sdk/issues/15254
Thanks for opening that issue, looks like I may have sent you on a wild goose hunt. Even if the change is acceptable I don't think we can expect the ICF team to investigate and implement the change as it is not critical to the sdk. So I think we have two options:
@i-norden by adding a json tag to the ref field , we can avoid using maps and still keep "/" for referencing CIDs.
The proto messages will use the
Hash reference
message. When the message is converted to and from json it will use a "/" instead of "ref" as the key to CID reference.The store will have record objects with "Hash Reference" proto message but the attribute keys used for gql queries will use "/" for CIDs.
See https://github.com/cerc-io/laconic-sdk/pull/36.
@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"reflect" // #nosec G702 This is also used in eip712 antehandler code. No new risk introduced.
Sensitive package import
Certain system packages contain functions which may be a possible source of non-determinism
Show more details
Pull request closed