feat: remaining record content types to support #79
Closed
0xmuralik wants to merge 35 commits from
murali/record-attributes into main
pull from: murali/record-attributes
merge into: :main
:main
:zach/prefix
:roy/rm-hardcoded-records
:roy/graphql-to-ipld
:roy/qol-improvements
:murali/gql
:murali/update-fork
:murali/record-attributes
:aleem/fix-lint-errors
:murali/CIDFromJSONBytes
:update-validator-doc-v0.8.0
:feature_test_record_types
:aleem/25-wasmd
:release-v0.8.0
:nameservice_tests_github
:auction_tests
:all_test_stuff
:fix_cid_generation
:run_tests_github_action
:0-7-0-upgrade-guide
:murali/sdk-integration-tests
:murali/quick-fix
:dboreham/sdk-integration-test
:console_release
:release-v0.3.1-dev
:release-v0.6.0
:anil/lint
:murali/to_ipld_prime
:docs
:release-v0.2.0-dev
:ian/smt
Dismiss Review
Are you sure you want to dismiss this review?
Labels
Clear labels
C:CLI
C:Crypto
C:Encoding
C:Proto
C:Types
Status: Stale
Type: ADR
Type: Build
Type: CI
Type: Docs
Type: Tests
bug
dependencies
docker
documentation
duplicate
enhancement
go
good first issue
help wanted
high priority
in progress
invalid
javascript
low priority
medium priority
question
urgent
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Something isn't working
Pull requests that update a dependency file
Pull requests that update Docker code
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Pull requests that update Go code
Good for newcomers
Extra attention is needed
currently working on
This doesn't seem right
Pull requests that update Javascript code
Further information is requested
Top priority issue
This will not be worked on
An issue or PR manually copied from GitHub.
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/laconicd-deprecated#79
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes: #51
Description
Record attributes indexing for remaining defined type of records.
For contributor use:
docs/) or specification (x/<module>/spec/)godoccomments.Unreleasedsection inCHANGELOG.mdFiles changedin 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_multicodecfield and araw_binaryfield, all we need is ahash_referencefield. 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
JSPackageand add astring name=5;fieldThis will reference a registered
GitRepositoryrecord by CID/multihashGitRepositoryalso has arepo_referencefield 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
referencefields which references are content-hash => content references vs one's that are not. E.g.hash_referencevsreference.Note:
hash_referenceto aGitRepositoryIPLD objectNote:
hash_referenceto binary IPLD objectNote:
hash_referenceto aGitRepositoryIPLD objectNote:
hash_referenceto aChainRegistrationRecordIPLD objectNote:
hash_referenceto a WASM IPLD objectNote:
hash_referencetoServiceProviderRecordIPLD objectNote:
hash_referencetoWatcherRegistrationRecordIPLD objectNote:
hash_referenceto auction result IPLD objectNote:
hash_referencetoJSPackageIPLD objectLet's add fields:
string chain_idstring network_idstring genesis_hash@0xmuralik for all of the
referencefields that are hash-links, we should considering using the previous convention with "/"E.g.
npm_package_refrenamed tohash_reference(or not, since now the "/" already signifies the hash-link nature of the reference) withhash_referencea 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
tagsoraddressesfields are supposed to represent in theTagmessage. 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
refandosare supposed to represent in these mappings. Going to ask Ashwin.@@ -23,3 +29,3 @@}message WebsiteRegistrationRecord {We can avoid adding
hashto 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
HashReferencetype.@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.Messageathttps://github.com/cosmos/cosmos-sdk/blob/f71df80e93bffbf7ce5fbd519c6154a2ee9f991b/x/auth/tx/decoder.go#L40
Same error is returned when @aleem1314 tried with a unit test inculing map[] on cosmos-sdk for https://github.com/cosmos/cosmos-sdk/blob/f71df80e93bffbf7ce5fbd519c6154a2ee9f991b/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 referencemessage. 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