-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add metadata and fit new spec #134
Conversation
smart-contract/assembly/contracts/internals/storageKeys/metadataKeys.ts
Outdated
Show resolved
Hide resolved
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.
Very good SC overall. A few questions and comments:
- coin management: so we go for spending the coins of the SC if it has any instead outside of deweb stuff instead of checking that enough
coins
were passed during the call to cover for storage expenses ? if so, let's make sure we document it clearly - why did you make Location something that is not just another metadata ?
- let's make sure the client does not call any SC functions for reading purposes but only looks into the datastore directly. That way we can implement https://forum.massa.community/t/immutability-and-upgradability-dilemma-in-deweb/110/2 in the future
} | ||
assert(_getTotalChunk(files[i].hashLocation) > 0, 'File does not exist'); | ||
|
||
_deleteFile(files[i].hashLocation); |
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.
we should discuss metadata support for files contained inside subdirectories within ZIP files. Currently, the SC assumes that only files with available chunks can have metadata. Would be nice to be able to set metadata and location - but not chunks (eg. chunk_count entry absent) - for some files that would be "virtual" files.
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.
As it's not a requirement for the v1 use case, can it be discussed for a v2 ?
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.
okay, maybe let's open an issue to not forget :)
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.
Sure
*/ | ||
export function constructor(_: StaticArray<u8>): void { | ||
if (!Context.isDeployingContract()) return; | ||
|
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.
maybe set the deweb version tag here. See https://forum.massa.community/t/community-feedback-proposal-for-improving-website-storage-on-deweb/82/15#p-319-smart-contract-datastore-layout-1
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.
to remove any ambiguity with other products, the tag should contain the explicit string "deweb". That way we can unambuously auto-detect that an address is hosting a website and under which version of the format to know how to decode it depending on the version
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.
for example it could be [VERSION_TAG][string: "massa_website"] -> "1"
smart-contract/assembly/__tests__/deweb-interface/helpers/Uploader.ts
Outdated
Show resolved
Hide resolved
hashLocation: StaticArray<u8>, | ||
totalChunk: u32, | ||
): void { | ||
Storage.set(fileChunkCountKey(hashLocation), u32ToBytes(totalChunk)); |
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.
it seems this is never deleted,it should be done when deleting a file ok i get it!
866c753
to
53d9241
Compare
No description provided.