relayer
relayer copied to clipboard
[ISSUE] Update HistoryStore key
Overview
HistoryStoreKey contains keys used to store the history of events and all the event watcher use ResourceID as a key.
The problem with substrate ResourceId is it uses PalletId which can be changed if a new pallet is added.
#[derive(Eq, PartialEq, Hash)]
pub enum HistoryStoreKey {
/// Block Queue Key
Block { chain_id: u32 },
/// ResourceId Key
ResourceId {
resource_id: webb_proposals::ResourceId,
},
}
// Substrate target system
pub struct SubstrateTargetSystem {
pub pallet_index: u8,
pub tree_id: u32,
}
There are two options we can use to solve this
- We hard code and use the pallet Index as zero to store and retrieve event data
- We have fixed pallet Ids
One solution that we could take, is by fetching the pallet index during the runtime, it will be costly, but that's an option we could consider.
closing this. We don't hardcode PalletId anymore and fetch it during runtime.