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

Use type safety to prevent provider addr vs consumer addr bugs #707

Closed
shaspitz opened this issue Feb 3, 2023 · 1 comment · Fixed by #725
Closed

Use type safety to prevent provider addr vs consumer addr bugs #707

shaspitz opened this issue Feb 3, 2023 · 1 comment · Fixed by #725
Assignees
Labels
type: refactoring Code refactoring type: tech-debt Slows down development in the long run
Milestone

Comments

@shaspitz
Copy link
Contributor

shaspitz commented Feb 3, 2023

Problem

Issues like #693 have proven that using provider and consumer addresses interchangeably as the same type can cause bugs. We should make a new protobuf key type wrapper that can delineate between a provider cons address and a consumer cons address.

Closing criteria

Protobuf type(s) are made and implemented across our repo to prevent developers from mistakenly using the wrong type of address. This issue could also be closed by simply using golang type aliases

@shaspitz shaspitz added type: tech-debt Slows down development in the long run type: refactoring Code refactoring labels Feb 3, 2023
@shaspitz
Copy link
Contributor Author

shaspitz commented Feb 3, 2023

As an example Methods like SetSlashAcks should accept consumerConsAddr instead of a string, this would have prevented #693. See also #694 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: refactoring Code refactoring type: tech-debt Slows down development in the long run
Projects
Status: ✅ Done
2 participants