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.
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.