-
Notifications
You must be signed in to change notification settings - Fork 43
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
Instruction to store data #48
base: master
Are you sure you want to change the base?
Instruction to store data #48
Conversation
The new instruction looks like this: | ||
|
||
```rust | ||
Publish { data: BoundedVec<Key, Value, Bound> } |
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.
Publish { data: BoundedVec<Key, Value, Bound> } | |
Publish { data: BoundedVec<(Key, Value), Bound> } |
|
||
- Should we account for the published data's size via Weight? | ||
- Should we introduce a new instruction for storage deposits or add another operand to the `Publish` instruction specifying the assets used? | ||
- Should there be a way to delete the published data via XCM? |
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 is an implementation detail, but we could use the approach of updating a value by using the same key with a new value, and deleting a value by using the same key with as value an empty Vec.
Publish { data: BoundedVec<Key, Value, Bound> } | ||
``` | ||
|
||
`Key` and `Value` are arrays of bits, they could be anything. |
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 clearly specify that Key and Value are both Vec<U8>
```rust | ||
WithdrawAsset(/* ... */), | ||
BuyExecution { /* ... */ } | ||
Publish { data: [(b"My key", b"My value")] } |
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.
What is the origin of this data? Can that be stored along with the data itself? Or is this operation by default restricted to a specific origin? E.g., I am a parachain interested in this data but only if it comes from another parachain, not from users within it.
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.
If there's some additional logic as to who can send/execute this instruction, it should be added here.
The new instruction looks like this: | ||
|
||
```rust | ||
Publish { data: BoundedVec<Key, Value, Bound> } |
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.
Could different chains have different values set for Bound
? And if so, the sending chain should be aware of the Bound
of the receiving chain, right?
|
||
## Questions and open Discussions (optional) | ||
|
||
- Should we account for the published data's size via Weight? |
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.
I believe it should be up to the implementation on the receiving chain, don't you think? Basically, it would depend on what that chain does with that data and its size. For example, if this instruction triggers an extrinsic whose execution time depends on the size of the data, you should BuyExecution
that is enough for that size of data.
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.
Which leads me to... would chains be able to configure an Executor
or Dispatcher
to handle this kind of instruction?
## Questions and open Discussions (optional) | ||
|
||
- Should we account for the published data's size via Weight? | ||
- Should we introduce a new instruction for storage deposits or add another operand to the `Publish` instruction specifying the assets used? |
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.
If chains are able to configure the way this instruction is processed, I think this could be used for storage deposits. For example in storage chains, it could express the intention of storing a file identified by a hash (and some other metadata needed).
No description provided.