Skip to content

IPovwAccounting

Functions

pendingEpoch

Return the number and total work (so far) of the pending epoch.

function pendingEpoch() external view returns (PendingEpoch memory);

finalizeEpoch

Finalize the pending epoch, logging the finalized epoch number and total work.

function finalizeEpoch() external;

updateWorkLog

Update a work log and log an event with the associated update value.

The stored work log root is updated, preventing the same nonce from being counted twice. Work reported in this update will be assigned to the current epoch. A receipt from the work log updater is used to ensure the integrity of the update. If an epoch is pending finalization, finalization occurs atomically with this call.

function updateWorkLog(
    address workLogId,
    bytes32 updatedCommit,
    uint64 updateValue,
    address valueRecipient,
    bytes calldata seal
) external;

workLogCommit

Get the current work log commitment for the given work log.

This commits to the consumed nonces that have been included in a log update.

function workLogCommit(address workLogId) external view returns (bytes32);

Events

EpochFinalized

Event emitted during the finalization of an epoch.

This event is emitted in some block after the end of the epoch, when the finalizeEpoch function is called. Note that this is no later than the first time that updateWorkLog is called after the pending epoch has ended.

event EpochFinalized(uint256 indexed epoch, uint256 totalWork);
Parameters
NameTypeDescription
epochuint256The number of the epoch that is being finalized.
totalWorkuint256The total value of the work submitted by provers during this epoch.

WorkLogUpdated

Event emitted when when a work log update is processed.

event WorkLogUpdated(
    address indexed workLogId,
    uint256 epochNumber,
    bytes32 initialCommit,
    bytes32 updatedCommit,
    uint256 updateValue,
    address valueRecipient
);
Parameters
NameTypeDescription
workLogIdaddressThe work log identifier, which also serves as an authentication public key.
epochNumberuint256The number of the epoch in which the update is processed. The value of the update will be weighted against the total work completed in this epoch.
initialCommitbytes32The initial work log commitment for the update.
updatedCommitbytes32The updated work log commitment after the update has been processed.
updateValueuint256Value of the work in this update.
valueRecipientaddressThe recipient of any rewards associated with this update.