-
Notifications
You must be signed in to change notification settings - Fork 243
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
Update Substrate to 1.8.0 #2667
Conversation
Windows failed in CI because our Windows runners do not support symlinks right now, trying in my fork now to make sure things do actually pass once that is fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sync changes were not too breaking for our fork, but I like the direction they are moving
I understood the changes from sync-related PR as a "preparation of common steps for different sync strategies that can be shared". If I understood it correctly then the new strategy can be composed out of existing steps and it can be convenient.
I could still use some help with the failing test here |
The upgrade breaks many domain staking tests due to this PR paritytech/polkadot-sdk#2657, which replaces the The value is insufficient in both test and production, because an account can nominate multiple operators and for each nomination 2 holds can be created (one for the staking fund and another for withdrawal of the storage fund), besides, opening XDM channel also creates a hold. |
Hm... so does this mean we need to have extra tracking for those holds now and combine them together? That seems like a very annoying breaking change upstream. |
This is a static limit used as the upper bound of We can use the previous |
Feel free to push tweaks to this PR directly |
5c08787
@@ -133,11 +132,10 @@ impl pallet_domains::HoldIdentifier<Test> for HoldIdentifier { | |||
} | |||
|
|||
impl VariantCount for HoldIdentifier { | |||
const VARIANT_COUNT: u32 = mem::variant_count::<Self>() as u32; | |||
const VARIANT_COUNT: u32 = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong though, check the description of the trait. It is supposed to return the same number as number of enum variants. Substrate can't use mem::variant_count
because they rely on stable compiler, but we can because we use nightly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this violates the usage of the trait, but the max number of hold limits is hardcoded to HoldIdentifier::VARIANT_COUNT
in pallet-balances, which doesn't fit into our usage (even in test) so we need this hack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a hack on top of the hack. If it works by accident right now, I'm fine having it temporarily with a TODO explaining why we are hardcoding it to the wrong number. And we should get rid of it before it bites us again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the reviewer, see more discussion at #2674. PR is forced push to add TODO comment.
The value is used as the max number of hold an account can create, it is set to 100 for now to workaround some issues with this limit, should revist the value later. Signed-off-by: linning <[email protected]>
5c08787
to
c489074
Compare
This PR updates Substrate to polkadot-sdk version 1.8.0. 1.9.0 will be updated separately due to more breaking changes there.
There were minor breaking changes that resulted in
subspace-v4
branch in polkadot-sdk fork andsubspace-v6
in frontier fork, but nothing major. Going forward to decrease maintenance burden around frontier I plan to only upgrade to polkadot-sdk releases when frontier is update to them so I don't have to fix compatibility myself that they will not merge upstream afterwards (frontier is always lagging behind).I had to break
enable_non_root_calls
(and probably remove eventually) due toSudo::key()
being removed and other relevant information to identify if call is done by root or not seemingly not present inSignedExtension
API.The biggest changes this time came to RPC layer, but were mostly mechanical.
TransactionExtension
is something Gav authored that will likely cause more work upgrading in the future, but doesn't impact us as much for now.Sync changes were not too breaking for our fork, but I like the direction they are moving, @shamil-gadelshin please take a look there.
As to migrations and hooks, they recommend to reduce
on_initialize
logic to the minimum, I don't think it is a hard requirement for now, but something to keep in mind going forward.And I removed all versions from Substrate dependencies, they changed too many of them and it was painful and a bit pointless to update everywhere.
Interesting PRs on Substrate side:
rpc v2 chain_head
paritytech/polkadot-sdk#3230poll
hook and new System callbacks paritytech/polkadot-sdk#1781as frame_system::DefaultConfig
from the required syntax inderive_impl
paritytech/polkadot-sdk#3505TransactionExtension
as a replacement forSignedExtension
paritytech/polkadot-sdk#2280pallet::getter
frompallet-sudo
paritytech/polkadot-sdk#3370The only potentially interesting PRs on frontier side are these:
P.S. Running this version locally already, seems to work so far.
Code contributor checklist: