Skip to content

Add UX related sanity checks #14

Description

@TobiWo

Summary

This PR will add and/or track sanity checks which need to be present to reduce probability of user errors as much as possible. These checks are not strictly necessary in terms of security because the EL request system contracts take care of the business logic already. However, system contracts can only check on EVM level which means a transaction was already sent. The result of a incorrect transaction is that the sender pays gas but the result is none. If using the cli tool for multiple validators at once this could lead to substantial burn of ETH due to transaction costs.

This list might grow over time.

UX improvements

  • display the executed sanity checks using a spinner framework like ora (with types @types/ora)

Sanity checks

Sanity checks will be implemented based on the request result simulation done by @pk910: ethpandaops/dora#236 . I'm not sure on all of these yet and whether they can be done before sending an EL request but most of them are feasible.

These results are unclear yet:

  • Source validator is not old enough
    • This is variable on different networks -> Can it be fetched via the beacon API
    • But can be hardcoded for mainnet and public testnets
  • Source validator has pending partial withdrawal
    • Can this be fetched?

Beside the aforementioned checks some general ones will be implemented as well:

  • Check that user provided validator pubkeys are correct
  • Check that private key is valid
  • Check the chosen network and the network which the cli connects to match
  • Check that all supplied validators for one call have the same withdrawal credentials
  • Check if there is enough balance on the wallet for sending an transaction

Checks based on simulation results

Consolidation

  • ❗ Source validator withdrawal address does not match tx sender (HIGH PRIORITY)
  • ❗ Target validator withdrawal address does not match tx sender (HIGH PRIORITY)
  • Total active balance too low (required: xx ETH)
  • Consolidation queue is full
  • Source validator not found
  • Source validator has invalid credentials
  • Source validator is not active
  • Source validator is not old enough (min. xx epochs)
  • Source validator has pending partial withdrawal
  • Target validator not found
  • Target validator has invalid credentials
  • Target validator is not compounding
  • Target validator is not active

Switch withdrawal credentials

  • Does the validator has 0x01 withrawal credentials set

Partial withdrawal

  • ❗ Validator withdrawal address does not match tx sender (HIGH PRIORITY)
  • Withdrawal queue is full
  • Validator not found
  • Validator has invalid credentials (valid: 0x02)
  • Validator is not active
  • Validator is not old enough (min. xx epochs)
  • Validator is not compounding
  • Validator has pending partial withdrawal
  • Validator balance too low

Exit

  • Does the supplied validator(s) has 0x01 or 0x02 withdrawal credentials

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions