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

feat!: switch the proposing sequencer after unbonding #606

Merged

Conversation

mtsitrin
Copy link
Contributor

@mtsitrin mtsitrin commented Feb 29, 2024

Description


Closes #605

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.

PR review checkboxes:

I have...

  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Targeted PR against the correct branch
  • included the correct type prefix in the PR title
  • Linked to the GitHub issue with discussion and accepted design
  • Targets only one GitHub issue
  • Wrote unit and integration tests
  • Wrote relevant migration scripts if necessary
  • All CI checks have passed
  • Added relevant godoc comments

SDK Checklist

  • Import/Export Genesis
  • Registered Invariants
  • Registered Events
  • Updated openapi.yaml
  • No usage of go map
  • No usage of time.Now()
  • Used fixed point arithmetic and not float arithmetic
  • Avoid panicking in Begin/End block as much as possible
  • No unexpected math Overflow
  • Used sendCoin and not SendCoins
  • Out-of-block compute is bounded
  • No serialized ID at the end of store keys

Full security checklist here

For Reviewer:

  • Confirmed the correct type prefix in the PR title
  • Reviewers assigned
  • Confirmed all author checklist items have been addressed

---;

After reviewer approval:

  • In case the PR targets the main branch, PR should not be squash merge in order to keep meaningful git history.
  • In case the PR targets a release branch, PR must be rebased.

Copy link

codecov bot commented Feb 29, 2024

Codecov Report

Attention: Patch coverage is 56.70103% with 42 lines in your changes are missing coverage. Please review.

Project coverage is 30.46%. Comparing base (3cf597f) to head (de2123f).

Files Patch % Lines
x/sequencer/types/sequencer.pb.go 58.13% 14 Missing and 4 partials ⚠️
x/sequencer/keeper/slashing.go 0.00% 11 Missing ⚠️
x/sequencer/keeper/invariants.go 36.36% 5 Missing and 2 partials ⚠️
x/sequencer/keeper/hook_listener.go 25.00% 2 Missing and 1 partial ⚠️
x/sequencer/types/sequencer.go 33.33% 2 Missing ⚠️
x/sequencer/types/query.pb.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #606      +/-   ##
==========================================
+ Coverage   30.41%   30.46%   +0.04%     
==========================================
  Files         201      201              
  Lines       28451    28514      +63     
==========================================
+ Hits         8654     8687      +33     
- Misses      18449    18474      +25     
- Partials     1348     1353       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mtsitrin mtsitrin marked this pull request as ready for review March 3, 2024 11:17
@mtsitrin mtsitrin requested a review from a team as a code owner March 3, 2024 11:17
@mtsitrin mtsitrin marked this pull request as draft March 3, 2024 11:28
@mtsitrin mtsitrin marked this pull request as ready for review March 3, 2024 13:33
Base automatically changed from mtsitrin/421-invariants-for-rollapp-module to main March 3, 2024 14:49
@omritoptix
Copy link
Contributor

@mtsitrin tests failed

@mtsitrin mtsitrin requested a review from omritoptix March 3, 2024 19:45
@mtsitrin mtsitrin changed the title feat: switch the proposing sequencer after unbonding feat!: switch the proposing sequencer after unbonding Mar 4, 2024
}
*/
}
if !proposerFound {
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure it's a invariant break. we can have a frozen rollapp or a rollapp with no active sequencer which is waiting for a sequencer to come up. we can't force a rollapp to have a proposer - e.g if a proposer is unbonding and don't want to propose anymore or it's jailed.

Copy link
Contributor Author

@mtsitrin mtsitrin Mar 4, 2024

Choose a reason for hiding this comment

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

we have

if len(bonded) == 0 {
    continue
}

So if there are bonded sequencers, i would expect a proposer one

func (k Keeper) RotateProposer(ctx sdk.Context, rollappId string) {
seqsByRollapp := k.GetSequencersByRollappByStatus(ctx, rollappId, types.Bonded)
if len(seqsByRollapp) == 0 {
k.Logger(ctx).Error("no bonded sequencer found for rollapp", "rollappId", rollappId)
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure it's an error. as I see it's a valid world state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right. will change in upcoming PR

@mtsitrin mtsitrin closed this Mar 4, 2024
@mtsitrin mtsitrin reopened this Mar 4, 2024
@mtsitrin mtsitrin merged commit d447bab into main Mar 4, 2024
12 of 15 checks passed
@mtsitrin mtsitrin deleted the mtsitrin/605-switch-the-proposing-sequencer-after-unbonding branch March 4, 2024 12:56
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.

[sequencers] move Proposer status to be bool flag switch the Proposing sequencer after unbonding
2 participants