-
Notifications
You must be signed in to change notification settings - Fork 190
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
Uploading metadatas should be skipped when metadata didn't change #1907
Comments
Good point. One improvement we could is to output the ipfs metadata uris into the manifest files. So unless it changes, we don't upload to ipfs. Another thing we could do, is to embed a local ipfs server in torii, so uploading is super quick. We will still want the contract metadata set during dev, to enable the worlds.dev interface What do you think @lambda-0x @glihm @Larkooo |
its skipped when using offline mode and should remain usable, so embed ipfs server seems the way |
I think that with the amount of responsibility that torii now has, with the different services under it, like the libp2p server, the different endpoints and everything together; it only makes sense to embed a ipfs server for maximum reliability and to have it standalone. Especially with the libp2p torii-relay as it's basically the same kind of scope as if we were to embed our own ipfs instance. I do think that we should still have the option to specify a specific ipfs server if wanted though. https://github.com/ipfs-rust/ipfs-embed The workflow seems quite similar to libp2p-rust in general as it uses it so I think it should be quite straightforward to implement at some point. |
I would like to give it a try please |
@Yogalholic i have updated the title and description of the issue to give more context of what should be done. Feel free to ask if you have any questions! |
@Yogalholic any updates on the issue? if you have any questions feel free to ask. |
I am still working on it. I don't have a specific question at the moment, there are a lot of new information to process and the dojo documentation is mostly toward game developers rather than dojo developers. |
Am I allowed to add a new field in the DeploymentManifest struct in types.rs ? This file is not in the sozo crate but in dojo-world. |
yeah, for sure. |
@Yogalholic how are you doing on that? Any progress or blockers? |
I will open a draft PR soon |
I noticed migrate.rs file got updated while I was working on it. The code no longer handles ArtifactMetadata struct but ResourceMetadata struct |
@Yogalholic |
I have opened a draft PR, I want to know if I am on the right track. I am not sure which encryption is used to calculate the IPFS hash |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI have extensive experience building apps with C#, js, rust and cairo and would like to tackle this challenge How I plan on tackling this issueI would study the codebase to get a good hang of the systems responsible for uploading the metadata to IPFS, before creating a method for storing the ipfs hash of the data before subsequently comparing new hashes before uploading if there is a diff |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedHi I'm a frontend and also a smart contract develop. i will love to work on this please assign |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedHii, Abhilov this side. I worked as a blockchain developer for over an year. I would like resolve this issue. |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedhello |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedBased on your description, here's how I would approach implementing this solution:
Adding the Hash to the Manifest: After a successful upload, we will store the IPFS hash of the uploaded metadata in the manifest file. This allows us to reference it during the next deployment to check if the metadata has changed. Example: Compare the Local Hash with the Stored Hash: If the local hash matches the hash in the manifest, skip the upload. If not, proceed with the IPFS upload and update the manifest.
Ensure Manifest Integrity: Update the manifest safely, ensuring no data corruption. Use atomic file writes or backups to maintain consistency during the update process. Log Previous Hashes: Maintain a history of hashes in the manifest file or a separate log for reference. Verify the system detects whether metadata has changed correctly. I have experience in Python development, which allows me to design and implement the logic for checking metadata changes, generating hashes, and updating manifests efficiently. My familiarity with decentralized storage like IPFS can be leveraged to ensure the metadata is handled properly. I have a good understanding of version control concepts and how to track changes over time. This can be applied to ensure metadata is versioned properly, and the system optimally decides when to upload and update metadata. I can assist in writing comprehensive tests to ensure the entire process works as expected and can identify any edge cases where metadata changes might not be properly detected. How I plan on tackling this issueHow I Would Approach the Problem:
|
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI'm a developer with experience in several of the languages used in this project, including Python, JavaScript, and TypeScript. While I haven't worked extensively with Cairo or Rust, I'm familiar with their concepts and eager to expand my skills. I've dealt with optimization problems similar to this one in past projects, particularly involving file handling and data comparison. My experience with IPFS in previous projects will be valuable in tackling this issue. How I plan on tackling this issueTo address this bug, I'd start by examining the current implementation of metadata uploading. Then, I'd modify the process to include these steps: Generate a hash of the current metadata before uploading. I'd implement this logic, likely in Python or TypeScript depending on the project's structure. I'd ensure to handle edge cases, like a missing manifest file or IPFS hash. |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI am Full-stack Web Developer with over 4+ years of Experience How I plan on tackling this issueSteps to Implement Conditional Metadata Upload
Example :
function calculateHash(metadata) {
Comparison Logic:
}
|
I’d like to resolve this. |
Can I work on this, please? |
May I take this issue on? |
Could I be assigned to this? |
Hey guys, as I mentioned in the other issues, we had low level changes required to have this working. Should be closed soon by #2691. |
Is this issue still available? |
Solved by #2691. |
Describe the bug
We should only upload the metadata to IPFS if they have changed from the last upload. For which we can store the IPFS hash of metadata in the manifest file, and upload the metdata only if IPFS hash has changed.
The text was updated successfully, but these errors were encountered: