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

Addressing the linear growth of the reward rate #184

Merged
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -64,7 +64,7 @@ contract ValidatorRegistry {
uint public nextChallenge = 1;
bytes32[] public _listingKeys;
EventEmitter private eventEmitter;
uint _maxGenerationSum = 2 ether * 2 ether;
uint _maxGenerationSum = 2 ether;

/** @dev Create a new ValidatorRegistry implementation
@notice Create a new ValidatorRegistry implementation
@@ -103,7 +103,7 @@ contract ValidatorRegistry {
@return Maximum KosuToken a validator can generate per period.
*/
function maxRewardRate() public view returns (uint) {
return (sqrt(_maxGenerationSum));
return _maxGenerationSum;
}

/** @dev Expose listing data for given public key.
@@ -406,7 +406,7 @@ contract ValidatorRegistry {
} else {
if (listing.rewardRate > 0) {
uint rewardRate = uint(listing.rewardRate);
_maxGenerationSum = _maxGenerationSum.add(rewardRate.mul(rewardRate));
_maxGenerationSum = _maxGenerationSum.add(sqrt(rewardRate));
}

listing.lastRewardBlock = block.number;
@@ -555,7 +555,7 @@ contract ValidatorRegistry {
function removeListing(Listing storage l) internal {
if (l.rewardRate > 0 && l.confirmationBlock > 0) {
uint rewardRate = uint(l.rewardRate);
_maxGenerationSum = _maxGenerationSum.sub(rewardRate.mul(rewardRate));
_maxGenerationSum = _maxGenerationSum.sub(sqrt(rewardRate));
}

bytes32[] memory data = new bytes32[](1);
@@ -13,7 +13,7 @@
"url": "https://github.com/ParadigmFoundation/kosu-monorepo/issues"
},
"scripts": {
"test": "ts-mocha -p test/tsconfig.json test/* --timeout 0 --slow 2000",
"test": "yarn build && ts-mocha -p test/tsconfig.json test/* --timeout 0 --slow 2000",
"contracts:test:ci": "ts-mocha -p test/tsconfig.json test/* --slow 2000 --timeout 0 -b -- geth",
"coverage": "ts-mocha -p test/tsconfig.json test/* --slow 2000 --timeout 100000 -- runCoverage && istanbul report html && open coverage/index.html",
"build": "run-s compile:solidity generate_contract_wrappers compile:typescript",
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.