Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

[BUG] PalletIds not uniquely determined by 8 symbol input #10812

Closed
akileshtangella opened this issue Feb 7, 2022 · 5 comments · Fixed by #10719
Closed

[BUG] PalletIds not uniquely determined by 8 symbol input #10812

akileshtangella opened this issue Feb 7, 2022 · 5 comments · Fixed by #10719
Labels
J2-unconfirmed Issue might be valid, but it’s not yet known.

Comments

@akileshtangella
Copy link

I don’t exactly know why but setting TokenWrapperPalletId like this: https://github.com/webb-tools/protocol-substrate/blob/main/pallets/token-wrapper/src/mock.rs#L157 and setting TreasuryPalletId like this: https://github.com/webb-tools/protocol-substrate/blob/main/pallets/token-wrapper/src/mock.rs#L131 leads to them both being equal for some reason (specifically they are both equal to 8372043756066860909).

After some experimenting it seems that the PalletId is determined only by the first 4 out of 8 symbols. Since the first four symbols of both are py/t I think this is why they ended up as equal. Not sure how to confirm this though.

@github-actions github-actions bot added the J2-unconfirmed Issue might be valid, but it’s not yet known. label Feb 7, 2022
@bkchr
Copy link
Member

bkchr commented Feb 7, 2022

You are using u64 as AccountId in your mocked environment.

So, that makes sense that only the first 4 bytes of the PalletId are used.

https://github.com/paritytech/substrate/blob/master/primitives/runtime/src/traits.rs#L1283-L1287 see the implementation here.

@shawntabrizi
Copy link
Member

see: #10719

@ggwpez
Copy link
Member

ggwpez commented Feb 18, 2022

Closed by #10719

@ggwpez ggwpez closed this as completed Feb 18, 2022
@bkchr
Copy link
Member

bkchr commented Feb 18, 2022

Not yet closed.

@bkchr bkchr reopened this Feb 18, 2022
@ggwpez
Copy link
Member

ggwpez commented Feb 18, 2022

Oh sorry!
Was already mentally done with #10719 😅 but it still needs companions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J2-unconfirmed Issue might be valid, but it’s not yet known.
Projects
None yet
4 participants