Skip to content

Conversation

@thogard785
Copy link
Collaborator

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.

…lances from one fastlane auction contract to a new, updated one without having to take custody of the funds
@BenSparksCode
Copy link
Contributor

BenSparksCode commented Jan 28, 2024

@thogard785 was reviewing this PR and I just noticed all the tests have been removed. Looks like its also like that on main and happened in this commit:
cb7abcc#diff-e5629336bb8c5641c2d1697b526ca73a8aa91bc28a31c5e5c11bc3c2ef580a4e

The last commit in #21 before it was merged into main

Not sure if intentional

Comment on lines +381 to +387
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);
}
Copy link
Contributor

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.

Suggested change
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);
}

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.

4 participants