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

EPIC: Circuit Breaker #14226

Closed
aaronc opened this issue Dec 8, 2022 · 5 comments
Closed

EPIC: Circuit Breaker #14226

aaronc opened this issue Dec 8, 2022 · 5 comments
Assignees
Labels
T:Epic Epics

Comments

@aaronc
Copy link
Member

aaronc commented Dec 8, 2022

Summary

Implement a small module which allows some authorized addresses to shut down module execution paths when security vulnerabilities are discovered.

Problem Definition

Circuit breakers have been discussed before #926 but never implemented. Essentially, we need a way to shut down critical exploit paths of security vulnerabilities ASAP before they can be exploited.

Proposal

I propose a very minimum viable circuit breaker module with the following features:

  • a list of approved circuit tripper/reset addresses (optionally scoped to specific Msg execution paths)
  • a method to trip the circuit breaker and disable a list of Msg execution paths in the ante handle, or even disable all Msgs
  • a method to reset tripped circuit breaker paths
  • methods for governance to add and remove circuit tripper addresses
  • standalone go module that works with v0.45.x+ so this can be integrated ASAP

In the future, we can iterate and add more advanced features, but what is proposed above can be implemented and released relatively quickly.

@tac0turtle tac0turtle changed the title Circuit Breaker MVP EPIC: Circuit Breaker Jan 3, 2023
@tac0turtle tac0turtle added the T:Epic Epics label Jan 3, 2023
@tac0turtle
Copy link
Member

@aaronc how did you envision this working with checktx or the ante handler?

@alexanderbez
Copy link
Contributor

Per offline discussions we agreed that AnteHandlers will be utilized in conjunction with the circuit breaker's logic. Feel free to add more detailed notes @aaronc.

@aaronc
Copy link
Member Author

aaronc commented Jan 5, 2023

Per offline discussions we agreed that AnteHandlers will be utilized in conjunction with the circuit breaker's logic. Feel free to add more detailed notes @aaronc.

How about this interface:

type CircuitBreaker interface {
  IsBlocked(context.Context, sdk.Tx) bool
}

with a new optional field CircuitBreaker on ante.HandlerOptions?

@alexanderbez
Copy link
Contributor

LGTM 👍

@tac0turtle
Copy link
Member

closing this for now, we will make sure to include it in 0.50 and later backport to others

@github-project-automation github-project-automation bot moved this from 💪 In Progress to 👏 Done in Cosmos-SDK Jun 28, 2023
@tac0turtle tac0turtle removed this from Cosmos-SDK Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T:Epic Epics
Projects
None yet
Development

No branches or pull requests

4 participants