staking-async: add missing new_session_genesis#8310
Conversation
|
/cmd prdoc --bump patch |
b228382 to
d762ea4
Compare
- Updated the `asap` function to prepare the snapshot for fallback elections at block zero, ensuring successful execution even at genesis. - Modified the fallback logic to include a check for the genesis block alongside the existing runtime benchmarks feature. This change improves the robustness of the election provider by ensuring that fallback elections can be executed from the very first block. In particular, it fixes #8302, a regression introduced by PR #8127. While the solution has the benefit to be limited and not invasive, a better fix would be probably not to rely on the `asap()` method at all for genesis handling but ensure that the session manager correctly calls `new_session()` or `new_session_genesis()` respectively. Note also that the regression described in #8302 does NOT affect any running chain, but mostly testing when we spin-off a new node (e.g. look at the related issue in the staking-miner [here](paritytech/polkadot-staking-miner#1031)).
d762ea4 to
63a0b03
Compare
|
@kianenigma , @Ank4n , @niklasad1 PTAL 🙏 |
|
Did you figure out why |
I know and agree, best I have found is here and I haven't investigated further. This is why I put this part in the commit message |
a7ceb4a to
0d6e254
Compare
|
Sorry I took the liberty to investigate and push in 3525e4f So the root cause is this. Note that in Westend runtime, I am okay with the rest of the changes, but i am sure westend will work fine without them, if you just keep the last commit. |
| <Self as pallet_session::SessionManager<_>>::start_session(start_index) | ||
| } | ||
|
|
||
| fn new_session_genesis( |
There was a problem hiding this comment.
[nitpick] we also need to cleanup comment at line 530 since we now implement new_session_genesis :)
Fix issue #8302 (introduced by #8127), where the staking-async module could fail during genesis. The issue was related to the staking-async module in the Polkadot SDK, specifically with the implementation of the `historical::SessionManager` trait in the `ah-client` pallet with missing implementations of the new_session_genesis method in two different places: - In the pallet_session::SessionManager<T::AccountId> implementation - In the historical::SessionManager<T::AccountId, sp_staking::Exposure<T::AccountId, BalanceOf<T>>> implementation Note: the SessionManager trait requires the implementation of new_session_genesis for proper functioning, especially during chain initialization. The pallet-staking-async/ah-client has different operating modes: - Passive: Delegates operations to a fallback implementation - Buffered: Buffers operations for later processing - Active: Performs operations directly The fix ensures that in Passive mode, the new_session_genesis method correctly delegates to the fallback implementation, while in other modes it returns None.
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
The hack in do_elect() in handling genesis block is not needed anymore now that we have fixed the root issue in the staking-async-ah-client.
|
@kianenigma , I've reverted the rest of the changes (tested against the usual miner CI's test -> it works fine w/o). |
Fix issue paritytech#8302 (introduced by paritytech#8127), where the staking-async module could fail during genesis. The issue was related to the staking-async module in the Polkadot SDK, specifically with the implementation of the `historical::SessionManager` trait in the `ah-client` pallet with missing implementations of the new_session_genesis method in two different places: - In the pallet_session::SessionManager<T::AccountId> implementation - In the historical::SessionManager<T::AccountId, sp_staking::Exposure<T::AccountId, BalanceOf<T>>> implementation Note: the SessionManager trait requires the implementation of new_session_genesis for proper functioning, especially during chain initialization. The pallet-staking-async/ah-client has different operating modes: - Passive: Delegates operations to a fallback implementation - Buffered: Buffers operations for later processing - Active: Performs operations directly The fix ensures that in Passive mode, the new_session_genesis method correctly delegates to the fallback implementation, while in other modes it returns None. --------- Co-authored-by: kianenigma <[email protected]>
* master: (120 commits) [CI] Improve GH build status checking (#8331) [CI/CD] Use original PR name in prdoc check for the backport PR's to the stable branches (#8329) Add new host APIs set_storage_or_clear and get_storage_or_zero (#7857) push to dockerhub (#8322) Snowbridge - V1 - Adds 2 hop transfer to Rococo (#7956) [AHM] Prepare `election-provider-multi-block` for full lazy data deletion (#8304) Check umbrella version (#8250) [AHM] Fully bound staking async (#8303) migrate parachain-templates tests to `gha` (#8226) staking-async: add missing new_session_genesis (#8310) New NFT traits: granular and abstract interface (#5620) Extract create_pool_with_native_on macro to common crate (#8289) XCMP: use batching when enqueuing inbound messages (#8021) Snowbridge - Tests refactor (#8014) Allow configuration of worst case buy execution weight (#7944) Fix faulty pre-upgrade migration check in pallet-session (#8294) [pallet-revive] add get_storage_var_key for variable-sized keys (#8274) add poke_deposit extrinsic to pallet-recovery (#7882) `txpool`: use tracing for structured logging (#8001) [revive] eth-rpc refactoring (#8148) ...
Fix issue #8302 (introduced by #8127), where the staking-async module could fail during genesis. The issue was related to the staking-async module in the Polkadot SDK, specifically with the implementation of the `historical::SessionManager` trait in the `ah-client` pallet with missing implementations of the new_session_genesis method in two different places: - In the pallet_session::SessionManager<T::AccountId> implementation - In the historical::SessionManager<T::AccountId, sp_staking::Exposure<T::AccountId, BalanceOf<T>>> implementation Note: the SessionManager trait requires the implementation of new_session_genesis for proper functioning, especially during chain initialization. The pallet-staking-async/ah-client has different operating modes: - Passive: Delegates operations to a fallback implementation - Buffered: Buffers operations for later processing - Active: Performs operations directly The fix ensures that in Passive mode, the new_session_genesis method correctly delegates to the fallback implementation, while in other modes it returns None. --------- Co-authored-by: kianenigma <[email protected]>
Fix issue #8302 (introduced by #8127), where the staking-async module could fail during genesis.
The issue was related to the staking-async module in the Polkadot SDK, specifically with the implementation of the
historical::SessionManagertrait in theah-clientpallet with missing implementations of the new_session_genesis method in two different places:Note: the SessionManager trait requires the implementation of new_session_genesis for proper functioning, especially during chain initialization.
The pallet-staking-async/ah-client has different operating modes:
The fix ensures that in Passive mode, the new_session_genesis method correctly delegates to the fallback implementation, while in other modes it returns None.