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

🌐 Dataverse preliminary spec #321

Merged
merged 14 commits into from
Oct 27, 2023
Merged

Conversation

ccamel
Copy link
Member

@ccamel ccamel commented Aug 22, 2023

This PR introduces the specification for the Dataverse smart contract as required by #328.

Design Philosophy

The API and message design philosophy is deeply rooted in the structure of the ontology, which is split into two primary parts:

  • Core part This foundational layer defines the basic constituents of the dataverse and the relationships between them. It provides the structural backbone, ensuring organized and systematic resource modeling.
  • Metadata part: Serving as a dynamic expansion module, the metadata segment is what gives the dataverse its great scalability and extensibility, allowing the addition of semantic data describing resources.
classDiagram
    class Metadata{
      <<abstract>>
    }

    class Service {
    }

    class Dataset {
    }

    class Zone {
    }


   Metadata ..> Service : describes
   Metadata ..> Dataset : describes
   Metadata ..> Zone : describes
Loading

Future iterations will build upon this foundation, introducing more advanced features and functionalities.

Summary by CodeRabbit

  • New Feature: Introduced the dataverse smart contract, a digital universe of resources. This feature allows users to manage collections of digital resources on the blockchain, including the ability to register services, datasets, and zones.
  • Improvement: Enhanced error handling with the introduction of ContractError, providing more specific error messages.
  • Documentation: Added comprehensive documentation for the dataverse smart contract, explaining its functionality and usage.
  • Code Quality: Implemented compiler directives to forbid unsafe code and deny various warnings, improving the overall code quality and safety.

Please note, these changes are part of the OKP4 ecosystem and rely on other smart contracts within this system.

@ccamel ccamel self-assigned this Aug 22, 2023
@bot-anik
Copy link
Member

bot-anik commented Aug 22, 2023

size-limit report 📦

Path Size
target/wasm32-unknown-unknown/release/okp4_objectarium.wasm 430.67 KB (0%)
target/wasm32-unknown-unknown/release/okp4_law_stone.wasm 644.19 KB (0%)
target/wasm32-unknown-unknown/release/okp4_cognitarium.wasm 809.04 KB (0%)

@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Merging #321 (1168e28) into main (515667d) will decrease coverage by 0.32%.
The diff coverage is 5.71%.

@@            Coverage Diff             @@
##             main     #321      +/-   ##
==========================================
- Coverage   97.76%   97.45%   -0.32%     
==========================================
  Files          42       47       +5     
  Lines       10243    10278      +35     
==========================================
+ Hits        10014    10016       +2     
- Misses        229      262      +33     
Files Coverage Δ
contracts/okp4-dataverse/src/lib.rs 100.00% <100.00%> (ø)
contracts/okp4-dataverse/src/error.rs 0.00% <0.00%> (ø)
contracts/okp4-dataverse/src/bin/schema.rs 12.50% <12.50%> (ø)
contracts/okp4-dataverse/src/msg.rs 0.00% <0.00%> (ø)
contracts/okp4-dataverse/src/contract.rs 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ccamel ccamel force-pushed the feat/dataverse-preliminary-spec branch from 922ac22 to 1b1536e Compare October 24, 2023 07:34
@coderabbitai
Copy link

coderabbitai bot commented Oct 24, 2023

Walkthrough

The changes introduce a new smart contract, dataverse, that manages a digital universe of resources. It provides mechanisms for governance, registering services, datasets, and zones, and handling metadata. The contract also includes specific error handling and message types for managing a dataverse on the blockchain.

Changes

File Summary
contracts/okp4-dataverse/README.md
docs/okp4-dataverse.md
Introduced a new smart contract dataverse that manages a digital universe of resources.
contracts/okp4-dataverse/src/bin/schema.rs Added import statements and used write_api! macro to generate code for instantiating, executing, and querying messages.
contracts/okp4-dataverse/src/contract.rs Introduced new modules execute and query with updated function signatures.
contracts/okp4-dataverse/src/error.rs Introduced a new module-level enum ContractError for specific error handling within the contract.
contracts/okp4-dataverse/src/lib.rs Added compiler directives and introduced modules for contract, error, message, and state.
contracts/okp4-dataverse/src/msg.rs Introduced a new module that defines message structs and enums for a dataverse contract.
contracts/okp4-dataverse/src/state.rs No changes made.

"In the land of code, where logic is king, 🤴

A new contract was born, to the blockchain it did cling. 📜

With zones and services, it began to sing, 🎵

'I am Dataverse, of digital resources I am the king!' 👑"


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.json

@ccamel ccamel marked this pull request as ready for review October 24, 2023 07:41
@ccamel ccamel requested a review from amimart October 24, 2023 07:46
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 515667d and 10340cb.
Files ignored due to filter (3)
  • Cargo.lock
  • contracts/okp4-dataverse/Cargo.toml
  • contracts/okp4-dataverse/Makefile.toml
Files selected for processing (8)
  • contracts/okp4-dataverse/README.md (1 hunks)
  • contracts/okp4-dataverse/src/bin/schema.rs (1 hunks)
  • contracts/okp4-dataverse/src/contract.rs (1 hunks)
  • contracts/okp4-dataverse/src/error.rs (1 hunks)
  • contracts/okp4-dataverse/src/lib.rs (1 hunks)
  • contracts/okp4-dataverse/src/msg.rs (1 hunks)
  • contracts/okp4-dataverse/src/state.rs (1 hunks)
  • docs/okp4-dataverse.md (1 hunks)
Files skipped from review due to trivial changes (4)
  • contracts/okp4-dataverse/src/bin/schema.rs
  • contracts/okp4-dataverse/src/contract.rs
  • contracts/okp4-dataverse/src/lib.rs
  • contracts/okp4-dataverse/src/state.rs
Additional comments: 9
contracts/okp4-dataverse/README.md (1)
  • 1-15: The README provides a clear and concise overview of the Dataverse smart contract, its purpose, and its dependencies. It explains the concept of a Dataverse and Zones within it, the instantiation of Dataverse instances, and the dependencies on other smart contracts within the OKP4 ecosystem.
contracts/okp4-dataverse/src/error.rs (1)
  • 1-8: The ContractError enum is a good way to encapsulate contract-specific errors. It currently only wraps the StdError from cosmwasm_std, which is a good start. However, consider adding more specific error types to this enum as the contract development progresses. This will allow for more granular error handling and better debugging.
docs/okp4-dataverse.md (1)
  • 1-206: The documentation is well-written and provides a comprehensive overview of the Dataverse smart contract. It explains the purpose of the contract, its dependencies, and the various functions it provides. The documentation also provides detailed descriptions of the parameters for each function and the expected responses. This will be very helpful for developers who need to interact with this contract. The examples provided for each function are also very useful. Overall, this is a well-structured and informative piece of documentation.
contracts/okp4-dataverse/src/msg.rs (6)
  • 6-11: The InstantiateMsg struct is used to initialize a new instance of the dataverse. It only contains a name field. Ensure that this is sufficient for the initialization of a dataverse instance and that no other fields are required.

  • 14-140: The ExecuteMsg enum defines the set of possible actions that can be performed on the dataverse. It includes variants for registering services, datasets, founding zones, and managing metadata. The variants are well-documented with examples. The use of Option for optional fields is a good practice.

  • 142-179: The RdfFormat enum represents the various serialization formats for RDF data. It includes variants for RDF/XML, Turtle, N-Triples, and N-Quads formats. The use of #[default] for the Turtle format is a good practice.

  • 181-194: The Uri, Iri, and Did types are defined as aliases for String. This is a good practice for improving code readability and maintainability.

  • 196-206: The QueryMsg enum defines the set of possible queries that can be made to retrieve information about the dataverse. It currently only includes a variant for querying the dataverse's details. Ensure that this is sufficient for the querying needs of the dataverse.

  • 208-214: The DataverseResponse struct is used as the response of the Dataverse query. It only contains a name field. Ensure that this is sufficient for the response needs of the Dataverse query.

contracts/okp4-dataverse/src/msg.rs Outdated Show resolved Hide resolved
@ccamel ccamel force-pushed the feat/dataverse-preliminary-spec branch from 10340cb to 1168e28 Compare October 24, 2023 07:56
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 515667d and 1168e28.
Files ignored due to filter (3)
  • Cargo.lock
  • contracts/okp4-dataverse/Cargo.toml
  • contracts/okp4-dataverse/Makefile.toml
Files selected for processing (8)
  • contracts/okp4-dataverse/README.md (1 hunks)
  • contracts/okp4-dataverse/src/bin/schema.rs (1 hunks)
  • contracts/okp4-dataverse/src/contract.rs (1 hunks)
  • contracts/okp4-dataverse/src/error.rs (1 hunks)
  • contracts/okp4-dataverse/src/lib.rs (1 hunks)
  • contracts/okp4-dataverse/src/msg.rs (1 hunks)
  • contracts/okp4-dataverse/src/state.rs (1 hunks)
  • docs/okp4-dataverse.md (1 hunks)
Files skipped from review due to trivial changes (6)
  • contracts/okp4-dataverse/src/bin/schema.rs
  • contracts/okp4-dataverse/src/contract.rs
  • contracts/okp4-dataverse/src/lib.rs
  • contracts/okp4-dataverse/src/msg.rs
  • contracts/okp4-dataverse/src/state.rs
  • docs/okp4-dataverse.md
Additional comments: 2
contracts/okp4-dataverse/src/error.rs (1)
  • 1-8: The new ContractError enum is a good addition for better error handling within the contract. It currently wraps the StdError from cosmwasm_std, which is a good start. However, consider adding more specific error types to this enum as the contract development progresses. This will allow for more granular error handling and better debugging.
contracts/okp4-dataverse/README.md (1)
  • 1-15: The README provides a clear and concise overview of the Dataverse smart contract, its purpose, and its dependencies. It explains the concept of a Dataverse and Zones within it, the instantiation of Dataverse instances, and the dependencies on other smart contracts within the OKP4 ecosystem. The documentation is well-written and provides a good introduction to the contract.

Copy link
Member

@amimart amimart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's during implementation phase if something comes out :)

@ccamel ccamel merged commit 229d34f into main Oct 27, 2023
16 of 18 checks passed
@ccamel ccamel deleted the feat/dataverse-preliminary-spec branch October 27, 2023 15:06
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

Successfully merging this pull request may close these issues.

3 participants