feat: upgrade to polkadot SDK 2503#444
Conversation
- Migrate pallet_referenda Track API: TracksInfo::tracks() now returns
an Iterator<Item = Cow<Track>> instead of &[(Id, TrackInfo)].
Use .collect(), track.id / track.info.* access pattern throughout.
- Convert TrackInfo.name from &str to [u8; 128] (str_array), using
from_utf8() + trim_end_matches('\0') for string comparisons.
- Add authorization_list field to pallet_evm::Call::call (EIP-7702).
- Simplify ExistentialDeposit config: remove cfg split, use single
ED=0 now that PR #7379 handles benchmarks with zero ED.
- Re-enable pallet_identity benchmark_helper and benchmark entries
across mainnet and stagenet runtimes.
- Update pallet_collective alias comments re: PR #6435 status.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…benchmark helper method.
3d62f36 to
b04d2e6
Compare
| let Ok(track_name) = from_utf8(&track.info.name) else { | ||
| return false; | ||
| }; | ||
| let track_name = track_name.trim_end_matches('\0'); |
There was a problem hiding this comment.
I think this will break pallet referenda origin parsing, see my comment there.
There was a problem hiding this comment.
I have picked this up from moonbeam (see https://github.com/moonbeam-foundation/moonbeam/blob/fee53eec42fa4ec134120c3cde321fd6a546a6f6/runtime/moonbase/src/governance/tracks.rs#L161).
How do you think it will break ?
There was a problem hiding this comment.
the concern is that track_info.name is now a fixed-size NUL-padded array. So
str::from_utf8(&track_info.name) gives a string that can still contain trailing \0. Then GovOrigin::from_str(...) tries to parse that raw padded string, and for custom origins, "general_admin\0..." will not match the expected "general_admin".
There was a problem hiding this comment.
So the precompile may fail to build the correct custom origin from a padded name, and therefore revert before dispatching to pallet_referenda
| .in_field("trackId") | ||
| })? | ||
| .into() | ||
| GovOrigin::from_str(str::from_utf8(&track_info.name).map_err(|_| { |
There was a problem hiding this comment.
This now parses the full buffer directly, but the runtime track code trims trailing \0, so this may fail when trying to decode values with trailing 0's.
There was a problem hiding this comment.
I have added a call to trim_end_matches('\0') for the name. Having it in both places make sure we have properly sanitize the string.
gonzamontiel
left a comment
There was a problem hiding this comment.
I think most of the PR is okay, there are some potentially failing tests, we will see when the CI is green. After the requested changes are explained / fixed, I'll approve.
Polkadot upgrade 2503
In this PR, we upgrade form Polkadot SDK 2412 to Polkadot SDK 2503. In order to upgrade the SDK we need to upgrade some dependencies : StorageHub and frontier simultaneously.
What changes
Trivial changes
derive
DecodeWithMemTrackingforRuntimeCallparitytech/polkadot-sdk#7634 -> The new trait is required in all the pallets using scale encoding.Remove usage of
sp-stdfrom Substrate paritytech/polkadot-sdk#7043 -> Remove deprecatedsp-stdand replace withallocorcore.Implement cumulus StorageWeightReclaim as wrapping transaction extension + frame system ReclaimWeight paritytech/polkadot-sdk#6140 -> Accurate weight reclaim with frame_system::WeightReclaim
Breaking changes
Change pallet referenda TracksInfo::tracks to return an iterator paritytech/polkadot-sdk#2072 -> There is a change in
pallet-referenda. Now, the tracks are retrieved as a list ofTracks. Also, the names of the tracks might have some trailing null values (\0). This means display representation of the tracks' names must be sanitized.Adds
BlockNumberProviderin multisig, proxy and nft pallets paritytech/polkadot-sdk#5723 -> adds the ability for these pallets to specify their source of the block number. This is useful when these pallets are migrated from the relay chain to a parachain and vice versa. (Not entirely sure it is breaking as it is being marked as backward compatible).Update Pallet Referenda to support Block Number Provider paritytech/polkadot-sdk#6338 -> Update Referenda to Support Block Number Provider
Notable changes
Support block gap created by fast sync paritytech/polkadot-sdk#5703 -> Not changes required in the codebase but impact fastSync mode. Should improve testing.
Get rid of
libp2pdependency insc-authority-discoveryparitytech/polkadot-sdk#5842 -> Removeslibp2ptypes in authority-discovery, and replace them with network backend agnostic types fromsc-network-types. Thesc-networkinterface is therefore updated accordingly.What changes in Frontier
AuthorizationListin Ethereum transaction.Changes example :
authoriation_listfor support EIP 7702)