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

fix: eliminate race condition when updating BlockchainState #1240

Merged
merged 3 commits into from
Dec 18, 2023

Conversation

HashEngineering
Copy link
Collaborator

Issue being fixed or feature implemented

Related PR's and Dependencies

Screenshots / Videos

Resolve the issue where "Syncing..." appears for a long time:

How Has This Been Tested?

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

Comment on lines -176 to +173
mnlist.validMNsCount
var virtualMNCount = 0
mnlist.forEachMN(true) { entry ->
virtualMNCount += if (entry.isHPMN) 4 else 1
}
virtualMNCount
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EvoNodes have 4x the collateral (4000 instead of 1000) and receive 4x times the block rewards, so we will count them as 4 regular masternodes.

Each block only pays out a single masternode or 1/4 of a EvoNode. EvoNodes receive 4 blocks of rewards in a row. APY calculations are based on a single block.

Without this fix, we are using the number of actual masternode servers which will inflate the APY by around 10%.

Future improvements:

  1. We could base the APY on a number of blocks in recent history such as the past 100.
  2. Masternode reward calculations could be moved into dashj, but not sure which class would get the functions (Block or Masternode List)

Copy link
Member

@Syn-McJ Syn-McJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@HashEngineering HashEngineering merged commit 42846fa into master Dec 18, 2023
2 checks passed
@HashEngineering HashEngineering deleted the bugfix-syncing-issue branch January 5, 2024 22:51
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.

None yet

2 participants