Skip to content
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

1190: better interface for launch-approval #1355

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

ordian
Copy link
Member

@ordian ordian commented Sep 1, 2023

Instead of passing Option<ExecutorParams> and failing the task if it's None, we can get all the info we need from extended session info.

Note: targeting pr #1190.

Err(_) => {
gum::debug!(
target: LOG_TARGET,
session = session_index,
?relay_parent,
"Can't obtain SessionInfo"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really not how the usage was intended, but that was the case before already.

match get_extended_session_info(
session_info_provider,
ctx.sender(),
block_entry.parent_hash(),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only difference is that we now fetch executor params using parent_hash of relay_block instead of relay_block, but they should be in the same session, right? Otherwise, why would be passing block_entry.session() and not session of parent?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, why do we use parent_hash here? Shouldn't it be relay_block as in other places

let session_info = get_session_info(env.runtime_info, ctx.sender(), block_hash, session_index)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They don't even have to be in the same session. The more current head is technically better, for reasons Rob pointed out but also because even if those two would at some point (with impl changes) end up being in different sessions, the newer one would still have access to the session of the other, while the opposite might not be true.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They don't even have to be in the same session. The more current head is technically better, for reasons Rob pointed out but also because even if those two would at some point (with impl changes) end up being in different sessions, the newer one would still have access to the session of the other, while the opposite might not be true.

yes, this sounds right to me.

@ordian ordian requested a review from rphmeier September 1, 2023 17:17
@eskimor eskimor merged commit f32c7c9 into s0me0ne/candidate-session-index Sep 1, 2023
@eskimor eskimor deleted the ao-1190-nits branch September 1, 2023 17:18
eskimor pushed a commit that referenced this pull request Sep 1, 2023
* Import changes from archieved repo

* Revert erroneous changes

* Fix more tests

* Resolve discussions

* Fix MORE tests

* approval-voting: launch_approval better interface (#1355)

---------

Co-authored-by: Javier Viola <[email protected]>
Co-authored-by: ordian <[email protected]>
Co-authored-by: ordian <[email protected]>
@s0me0ne-unkn0wn
Copy link
Contributor

Thanks for this improvement! I've spent quite a bit of time trying to avoid code duplication and preserve its structure, but your approach is much better.

Daanvdplas pushed a commit that referenced this pull request Sep 11, 2023
* Import changes from archieved repo

* Revert erroneous changes

* Fix more tests

* Resolve discussions

* Fix MORE tests

* approval-voting: launch_approval better interface (#1355)

---------

Co-authored-by: Javier Viola <[email protected]>
Co-authored-by: ordian <[email protected]>
Co-authored-by: ordian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants