Skip to content

Commit

Permalink
disburseRewards => notifyValidClaim.
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk committed Nov 26, 2024
1 parent 2c9a1d8 commit 21aafd3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions contracts/contracts/activities/IValidatorRewarder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import {Consensus} from "./Activity.sol";
/// @title ValidatorRewarder interface.
///
/// @dev Implement this interface and supply the address of the implementation contract at subnet creation to process
/// subnet summaries at this level, and disburse rewards to validators based on their block production activity.
/// consensus activity summaries at this level, and disburse rewards to validators based on their block production
/// activities inside the subnet.
///
/// This interface will be called by the subnet actor when a validator presents a _valid_ proof of consensus activity,
/// via the ValidatorRewardFacet#claim
///
/// via the ValidatorRewardFacet#claim method.
interface IValidatorRewarder {
/// @notice Called by the subnet manager contract to instruct the rewarder to process the subnet summary and
/// disburse any relevant rewards.
/// @dev This method should revert if the summary is invalid; this will cause the
function disburseRewards(SubnetID calldata id, Consensus.ValidatorData calldata validatedData) external;
function notifyValidClaim(SubnetID calldata id, Consensus.ValidatorData calldata validatedData) external;
}
2 changes: 1 addition & 1 deletion contracts/contracts/examples/ValidatorRewarderMap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contract ValidatorRewarderMap is IValidatorRewarder, Ownable {
subnetId = id;
}

function disburseRewards(SubnetID calldata id, Consensus.ValidatorData calldata detail) external {
function notifyValidClaim(SubnetID calldata id, Consensus.ValidatorData calldata detail) external {
require(keccak256(abi.encode(id)) == keccak256(abi.encode(subnetId)), "not my subnet");

address actor = id.route[id.route.length - 1];
Expand Down
2 changes: 1 addition & 1 deletion contracts/contracts/lib/LibActivity.sol
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ library LibActivity {
}

// Notify the validator rewarder of a valid claim.
IValidatorRewarder(s.validatorRewarder).disburseRewards(subnet, data);
IValidatorRewarder(s.validatorRewarder).notifyValidClaim(subnet, data);

// Prune state for this height if all validators have claimed.
if (pending.claimed.length() == pending.summary.stats.totalActiveValidators) {
Expand Down

0 comments on commit 21aafd3

Please sign in to comment.