-
Notifications
You must be signed in to change notification settings - Fork 3
Forward Validator Balances #25
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
base: main
Are you sure you want to change the base?
Conversation
…lances from one fastlane auction contract to a new, updated one without having to take custody of the funds
|
@thogard785 was reviewing this PR and I just noticed all the tests have been removed. Looks like its also like that on The last commit in #21 before it was merged into main Not sure if intentional |
| function paySpecificValidatorFee(address _validator) external payable nonReentrant { | ||
| // TODO: block this when _validator == block.coinbase? | ||
| if (msg.value == 0) revert RelayValueIsZero(); | ||
| validatorsBalanceMap[_validator] += msg.value; | ||
| validatorsTotal += msg.value; | ||
| emit RelayFeeCollected(_validator, block.coinbase, msg.value); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to block _validator being block.coinbase (we don't block it in payValidatorFee).
To stay consistent with the payValidatorFee function, I suggest adding a _payor param, and corrected values emitted by RelayFeeCollected.
Another suggestion would be dropping the _payor param for both payValidatorFee and paySpecificValidatorFee functions, and set the payor param of the RelayFeeCollected event to msg.sender.
| function paySpecificValidatorFee(address _validator) external payable nonReentrant { | |
| // TODO: block this when _validator == block.coinbase? | |
| if (msg.value == 0) revert RelayValueIsZero(); | |
| validatorsBalanceMap[_validator] += msg.value; | |
| validatorsTotal += msg.value; | |
| emit RelayFeeCollected(_validator, block.coinbase, msg.value); | |
| } | |
| function paySpecificValidatorFee(address _payor, address _validator) external payable nonReentrant { | |
| if (msg.value == 0) revert RelayValueIsZero(); | |
| validatorsBalanceMap[_validator] += msg.value; | |
| validatorsTotal += msg.value; | |
| emit RelayFeeCollected(_payor, _validator, msg.value); | |
| } |
Added a payValidator method so that a validator can transfer their balances from one fastlane auction contract to a new, updated one without having to take custody of the funds.
I also added a check on the 'current' validator to block validators from withdrawing during their own blocks.