Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary SFCState fields, errors rename #80

Merged
merged 3 commits into from
Oct 25, 2024
Merged

Conversation

thaarok
Copy link
Collaborator

@thaarok thaarok commented Oct 24, 2024

Added documentation into SFCState comments, renamed few errors to be more descriptive.

Following fields, which are write-only for the SFC, only to be read from outside, removed:

  • totalSlashedStake does not provide much useful information, it is even misleading - it includes only penalties subtracted from successful withdrawals. It does not contain slashed stake which was not withdrawn, or which even cannot be withdrawn because it is fully slashed.
  • EpochSnapshot.totalBaseRewardWeight represents base (sum) for individual validators participation: sum( stake * uptimeRatio ^ 2 ) However without individual baseRewardWeights, the number seems worthless. (baseRewardWeights are used in the BaseReward calculation, but not stored anywhere)
  • EpochSnapshot.totalTxRewardWeight is the same case, but for TxReward calculation: sum( originatedTxsFee * uptimeRatio )

@thaarok thaarok changed the title Add docs into SFCState, errors rename Remove unnecessary SFCState fields, errors rename Oct 25, 2024
contracts/sfc/SFCBase.sol Outdated Show resolved Hide resolved
@thaarok thaarok merged commit 1d315ce into sonic_sfc Oct 25, 2024
2 checks passed
@thaarok thaarok deleted the jk/state-docs branch October 25, 2024 09:47
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.

2 participants