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

approval-voting: processed wakeups can also update approval state #3848

Merged
8 commits merged into from
Sep 15, 2021

Conversation

rphmeier
Copy link
Contributor

@rphmeier rphmeier commented Sep 14, 2021

Related to #3847: a no-show that is pre-covered should now be marked as approved in the DB.

A short summary of changes: I renamed import_checked_approval to advance_approval_state so we could reuse the same code for more purposes than just approval checking imports. I added a new kind of state transition which is "processed wakeup". I changed the process_wakeup function to invoke advance_approval_state on every call. This means that if anything happens during regular wakeup processing to make the candidate approved, that it will be handled in the DB properly instead of dropped as it was before.

I added a test which I can confirm fails on master and passes in this branch.

@rphmeier rphmeier added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. labels Sep 14, 2021
rphmeier and others added 6 commits September 14, 2021 15:24
* master: (21 commits)
  Add build with docker info to README (#3843)
  improve approval tracing (#3846)
  UMP: Support Overweight messages (#3575)
  Companion for substrate#9115 (#3265)
  Better error messages. (#3835)
  Put all authorities of a session into `SessionInfo`. (#3813)
  Bump tracing from 0.1.26 to 0.1.27 (#3841)
  Companion for substrate#9711 (#3801)
  fix complaints in CI (#3838)
  dockerfiles: upgrade to ubuntu:20.04; some chore (#3828)
  make polkadot-runtime optional feature (#3820)
  Companion for #9648 (#3757)
  Substrate Companion #9737 (#3830)
  Add logging for worker spawn failures (#3827)
  Add Canvas (#3823)
  Allow staking miner to use different election algorithms (#3752)
  Do not expire HRMP open channel requests (#3543)
  Bump tokio from 1.10.1 to 1.11.0 (#3821)
  Add words to the dictionnary (#3819)
  Add vault secrets to puplish-rustdoc job (#3816)
  ...
Copy link
Member

@ordian ordian left a comment

Choose a reason for hiding this comment

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

Looks reasonable.

node/core/approval-voting/src/lib.rs Outdated Show resolved Hide resolved
Comment on lines +2561 to +2570
// A, B are tranche 0.
// C is tranche 1.
//
// All assignments imported at once, and B, C approvals imported immediately.
// A no-shows, leading to being covered by C.
// Technically, this is an approved block, but it will be approved
// when the no-show timer hits, not as a response to an approval vote.
//
// Note that we have 6 validators, otherwise the 2nd approval triggers
// the >1/3 insta-approval condition.
Copy link
Member

Choose a reason for hiding this comment

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

❤️ Thanks for the detailed comments!

Co-authored-by: Andronik Ordian <write@reusable.software>
Copy link
Contributor

@drahnr drahnr left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the explain-session :)

@rphmeier
Copy link
Contributor Author

bot merge

@ghost
Copy link

ghost commented Sep 15, 2021

Waiting for commit status.

@ghost
Copy link

ghost commented Sep 15, 2021

Merge aborted: Checks failed for fd5bab0

@ordian
Copy link
Member

ordian commented Sep 15, 2021

bot merge

@ghost
Copy link

ghost commented Sep 15, 2021

Waiting for commit status.

@ghost ghost merged commit e1d29ff into master Sep 15, 2021
@ghost ghost deleted the rh-approval-wakeups-update branch September 15, 2021 19:30
ordian added a commit that referenced this pull request Sep 16, 2021
* master:
  Raised nits on #3813 (#3844)
  Don't try to connect to ourselves. (#3855)
  add dispute metrics, some chores (#3842)
  add type info derive to senderror (#3860)
  Companion for #8615: enrich metadata with type information (#3336)
  approval-voting: processed wakeups can also update approval state (#3848)
  Add build with docker info to README (#3843)
  improve approval tracing (#3846)
  UMP: Support Overweight messages (#3575)
  Companion for substrate#9115 (#3265)
  Better error messages. (#3835)
  Put all authorities of a session into `SessionInfo`. (#3813)
  Bump tracing from 0.1.26 to 0.1.27 (#3841)
  Companion for substrate#9711 (#3801)
  fix complaints in CI (#3838)
ordian added a commit that referenced this pull request Sep 17, 2021
* master:
  Raised nits on #3813 (#3844)
  Don't try to connect to ourselves. (#3855)
  add dispute metrics, some chores (#3842)
  add type info derive to senderror (#3860)
  Companion for #8615: enrich metadata with type information (#3336)
  approval-voting: processed wakeups can also update approval state (#3848)
  Add build with docker info to README (#3843)
  improve approval tracing (#3846)
  UMP: Support Overweight messages (#3575)
  Companion for substrate#9115 (#3265)
  Better error messages. (#3835)
  Put all authorities of a session into `SessionInfo`. (#3813)
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants