package
0.7.6
Repository: https://github.com/dfinance/dnode.git
Documentation: pkg.go.dev

# README

Simulation parameters

Simulation:

  • ID - simulation id;
  • SimDuration - simulation duration;
  • BlockTimeMin - minimum block duration;
  • BlockTimeMax - maximum block duration;

Account balances:

  • MainTokens - initial account balance for main tokens (xfi);
  • StakingTokens - initial account balance for staking tokens (sxfi);
  • LPTokens - initial account balance for LP tokens (lpt);

Validators:

  • PoA validator - number of PegZone validators, ATM has no influence on simulation;
  • TM validators (total) - total number of PoS validators (some of them might become unbonded);
  • TM validators (active) - number of active PoS validators (they would be bonded);

DelegateBondingOp / DelegateLPOp operation:

  • Delegate bonding/LP tokens every - period of operation in simulated time;
  • Delegate amount ratio (of acc balance) - % of account balance for delegation;
  • Max limit ratio (staked ratio) - operation limit: % of staked tokens to total tokens supply;

RedelegateBondingOp / RedelegateLPOp operation:

  • Redelegate bonding/LP tokens every - period of operation in simulated time;
  • Redelegate amount ratio (of del shares) - % of delegation shares for redelegation;

UndelegateBondingOp / UndelegateLPOp operation:

  • Undelegate bonding/LP tokens every - period of operation in simulated time;
  • Undelegate amount ratio (of del shares) - % of delegation shares for undelegation;

ValidatorRewardOp operation:

  • Withdraw all validators comissions every - period of operation in simulated time;

DelegatorRewardOp operation:

  • Withdraw all delegators rewards every - period of operation in simulated time;

LockValidatorRewardsOp operation:

  • Lock rewards every - period of operation in simulated time;
  • Ratio of all validators - operation limit: % of all validators to lock rewards;

Operations

DelegateBondingOp / DelegateLPOp operation

Picks a validator and searches for an account to delegate bonding tokens.

  • SelfStake increment is allowed;
  • Delegation amount = current account balance * {delegateRatio};
  • Delegation is allowed if ratio (current staking bonding pools supply / total bonding tokens supply) < {maxBondingRatio};

Op priorities:

  • validator:
    • bonded;
    • lowest bonding tokens amount;
  • account:
    • highest bonding tokens balance;
    • enough coins;

RedelegateBondingOp / RedelegateLPOp operation

  • Picks a validator and redelegate bonding tokens to an other validator;
  • Redelegation amount = current account delegation amount * {redelegateRatio};

Op priorities:

  • dstValidator:
    • bonded;
    • lowest bonding tokens amount;
  • srcValidator - highest account delegation bonding shares;
  • account:
    • random;
    • has no active redelegations with srcValidator and dstValidator;
    • has enough bonding coins;
    • not a dstValidator owner;

UndelegateBondingOp / UndelegateLPOp operation

Picks a validator and undelegates bonding tokens.

  • Undelegation amount = current account delegation amount * {undelegateRatio}.

Op priorities:

  • validator - highest bonding tokens amount (all statuses);
  • account:
    • random;
    • has a validators bonding delegation;
    • not a validator owner;

ValidatorRewardOp operation

Takes all validators commissions rewards.

DelegatorRewardOp operation

Takes all delegators rewards (excluding locked ones).

LockValidatorRewardsOp operation

Takes validator commissions rewards.

Op priority:

  • validator - random;

CSV report

Report item is generated every simulated day.

  • BlockHeight - block height;
  • BlockTime - block time;
  • SimDuration - simulation time (real world time);
  • Validators: Bonded - number of bonded PoS validator;
  • Validators: Unbonding - number of unbonding PoS validator;;
  • Validators: Unbonded - number of unbonded PoS validator;;
  • Staking: Bonded - amount of bonded staking tokens (bonded validators);
  • Staking: NotBonded - amount of not-bonded staking tokens (unbonding/unbonded validators);
  • Staking: LPs - amount of staked LP tokens;
  • Staking: ActiveRedelegations - number of current redelegations;
  • Mint: MinInflation - minimum inflation rate;
  • Mint: MaxInflation - maximum inflation rate;
  • Mint: AnnualProvision - annual minted tokens estimation (tokens per year);
  • Mint: BlocksPerYear - number of blocks per year estimation;
  • Dist: FoundationPool - FoundationPool supply (decimals);
  • Dist: PTreasuryPool - PublicTreasuryPool supply (decimals);
  • Dist: LiquidityPPool - LiquidityProvidersPool supply (decimals);
  • Dist: HARP - HARP supply (decimals);
  • Dist: MAccBalance [main] - rewards balance keeped by the distribution module (mail tokens);
  • Dist: MAccBalance [staking] - rewards balance keeped by the distribution module (staking tokens);
  • Dist: BankBalance [main] - rewards balance keeped by the distribution bank (mail tokens);
  • Dist: BankBalance [staking] - rewards balance keeped by the distribution bank (staking tokens);
  • Dist: LockedRatio - rate of bonded delegated tokens for locked validators to all bonded delegated tokens;
  • Supply: Total [main] - total tokens supply (main tokens);
  • Supply: Total [staking] - total tokens supply (staking tokens);
  • Supply: Total [LP] - total tokens supply (LP tokens);
  • Stats: Staked/TotalSupply [staking] - rate of (bonded + not-bonded tokens) to total supply of staking tokens;
  • Stats: Staked/TotalSupply [LPs] - rate of staked LP tokens to total supply;
  • Accounts: TotalBalance [main] - sum of all accounts balances (main tokens);
  • Accounts: TotalBalance [staking] - sum of all accounts balances (staking tokens);
  • Counters: Bonding: Delegations - number of bonding delegation operations;
  • Counters: Bonding: Redelegations - number of bonding redelegation operations;
  • Counters: Bonding: Undelegations - number of bonding undelegation operations;
  • Counters: LP: Delegations - number of LP delegation operations;
  • Counters: LP: Redelegations - number of LP redelegation operations;
  • Counters: LP: Undelegations - number of LP undelegation operations;
  • Counters: RewardWithdraws - number of delegators rewards withdraw operations;
  • Counters: RewardsCollected [main] - accumulated amount of delegators rewards collected (main tokens);
  • Counters: RewardsCollected [staking] - accumulated amount of delegators rewards collected (staking tokens);
  • Counters: CommissionWithdraws - number of validators commission rewards operations;
  • Counters: CommissionsCollected [main] - accumulated amount of validators commission rewards collected (main tokens);
  • Counters: CommissionsCollected [staking] - accumulated amount of validators commission rewards collected (staking tokens);
  • Counters: LockedRewards - number of validators rewards lock operations;

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
FormatDuration yet another duration formatter.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewCreateValidatorOp creates validator for an account which is not an operator yet and has enough coins.
No description provided by the author
NewDelegateBondingOp picks a validator and searches for an account to delegate bonding tokens.
NewDelegateLPOp picks a validator and searches for an account to delegate LP tokens.
NewForceUpdateOp updates various simulator states for consistency.
NewGetDelegatorRewardOp takes all delegators rewards (excluding locked ones).
NewGetValidatorRewardOp takes all validators commissions rewards.
NewGetValidatorRewardOp takes validator commissions rewards.
NewPeriodicNextExecFn is a periodic execution.
NewRedelegateBondingOp picks a validator and redelegate bonding tokens to an other validator.
NewRedelegateLPOp picks a validator and redelegate LP tokens to an other validator.
NewReportOp captures report.
NewSimInvariantsOp checks inner simulator state integrity.
NewSimOperation creates a new SimOperation.
No description provided by the author
No description provided by the author
NewSimulator creates a new Simulator.
NewSimValidator createes a new SimValidator object.
NewUndelegateBondingOp picks a validator and undelegates bonding tokens.
NewUndelegateLPOp picks a validator and undelegates LP tokens.
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SimOperation keeps operation state and handlers.
SimOperationReport contains SimOperation execution report.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
SimOperationHandler handles operation using Simulator infra.
SimOperationNextExecFn returns next execution time for SimOperation.
No description provided by the author
No description provided by the author