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

Richer error messages for 412 responses to signing requests #543

Open
siladu opened this issue Apr 1, 2022 · 0 comments
Open

Richer error messages for 412 responses to signing requests #543

siladu opened this issue Apr 1, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers TeamCerberus Under active development by TeamCerberus @Consensys

Comments

@siladu
Copy link
Contributor

siladu commented Apr 1, 2022

When signing with slashing protected enabled, maySign can return false resulting in a 412 API response:
https://github.com/ConsenSys/web3signer/blob/17d253bd617d5f54a7d7fe1a4b7849aa9922a125/core/src/main/java/tech/pegasys/web3signer/core/service/http/handlers/signing/eth2/Eth2SignForIdentifierHandler.java#L153-L160

The error messaging assumes it is due to slashing protection rules, however there are several reasons: GVR missing, database error, validator being disabled.

Original context: #520 (comment)

...However, from a code reading POV is the name SLASHING_PROTECTION_ENFORCED and log message "Signing not allowed due to slashing protection rules failing" slightly misleading for this case?
...
Yeah it is a bit misleading. The handler assumes it's due to the slashing protection rules failing but that's not always true. Could be GVR missing, database error, validator being disabled. Perhaps we should be returning a richer error answer from the slashing protection with errors that return an error message or code? Think this should be another ticket though.

@siladu siladu added enhancement New feature or request good first issue Good for newcomers TeamCerberus Under active development by TeamCerberus @Consensys labels Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers TeamCerberus Under active development by TeamCerberus @Consensys
Projects
None yet
Development

No branches or pull requests

1 participant