interchain-security icon indicating copy to clipboard operation
interchain-security copied to clipboard

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

Open p-offtermatt opened this issue 9 months ago • 3 comments

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...

  • [x] included the correct docs: prefix in the PR title
  • [x] targeted the correct branch (see PR Targeting)
  • [ ] provided a link to the relevant issue or specification
  • [x] reviewed "Files changed" and left comments if necessary
  • [x] 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 avatar May 14 '24 11:05 p-offtermatt

[!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 do a full 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.

coderabbitai[bot] avatar May 14 '24 11:05 coderabbitai[bot]

@coderabbitai pause please don't review this PR

p-offtermatt avatar May 14 '24 11:05 p-offtermatt

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

Actions Performed

Reviews paused.

coderabbitai[bot] avatar May 14 '24 11:05 coderabbitai[bot]

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 (?)

insumity avatar May 15 '24 12:05 insumity

this is extremely cool

faddat avatar May 16 '24 07:05 faddat

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.

p-offtermatt avatar May 16 '24 10:05 p-offtermatt

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

mpoke avatar May 22 '24 12:05 mpoke

I made some adjustments and I will reopen. We are now clearer on the direction we need to go with this. Also added some nice diagrams :)

p-offtermatt avatar Jun 03 '24 15:06 p-offtermatt

LGTM!!

jtremback avatar Jun 04 '24 21:06 jtremback

Note: Markdown link failures unrelated, seem to have smt to do with the Gaia doc update

p-offtermatt avatar Jun 05 '24 08:06 p-offtermatt