-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix: [Referenda Tracks] Resolve representation issues that are breaking PJS apps #7671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: [Referenda Tracks] Resolve representation issues that are breaking PJS apps #7671
Conversation
6fe1641 to
f7f6920
Compare
…y like a string change(pallet-referenda): create const function that helps construct `StringLike` to reduce changes in tracks definitions fix: fmt
e8538fe to
44b58c7
Compare
|
Are we going to merge this, or revert as per #7661? |
… version) and `ConstTrackInfo` (const version) that "extend" from `TrackDetails` (generic version).
36f5d50 to
28ad818
Compare
467d1f6
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-7671-to-stable2503
git worktree add --checkout .worktree/backport-7671-to-stable2503 backport-7671-to-stable2503
cd .worktree/backport-7671-to-stable2503
git reset --hard HEAD^
git cherry-pick -x 467d1f642c8d5d6b11c45e5212f546af86b6f6e4
git push --force-with-lease |
Backport #7671 into `stable2503` from pandres95. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Egor_P <[email protected]>
…ng PJS apps (paritytech#7671) This Pull Request fixes the following issues present with PJS derived from paritytech#2072 - Represents `Tracks` constant as a `Vec<(TrackId, TrackInfo)>` instead of `Vec<Track>`, so tracks iteration in PJS apps _Governance_ hook remains as how it was before, and  - Encapsulates `[u8; N]` from `name` field in a `StringLike` structure that represents its `TypeInfo` as a `&str` and encodes as such. This fixes errors present in PJS apps that treat `name` as a javascript `string`.  --------- Co-authored-by: Guillaume Thiolliere <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]>
…ng PJS apps (paritytech#7671) This Pull Request fixes the following issues present with PJS derived from paritytech#2072 - Represents `Tracks` constant as a `Vec<(TrackId, TrackInfo)>` instead of `Vec<Track>`, so tracks iteration in PJS apps _Governance_ hook remains as how it was before, and  - Encapsulates `[u8; N]` from `name` field in a `StringLike` structure that represents its `TypeInfo` as a `&str` and encodes as such. This fixes errors present in PJS apps that treat `name` as a javascript `string`.  --------- Co-authored-by: Guillaume Thiolliere <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]>
…ng PJS apps (paritytech#7671) This Pull Request fixes the following issues present with PJS derived from paritytech#2072 - Represents `Tracks` constant as a `Vec<(TrackId, TrackInfo)>` instead of `Vec<Track>`, so tracks iteration in PJS apps _Governance_ hook remains as how it was before, and  - Encapsulates `[u8; N]` from `name` field in a `StringLike` structure that represents its `TypeInfo` as a `&str` and encodes as such. This fixes errors present in PJS apps that treat `name` as a javascript `string`.  --------- Co-authored-by: Guillaume Thiolliere <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]>
* master: (26 commits) Snowbridge V2 (#7402) [AHM] Revert multi-block election, slashing and staking client pallets (#7939) docs: update local ci execution instruction (#8003) Upgrade deps to eliminate ancient dependencies (#7999) Removed `pallet:getter` from XCM pallets (#7916) Add digest processor xcm emulator (#7915) Fix: [Referenda Tracks] Resolve representation issues that are breaking PJS apps (#7671) Improve XCMP weight metering (#7963) bump version of zombienet-sdk (#7964) rpc-v2/archive: Rename archive call method result to value (#7885) Bump parachains runtime api to 13 (#7981) `bp-runtime`: make macro expansion not rely on `sp-std` in scope. (#7978) [CI/CD] Refactor backports flow so that it can determine automatically where to do a backport based on labels (#7976) Treasury: update expire date on payout (#7958) (#7959) `fatxpool`: report_invalid: do not ban Future/Stale txs from re-entering the view (#7777) Fix XCM Barrier Rejection Handling to Return Incomplete with Weight (#7843) Bump openssl from 0.10.64 to 0.10.70 (#7442) runtime-api: remove redundant version checks (#7610) Upgrade link-checker cache to v4 (#7874) Updating readmes (#7950) ...
|
@pandres95 @bkchr @ggwpez @kianenigma @gui1117 The new returned name looks like this, and I really don't see the need for it. Now, tools or existing code expecting a "pure" name, have to trim the string. For example, EVM precompiles using track info.
|
Where is that |
It comes from polkadot-sdk/substrate/primitives/runtime/src/lib.rs Lines 1037 to 1050 in 0c51d2e
|
We wanted to allow dynamic set of tracks: The name needed to be bounded. But in general I agree if doing a change without a break is not possible we should maybe prefer to fork the crate instead of breaking it unnecessarily. Is it already used on kusama? do we need to change it before it ships to polkadot and kusama, or should we roll with the breakage? |
We will trim the name inside the precompile on Moonbeam to keep the old behaviour, just wrote the comment to point out that maybe this was not the best design. Sorry about bringing the discussion to your PR, I should have commented in #2072. |
|
No problem at all @RomarQ. It's a good thing to notice. Definitely something that can be improved. |
I think we can roll with it. And try to be more careful in the future. |


This Pull Request fixes the following issues present with PJS derived from #2072
Tracksconstant as aVec<(TrackId, TrackInfo)>instead ofVec<Track>, so tracks iteration in PJS apps Governance hook remains as how it was before, and[u8; N]fromnamefield in aStringLikestructure that represents itsTypeInfoas a&strand encodes as such. This fixes errors present in PJS apps that treatnameas a javascriptstring.