-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Conversation
@xlc this will probably not be accepted. Remarks are not meant to have any state or anything. They should be and remain as minimal as possible. If you want something like this, I think it would be better to just make a new extrinsic or even better maybe a new pallet with much more "arbitrary data storage" features like the "comment pallet" i had envisioned: https://github.com/paritytech/substrate/compare/shawntabrizi-comment-pallet Anyway, that is my two cents on this PR |
This does not store data, just emit event. |
I think if so, then adding a But I still don't say why with proxies or multisigs it becomes hard to verify that an account sent a remark or not. |
We use remarks for rmrk.app, yes. An event would make no difference for us, we have to match against extrinsicSuccess events anyway so we already check if the remark was noted that way. |
I think Bruno is completely on point here. Using this event versus any other extrinsic success event or processing the included txs in a block doesn't really make sense to me. Having some persistent storage could make sense, but needs a new extrinsic and some economics around users cleaning up that data. |
The best practice is always check for specific events, not extrinsic success. Otherwise it is very difficult to check if a remark is "executed", think about scheduler, batch, multisig, derive, proxy, delayed proxy and all the combinations and future additions. You simply cannot use extrinsic success to infer if remark is executed without false negative. And the main reason I want this is for proof-of-ownership, i.e. for multisgn / proxy account to proof some offchain components someone does control the said account. Otherwise there is no easy way other than transfer some DOT to a random generated account, which is less than ideal. |
This is true, we do currently jump through some hoops to find remarks in batches. For our immediate case this would not be helpful (we've handled those edge cases) but I can see the benefit in other scenarios we intend to develop, and the scenarios @xlc mentions. |
we usually take a deposit when we store something on chain as long as it is stored. The current PR is fine to me, but I may miss an economical issue. |
(why are we not adding a |
@kianenigma updated |
/benchmark runtime pallet frame_system |
Error running benchmark: remark stdoutfatal: ambiguous argument 'origin/remark': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]' |
yeah benchmark from fork is not supported. someone will need to make a branch in this repo to run benchmarks and I can merge the results into here |
@shawntabrizi why can the both not push to foreign branches, as long as the author enabled pushing members? |
Running on our CI anything that can be manipulated from fork should be approached with extreme caution |
We already run the complete CI on our machines, that could involve anything and you can do much more as with this bot. |
CI does not have push access to substrate |
The bot can be updated to support foreign branches, but I am not sure how to do it, and haven't spent time to look into it. Happy to have a PR, but I was waiting to delegate to our new CI person.
The solution here IMO is just have only Parity employees be able to trigger the bot. |
frame/system/src/lib.rs
Outdated
#[pallet::weight(T::SystemWeightInfo::remark_with_event(remark.len() as u32))] | ||
pub(crate) fn remark_with_event(origin: OriginFor<T>, remark: Vec<u8>) -> DispatchResultWithPostInfo { | ||
ensure_signed(origin)?; | ||
Self::deposit_event(Event::Remarked(remark)); |
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 still do not see what this ACTUALLY does.
Like events should be for presenting data which may not easily be accessible, for example that an extrinsic completed using fork path A versus fork path B.
In this case, all the information you need is already on chain and accessible as easily as an even it:
- Extrinsic with Remark data is in the block header
- Success event of the remark is in events already
So what am I missing? Is this just lazily trying to use the events API in JavaScript? if so, then we could probably program in the JS API side this functionality.
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.
No. Please see my previous comment
The best practice is always check for specific events, not extrinsic success.
Otherwise it is very difficult to check if a remark is "executed", think about scheduler, batch, multisig, derive, proxy, delayed proxy and all the combinations and future additions. You simply cannot use extrinsic success to infer if remark is executed without false negative.
And the main reason I want this is for proof-of-ownership, i.e. for multisgn / proxy account to proof some offchain components someone does control the said account. Otherwise there is no easy way other than transfer some DOT to a random generated account, which is less than ideal.
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.
Alice is doing the best practice to secure her account that she have anonymous account + time delayed proxy + revoke proxy + multisig proxy.
Now she want to use a service that require her to provide proof of ownership.
She cannot use her account to sign message as there is no private key for anonymous proxy.
She can use the time delayed proxy to issue a proof as form of system.remark to indicate she does control this account.
Now on the verification side, how would you be able to detect if the system.remark is executed and not cancelled? How do you know which account is the system.remark in been executed with?
How could Alice use this setup to interact with RMRK.app?
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.
remark is executed without false negative.
Why do we care about false negative? We should be worried about false positive. In any of the scenarios you describe above, if the full batch/multisig/proxy etc is completed successfully, then the remark is easy enough to verify.
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.
Batch will always give extrinsic success. Multisig requires x success. Time delayed proxy execution could fail even if all extrinsic are success. Only check extrinsic success is certainly going to cause some bugs.
And how do I even know if a proxy call contains system.remark? Remember, we can arbitrarily nest calls. batch in proxy in multisig in batch.
It is possible to code up something that works now, but it will have issue in future if we introduce some new way of nesting.
frame/system/src/lib.rs
Outdated
#[pallet::weight(T::SystemWeightInfo::remark_with_event(remark.len() as u32))] | ||
pub(crate) fn remark_with_event(origin: OriginFor<T>, remark: Vec<u8>) -> DispatchResultWithPostInfo { | ||
let who = ensure_signed(origin)?; | ||
Self::deposit_event(Event::Remarked(who, remark)); |
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.
But is it really a good idea to put the full remark into the event?
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.
Do you have a suggestion? Put hash? Limit the remark length?
frame/system/src/lib.rs
Outdated
#[pallet::weight(T::SystemWeightInfo::remark_with_event(remark.len() as u32))] | ||
pub(crate) fn remark_with_event(origin: OriginFor<T>, remark: Vec<u8>) -> DispatchResultWithPostInfo { | ||
let who = ensure_signed(origin)?; | ||
Self::deposit_event(Event::Remarked(who, remark)); |
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.
should be the hash of remark
, not remark itself.
probably needs a master merge to get it green. |
Looks like all green now. |
…/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_system --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/system/src/weights.rs --template=./.maintain/frame-weight-template.hbs
@xlc please integrate the benchmark results from ^ |
bot merge |
Waiting for commit status. |
Checks failed; merge aborted. |
Co-authored-by: Parity Benchmarking Bot <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]>
Partially address paritytech/polkadot-sdk#350
This is required to use remark for proof-of-ownership.
Will need new benchmark cc @shawntabrizi
polkadot companion: paritytech/polkadot#2528