-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix executor param fetching session index #9774
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
base: master
Are you sure you want to change the base?
Fix executor param fetching session index #9774
Conversation
All GitHub workflows were cancelled due to failure one of the required jobs. |
let ExtendedSessionInfo { ref session_info, ref executor_params, .. } = | ||
match get_extended_session_info( | ||
let (no_show_slots, needed_approvals) = | ||
match get_session_info_by_index( |
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.
If a candidate is built on the last block of the previous session, the index you use here is different than the index you get on the second call below.
That is because block_entry.session
is actually the session of the relay parent and not it's child.
I think this needs to be the session index where it was backed and not the relay parent. @eskimor ? |
@sandreim I think indeed that it doesn't matter at all (correct me if I'm wrong). We should be using exactly the same set of parameters for a candidate in all the situations, but it doesn't really matter which set, as long as it's the same. That's what I'm trying to achieve here — always use the relay parent's session. |
Yes, you achieve what you said. But the session you use is the session of the child of the relay parent, which is fine, because this actually guarantees that the backed canidate always lands in same session. So you also end up using the same session index in disputes. |
This aims to fix #4292
We have three cases of candidate validation where a proper set of executor environment parameters should be used:
polkadot-sdk/polkadot/node/core/backing/src/lib.rs
Lines 1140 to 1146 in e7f36ab
polkadot-sdk/polkadot/node/subsystem-types/src/messages.rs
Lines 295 to 296 in 63958c4
So, hopefully, this PR fixes the only wrong case and harmonizes the executor param fetching over all the existing use cases.