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

[Merged by Bors] - check if the slashing protection database is locked before creating keys #1949

Conversation

realbigsean
Copy link
Member

@realbigsean realbigsean commented Nov 23, 2020

Issue Addressed

Closes #1790

Proposed Changes

Make a new method that creates an empty transaction with TransactionBehavior::Exclusive to check whether the slashing protection is locked. Call this method before attempting to create or import new validator keystores.

Additional Info

N/A

@realbigsean realbigsean added A0 ready-for-review The code is ready for review labels Nov 23, 2020
@paulhauner
Copy link
Member

@michaelsproul you're the expert in these parts :)

Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

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

Looks good to me.

I just tested it with both create and import and it worked well 👍

I think it would be nice to have a simple test for test_transaction, but I won't block on it

account_manager/src/validator/create.rs Outdated Show resolved Hide resolved
@paulhauner paulhauner changed the base branch from master to unstable November 23, 2020 23:20
@realbigsean
Copy link
Member Author

Added a test 👍

Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

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

Perfect

bors r+

@michaelsproul michaelsproul added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Nov 24, 2020
bors bot pushed a commit that referenced this pull request Nov 24, 2020
…eys (#1949)

## Issue Addressed

Closes #1790

## Proposed Changes

Make a new method that creates an empty transaction with `TransactionBehavior::Exclusive` to check whether the slashing protection is locked. Call this method before attempting to create or import new validator keystores.  

## Additional Info

N/A


Co-authored-by: realbigsean <seananderson33@gmail.com>
@bors bors bot changed the title check if the slashing protection database is locked before creating keys [Merged by Bors] - check if the slashing protection database is locked before creating keys Nov 24, 2020
@bors bors bot closed this Nov 24, 2020
@realbigsean realbigsean deleted the dont-increment-next-account-on-failure branch November 21, 2023 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0 ready-for-merge This PR is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incrementing nextaccount when validator creation fails
3 participants