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

docs: Add draft ADR for validators outside of the active set #1879

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

p-offtermatt
Copy link
Contributor

@p-offtermatt p-offtermatt commented May 14, 2024

Description

Closes: #XXXX


Author Checklist

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.

I have...

  • included the correct docs: prefix in the PR title
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • Confirmed the correct docs: prefix in the PR title
  • Confirmed all author checklist items have been addressed
  • Confirmed that this PR only changes documentation
  • Reviewed content for consistency
  • Reviewed content for spelling and grammar
  • Tested instructions (if applicable)
  • Checked that the documentation website can be built and deployed successfully (run make build-docs)

Summary by CodeRabbit

  • Documentation
    • Added a new document proposing a solution to allow inactive validators to validate on consumer chains, aimed at increasing the number of validators without straining the consensus engine.

@p-offtermatt p-offtermatt marked this pull request as ready for review May 14, 2024 11:46
@p-offtermatt p-offtermatt requested a review from a team as a code owner May 14, 2024 11:46
Copy link
Contributor

coderabbitai bot commented May 14, 2024

Note

Reviews Paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Walkthrough

The newly introduced adr-017-allowing-inactive-validators.md proposes a mechanism to enable validators that are not part of the active set to participate in validating consumer chains. This approach aims to expand the validator pool without overburdening the consensus engine, enhancing network security and decentralization.

Changes

File Path Change Summary
docs/docs/adrs/adr-017-allowing-inactive-validators.md Introduced a new ADR outlining a solution for allowing inactive validators to validate on consumer chains. No changes to exported or public entities were made.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to full the review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added C:Docs Assigned automatically by the PR labeler C:ADR Assigned automatically by the PR labeler labels May 14, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

docs/docs/adrs/adr-017-allowing-inactive-validators.md Outdated Show resolved Hide resolved
docs/docs/adrs/adr-017-allowing-inactive-validators.md Outdated Show resolved Hide resolved
docs/docs/adrs/adr-017-allowing-inactive-validators.md Outdated Show resolved Hide resolved
docs/docs/adrs/adr-017-allowing-inactive-validators.md Outdated Show resolved Hide resolved
docs/docs/adrs/adr-017-allowing-inactive-validators.md Outdated Show resolved Hide resolved
docs/docs/adrs/adr-017-allowing-inactive-validators.md Outdated Show resolved Hide resolved
@p-offtermatt
Copy link
Contributor Author

@coderabbitai pause
please don't review this PR

Copy link
Contributor

coderabbitai bot commented May 14, 2024

@p-offtermatt: Understood, I will pause the review for this PR.

Actions Performed

Reviews paused.

Copy link
Contributor

@jtremback jtremback left a comment

Choose a reason for hiding this comment

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

LGTM!


## References

* [adr-016-securityaggregation.md] has similar concerns where the staking validator set will differ from the consensus validator set
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: The [adr-016-securityaggregation.md] does not point anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, will fix!

@insumity
Copy link
Contributor

insumity commented May 15, 2024

I believe I understand the general idea: Increase the max_validators of the staking module to 500 and then work on top of that to do filtering, etc. so that the provider only still "sees" 180 validators but the remaining 320 (= 500 - 180) can still slashed, etc.

However I was thinking the following: Unbonded validators can opt in or assign a consumer key to a consumer chain. So, we could send the unbonded validators' public keys down to the consumer chains. For those validators to actually secure a consumer chain we need:

  1. for them to be slashable;
  2. to get rewards.

For 1. couldn't we just slash those unbonded validators on our own (without utilizing directly the Slash method) but using something like RemoveValidatorTokens? We already do part of slashing on our own so this could be adapted. Similarly for 2. we could adapt the reward distribution to give rewards to non-bonded validators.

A final note on the approach: Do we want to have a way for a validator to be able to secure a consumer chain without being forced to secure the Hub? If not, then it might make sense to simply increase the validator-set size on the Hub. After having a discussion with @MSalopek, it seems that increasing the validator-set size would lead to an increase in block times and this makes sense. However, it's not clear to me how big that increase would be. If it is in the range of a few hundred milliseconds, then just increasing the validator-set might be a viable approach (?)

Copy link

@cordt-sei cordt-sei left a comment

Choose a reason for hiding this comment

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

I was just discussing this with someone the other day, really great idea. At worst you are improving decentralization, at best you are rewarding actual contributors that oltherwise get overlooked.

@faddat
Copy link
Contributor

faddat commented May 16, 2024

this is extremely cool

@p-offtermatt
Copy link
Contributor Author

I believe I understand the general idea: Increase the max_validators of the staking module to 500 and then work on top of that to do filtering, etc. so that the provider only still "sees" 180 validators but the remaining 320 (= 500 - 180) can still slashed, etc.

However I was thinking the following: Unbonded validators can opt in or assign a consumer key to a consumer chain. So, we could send the unbonded validators' public keys down to the consumer chains. For those validators to actually secure a consumer chain we need:

1. for them to be slashable;

2. to get rewards.

For 1. couldn't we just slash those unbonded validators on our own (without utilizing directly the Slash method) but using something like RemoveValidatorTokens? We already do part of slashing on our own so this could be adapted. Similarly for 2. we could adapt the reward distribution to give rewards to non-bonded validators.

We discussed offline, but just to summarize:

  • I listed your alternative solution in the ADR. It's a good one, too, I will try that implementation instead of the current prototype to see if its significantly easier.

A final note on the approach: Do we want to have a way for a validator to be able to secure a consumer chain without being forced to secure the Hub? If not, then it might make sense to simply increase the validator-set size on the Hub. After having a discussion with @MSalopek, it seems that increasing the validator-set size would lead to an increase in block times and this makes sense. However, it's not clear to me how big that increase would be. If it is in the range of a few hundred milliseconds, then just increasing the validator-set might be a viable approach (?)

I think we want a solution where the potential validator set for consumer chains could be thousands of validators.
We want to remove the inherent link between "consensus validators of the hub" and "potential validators for consumer chains" so that e.g. hub governance can just increase the set of potential validators without even needing to consider the impact on consensus.

Copy link
Contributor

@mpoke mpoke left a comment

Choose a reason for hiding this comment

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

Great work @p-offtermatt. See my comments below.

docs/docs/adrs/adr-017-allowing-inactive-validators.md Outdated Show resolved Hide resolved
docs/docs/adrs/adr-017-allowing-inactive-validators.md Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait for #1910 to be merged and update intro.md

docs/docs/adrs/adr-017-allowing-inactive-validators.md Outdated Show resolved Hide resolved
docs/docs/adrs/adr-017-allowing-inactive-validators.md Outdated Show resolved Hide resolved
docs/docs/adrs/adr-017-allowing-inactive-validators.md Outdated Show resolved Hide resolved
docs/docs/adrs/adr-017-allowing-inactive-validators.md Outdated Show resolved Hide resolved
### Negative

* We need to be very careful in making sure all existing references to the validator set are updated to refer to the "actual active set" of the provider chain if necessary
* In the worst case, this might mean we need many changes to existing Cosmos SDK modules (and this would negate one of the positives of this solution)
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove.

We could instead adapt the *staking module* with a similar change.
This might be better if it turns out that the staking module active set is used in many other places.

### Allowing unbonding validators to validate
Copy link
Contributor

Choose a reason for hiding this comment

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

What would stop a set of unbonded validators from double signing on a consumer chain and withdraw all their ATOMs before the double sining evidence reaches the Hub?


## References

* [Security Aggregation](./adr-016-securityaggregation.md) has similar concerns where the staking validator set will differ from the consensus validator set
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace "the consensus validator set" with "the validator set provided to the consensus engine". Or define at the beginning of the ADR what you mean by the consensus validator set.

@mpoke mpoke marked this pull request as draft May 22, 2024 12:43
@mpoke
Copy link
Contributor

mpoke commented May 22, 2024

I changed it to draft as I think it's still very much work in progress.

p-offtermatt and others added 3 commits May 22, 2024 15:30
Co-authored-by: Marius Poke <marius.poke@posteo.de>
Co-authored-by: Marius Poke <marius.poke@posteo.de>
Co-authored-by: Marius Poke <marius.poke@posteo.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:ADR Assigned automatically by the PR labeler C:Docs Assigned automatically by the PR labeler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants