Conversation
pallets/marketplace/src/weights.rs
Outdated
| /// <HB SBP Milestone Review II | ||
| /// | ||
| /// From now on all the ref_time values are the same. I suspect those values are used as placeholders and not as a result of a benchmarking execution? | ||
| /// | ||
| /// /// > |
There was a problem hiding this comment.
yes those are placeholders
pallets/hyperdrive/src/lib.rs
Outdated
| /// <HB SBP Milestone Review II | ||
| /// | ||
| /// You can remove the transactional macro since it's already happening out of the box. | ||
| /// | ||
| /// > | ||
| #[transactional] | ||
| fn process_action(message_bytes: &Vec<u8>) -> Result<(), ProcessMessageResult> { |
There was a problem hiding this comment.
@hbulgarini Do you refer to the transaction started at the extrinsic level?
Our design requires the extrinsic submit_message calling process_message -> process_action not to fail on errors (we hide errors after depositing an event at line 378) happening during executing the message, but selectively revert (partial) storage changes done during whatever executing involves.
I expanded the top-level frame_support::pallet macro both with and without the #[transactional] here and only with it I get the process_action's function body wrapped with:
fn process_action(message_bytes: &Vec<u8>) -> Result<(), ProcessMessageResult> {
use frame_support::storage::{with_transaction, TransactionOutcome};
with_transaction(|| {
let r = (|| {
{
// ...
T::ActionExecutor::execute(action) // <- whatever side-effects produced by this should be reverted on later failure
.map_err(|_| ProcessMessageResult::ActionFailed(raw_action.clone()))?;
Ok(())
}
})();
if r.is_ok() { TransactionOutcome::Commit(r) } else { TransactionOutcome::Rollback(r) }
})
}There was a problem hiding this comment.
indeed but my understanding is that the process_action fn is going to be reverted anyway since it's being called from the extrinsic submit_message making all the storage commits revertible.
But your comment is valid and now i doubt about my statement, maybe we might reproduce it in a test and see how it works?
These two GH links might be useful as well:
Hello! the milestone review 2 have been done for this repository:
You can find the comments under the comments with the structure:
The highlights for this review are: