3

For example, there's a FRAME pallet called Remark which does one thing: it allows storing data in externalities that can access the node's storage via a runtime interface. If integrated into a runtime, this would enable any user to call a signed extrinsic that stores some data off-chain. To do this, it makes use of a host function declared in sp_io called transaction_index::index.

As I understand it, it just stores an index of calls on the client's storage, which correspond to some Option<Hash>. This is done by primitives::state_machine::storage_index_transaction. What's not clear to me is that the function it calls is unimplemented:

pub trait Externalities: ExtensionStore {
    // -- snip --
    /// Index specified transaction slice and store it.
    fn storage_index_transaction(&mut self, _index: u32, _hash: &[u8], _size: u32) {
        unimplemented!("storage_index_transaction");
    }
}

How does transaction indexing work here and what is the intended purpose of having this?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.