question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Withdrawal addr should be able to call logout

See original GitHub issue

Issue

Currently, a validator must call logout using their validation key. If the validator loses their validation key, they can never get their deposit back. Allowing logout to be called from the validator’s withdrawal addr provides a backup in case of any issue that might arise with their validation key.

This is a simple addition that will ultimately provide a better validator experience and will likely encourage validation through reduced risk.

Proposed Implementation

  • change logout to assert that either ‘the msg sender is withdrawal_addr’ or ‘logout_msg is signed by the validators validation key’
  • add tests demonstrating both of these methods (including when both!)

Code should look something like the following:

@public
def logout(logout_msg: bytes <= 1024):
    sighash: bytes32 = extract32(raw_call(self.SIGHASHER, logout_msg, gas=self.SIGHASHER_GAS_LIMIT, outsize=32), 0)
    values = RLPList(logout_msg, [int128, int128, bytes])
    validator_index: int128 = values[0]
    epoch: int128 = values[1]
    sig: bytes <= 1024 = values[2]

    assert self.current_epoch >= epoch

    from_withdrawal: bool = msg.sender == self.validators[validator_index].withdrawal_addr
    assert msg.sender == from_withdrawal or self.validate_signature(sighash, sig, validator_index)
    
    ...

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
gabririgocommented, May 3, 2018

This is also a more secure way and a better experience for users looking to interact with casper through smart contracts (i.e. multisigs or vaults), as it enable to run a validator and manage the funds with completely separate logics and keys. I like it.

2reactions
hrishikeshiocommented, May 9, 2018

@paulhauner No worries. I have stopped working on it. You can claim the bounty.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FTX Security Features
A white listed address requires that all withdrawals go to predesignated whitelisted addresses. You can whitelist addresses saved to your main ...
Read more >
Adding and confirming a new cryptocurrency withdrawal ...
If you are looking for information on adding and confirming a new cryptocurrency withdrawal address on Kraken Pro, you can find out how...
Read more >
360000710185-Security-tools-available-from-HitBTC
This brand new feature lets you create a list of approved addresses to withdraw your funds to. It is a great tool to...
Read more >
15 Tips to Enhance Security of Your Binance Account
Binance's “Withdrawal Address Management” feature allows you to limit the wallet addresses to which you can withdraw your funds.
Read more >
Crypto.com App User Guide
Depositing Crypto. Clicking the “Transfer” button on the main screen will open the selection menu, where Deposit and Withdrawal will be available as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found