Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Update weight formula for session (with new_session taking full block) #5738

Merged
merged 4 commits into from
Apr 24, 2020

Conversation

gui1117
Copy link
Contributor

@gui1117 gui1117 commented Apr 22, 2020

updating formula for on_initialize requires new benchmarks, and maybe new API (or every cost of SessionHandler and ShouldEndSession will have to be documented)

EDIT: as suggested by shawn new_session take full block to make it easier, if in the future it is wanted we can improve on this.

@gui1117 gui1117 requested review from apopiak and shawntabrizi April 22, 2020 13:08
@gui1117 gui1117 added the A0-please_review Pull request needs code review. label Apr 22, 2020
@shawntabrizi
Copy link
Member

@thiolliere on_initialize -> rotate_session -> new_era right?

We can make this on_initialize take the full block weight. So the weight function should be an if statement, either 0 or max_value mandatory

(I think)

@gui1117 gui1117 added A3-in_progress Pull request is in progress. No review needed at this stage. and removed A0-please_review Pull request needs code review. labels Apr 22, 2020
} else {
// NOTE: the non-database part of the weight for `should_end_session(n)` is
// included as weight for empty block, the database part is expected to be in
// cache.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

reviewer should double-check this statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

related to #5722

@gui1117 gui1117 added A0-please_review Pull request needs code review. and removed A3-in_progress Pull request is in progress. No review needed at this stage. labels Apr 22, 2020
@gui1117 gui1117 changed the title Update weight formula for session except on_initialize Update weight formula for session except (with new_session taking full block) Apr 22, 2020
@gui1117 gui1117 changed the title Update weight formula for session except (with new_session taking full block) Update weight formula for session (with new_session taking full block) Apr 22, 2020
Copy link
Member

@shawntabrizi shawntabrizi left a comment

Choose a reason for hiding this comment

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

Weights look good 👍

@shawntabrizi shawntabrizi added A8-mergeoncegreen and removed A0-please_review Pull request needs code review. labels Apr 24, 2020
@shawntabrizi shawntabrizi added this to the 2.0 milestone Apr 24, 2020
@gavofyork gavofyork merged commit 15b5235 into master Apr 24, 2020
@gavofyork gavofyork deleted the gui-session-weight branch April 24, 2020 16:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants