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

Deposit contract assumes that controlAddress is unique for each validator #2057

Open
JamesHinshelwood opened this issue Dec 20, 2024 · 1 comment

Comments

@JamesHinshelwood
Copy link
Contributor

When calling depositTopup() or withdraw(), we look up the validator's BLS key based on the validator controlAddress. However, we do not enforce uniqueness of the controlAddress. So we should either:

  1. Demand that each validator has a unique controlAddress.
  2. Add a blsPubKey parameter to depositTopup and withdraw and look up the validator based on that instead (and this means we can probably remove the _stakerKeys map)

I would prefer 2 since it makes the deposit contract simpler and means validator pools can use a single wallet to control many validators.

@86667
Copy link
Contributor

86667 commented Dec 23, 2024

Agreed that 2. would be best, the _stakerKeys map is confusing.

I assume it's purpose was to link the caller (msg.sender) to the data acted upon (stakerKey), so we should still do this check. @DrZoltanFazekas is that correct, was there any other intended use for _stakerKeys?

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

No branches or pull requests

2 participants