Skip to content

Commit

Permalink
Added additional documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aion-shidokht committed Oct 16, 2019
1 parent cfed0ad commit 6fd155b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion pool-registry/src/main/java/org/aion/unity/PoolRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class PoolRegistry {

private static final BigInteger MIN_SELF_STAKE; // 1000 Aions
private static final BigInteger MIN_SELF_STAKE_PERCENTAGE; // 1%
// todo check value
private static final long COMMISSION_RATE_CHANGE_TIME_LOCK_PERIOD; // 6 * 60 * 24 * 7

private static final Address STAKER_REGISTRY;
Expand Down Expand Up @@ -804,6 +803,9 @@ private static Result secureCall(Address targetAddress, BigInteger value, byte[]
}

private static void detectBlockRewards(PoolRewardsStateMachine rewardsStateMachine) {
// This address represents the coinbase contract that was deployed by the PoolRegistry.
// PoolRegistry stores the contract bytecode and deploys it for each new pool, and thus this a trusted contract.
// Pool operators are unable to deploy their own custom contract or change their coinbase address.
Address coinbaseAddress = rewardsStateMachine.currentPoolRewards.coinbaseAddress;
BigInteger balance = Blockchain.getBalance(coinbaseAddress);
// balance > 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import java.math.BigInteger;

/**
* See https://github.com/ali-sharif/f1-fee-distribution for a PoC implementation of the F1 algorithm
* TODO: need more tests for this class
* Note that asserts are used in this class instead of Blockchain.require(), since at this stage of a call all the parameters and the state of
* the contract have been validated. We don't expect any of these conditions to be false.
* Also, assertions in AVM are always enabled.
*/
public class PoolRewardsStateMachine {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class StakerRegistry {

private static final BigInteger MIN_STAKE; // 1000 Aions
private static final long SIGNING_ADDRESS_COOLING_PERIOD; // 6 * 60 * 24 * 7;
private static final long UNBOND_LOCK_UP_PERIOD; // 6 * 60 * 24 * 7;
private static final long UNBOND_LOCK_UP_PERIOD; // 6 * 60 * 24;
private static final long TRANSFER_LOCK_UP_PERIOD; // 6 * 10;

private static long nextUnbondId = 0;
Expand Down

0 comments on commit 6fd155b

Please sign in to comment.