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 empty data Incremental Exporter when gvr does not exist #574

Merged
merged 12 commits into from
May 26, 2022

Conversation

usmansaleem
Copy link
Collaborator

PR Description

Use No Op Incremental Exporter when gvr does not exist. Fixes the issue of delete API where validator was imported without slashing protection data.

Fixed Issue(s)

Fixes #537

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

@usmansaleem usmansaleem requested review from jframe and siladu May 23, 2022 04:16
Copy link
Contributor

@siladu siladu left a comment

Choose a reason for hiding this comment

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

One minor nit, but otherwise LGTM :)


@Override
public void close() throws Exception {
outputStream.close();
Copy link
Contributor

Choose a reason for hiding this comment

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

nice spot!

Comment on lines 150 to 152
if (!gvrValidator.genesisValidatorRootExists()) {
return new NoOpIncrementalExporter(out);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: might be nice to create the NoOpIncrementalExporter at the same level as abstraction as before, e.g. by exposing genesisValidatorRootExists to the level above.

The reader would also benefit from the existing comment that explains why we use the noop exporter:

// Using no-op exporter instead of returning an optional so can use try with for closing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added a comment. However, exposing checkGVR at SlashingProtection interface would add two level of abstraction i.e. DBSlashing.checkGVR -> gvrValidator.checkGVR. T

@usmansaleem usmansaleem requested review from siladu and jframe May 24, 2022 01:06
@usmansaleem usmansaleem changed the title Use No Op Incremental Exporter when gvr does not exist Use empty data Incremental Exporter when gvr does not exist May 24, 2022
Copy link
Contributor

@siladu siladu left a comment

Choose a reason for hiding this comment

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

still LGTM :)

Copy link
Contributor

@jframe jframe left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error deleting validator
3 participants