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

feat: enhance PredepositGuardian with events, errors, fix bugs #936

Merged
merged 3 commits into from
Feb 10, 2025

Conversation

DiRaiks
Copy link
Contributor

@DiRaiks DiRaiks commented Jan 31, 2025

A short summary of the changes.

Context

Event Logging Enhancements:

  • Added several new events to log important actions such as topping up node operator bonds, withdrawing bonds, setting vouchers, and validator-related actions.

Error Handling Improvements:

  • Updated error messages to include more context, such as the specific validator public key and bond status, to aid in debugging and clarity.

Function Refactoring:

  • Refactored the internal _topUpNodeOperatorCollateral function to include additional validation and emit an event upon successful execution.
  • Modified the withdrawNodeOperatorBond and setNodeOperatorVoucher functions to emit appropriate events after executing their core logic. [1] [2]

Validation and Withdrawal Logic:

  • Enhanced the validation logic in functions like proveValidatorWC and withdrawDisprovenValidator to include more detailed error messages and emit corresponding events. [1] [2]

Miscellaneous:

  • Removed unnecessary payable modifiers from certain functions to streamline their functionality.…idation improvements

Potential problem

  • Fixed a bug in the logic of the setNodeOperatorVoucher function. The value in memory was reset to zero and the zero value was subsequently used to transfer funds [1]

@DiRaiks DiRaiks requested a review from a team as a code owner January 31, 2025 09:46
@DiRaiks DiRaiks force-pushed the predeposit-guardian-fixes branch from 4d5042e to ef47aed Compare February 6, 2025 16:22
@DiRaiks DiRaiks changed the title feat: enhance PredepositGuardian with events, error handling, and val… feat: enhance PredepositGuardian with events, errors Feb 6, 2025
@DiRaiks DiRaiks changed the title feat: enhance PredepositGuardian with events, errors feat: enhance PredepositGuardian with events, errors, fix bugs Feb 6, 2025

_validateNodeOperatorCaller(_nodeOperator);

nodeOperatorBonds[_nodeOperator].total += uint128(_amount);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use msg.value for event

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and state

@Jeday Jeday merged commit 7b61c6a into predeposit-guardian Feb 10, 2025
5 of 9 checks passed
@Jeday Jeday deleted the predeposit-guardian-fixes branch February 10, 2025 11:52
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

Successfully merging this pull request may close these issues.

2 participants