RSS3-Network / Global-Indexer

In the vast RSS3 Network, the Global Indexer navigates requests with precision, it is a beacon in the byte-filled sea.
MIT License
15 stars 1 forks source link

refactor: trigger to settler #150

Closed HenryQW closed 6 months ago

HenryQW commented 6 months ago

GI here merely calculates Operation Rewards and invokes the Settlement contract for rewards distribution.

GI has no power to distribute rewards of any kind.

The code changes involve renaming and updating the epoch trigger logic. The 'trigger' function has been renamed to 'submitEpochProof', which now submits proof of an epoch on chain, calculates operation rewards for nodes, formats data, and invokes a contract. A retry logic is also implemented to handle possible failures.

Additionally, the 'DistributeRewardsData' struct has been renamed to 'SettlementData'. The function 'buildDistributeRewards' is now called 'constructSettlementData', which constructs settlement data as required by the Settlement contract.

Error messages have also been updated for clarity and consistency throughout the codebase.