-
Notifications
You must be signed in to change notification settings - Fork 81
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
Conversation
...sts/src/test/java/tech/pegasys/web3signer/tests/keymanager/SlashingProtectionDataChoice.java
Outdated
Show resolved
Hide resolved
...java/tech/pegasys/web3signer/slashingprotection/validator/GenesisValidatorRootValidator.java
Show resolved
Hide resolved
...rotection/src/main/java/tech/pegasys/web3signer/slashingprotection/DbSlashingProtection.java
Show resolved
Hide resolved
There was a problem hiding this 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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice spot!
if (!gvrValidator.genesisValidatorRootExists()) { | ||
return new NoOpIncrementalExporter(out); | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
...rotection/src/main/java/tech/pegasys/web3signer/slashingprotection/DbSlashingProtection.java
Outdated
Show resolved
Hide resolved
...egasys/web3signer/core/service/http/handlers/keymanager/delete/DeleteKeystoresProcessor.java
Outdated
Show resolved
Hide resolved
.../pegasys/web3signer/slashingprotection/interchange/NoOpIncrementalInterchangeV5Exporter.java
Outdated
Show resolved
Hide resolved
.../pegasys/web3signer/slashingprotection/interchange/NoOpIncrementalInterchangeV5Exporter.java
Outdated
Show resolved
Hide resolved
.../pegasys/web3signer/slashingprotection/interchange/NoOpIncrementalInterchangeV5Exporter.java
Outdated
Show resolved
Hide resolved
...ain/java/tech/pegasys/web3signer/slashingprotection/interchange/InterchangeJsonProvider.java
Outdated
Show resolved
Hide resolved
...ain/java/tech/pegasys/web3signer/slashingprotection/interchange/InterchangeJsonProvider.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still LGTM :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
doc-change-required
label to this PR if updates are required.Changelog