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: bugs discovered during simulation #31

Merged
merged 43 commits into from
Aug 11, 2023

Commits on Jul 24, 2023

  1. Configuration menu
    Copy the full SHA
    7c0d133 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6e03a41 View commit details
    Browse the repository at this point in the history
  3. sync state transitions, messages and fix some logics

    DoCancelProvideInsurance
    when cancel provide insurance, we should return all of its spendable coins from both derived address and fee pool address.
    
    DoWithdrawInsurance
    we can accept request only paired or unpaired insurances, not unpairing insurance.
    it because unpairing insurance is already in state transition situation at epoch, so its weird to queue the request for that insurance.
    zsystm committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    a9e3316 View commit details
    Browse the repository at this point in the history
  4. sync latest spec with latest code and fix some core logics

    fix core logics
    before:
    * there can be bug because chunk's status is changed to unpairing but, current paired chunk's status is still Paired and chunk have paired insurance id even if it is unpairing chunk.
    after:
    if paired insurance of paired chunk have invalid insurance, then unpairing it and add it to out insurances to hande just like other unpairing chunks.
    
    add missing invariant checks
    * newly added RedelegationInfosInvariant was not included
    
    chore
    * refactor variables name in invariants.go
    * use lsm's own event key types, not other module's.
    * add module name to each event
    zsystm committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    fc34e6e View commit details
    Browse the repository at this point in the history
  5. wip: refactor simulation codes

    todo: need to run it in local
    zsystm committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    6d9e6a0 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2023

  1. fix and update app.go

    zsystm committed Jul 25, 2023
    Configuration menu
    Copy the full SHA
    4513cf7 View commit details
    Browse the repository at this point in the history
  2. wip: implementing proposal simulations

    TODO: Solve cycle problem
    zsystm committed Jul 25, 2023
    Configuration menu
    Copy the full SHA
    6de9b56 View commit details
    Browse the repository at this point in the history
  3. solve import cycle and make it work

    TODO: deal with staking module's initial stake part
    zsystm committed Jul 25, 2023
    Configuration menu
    Copy the full SHA
    c00b58c View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2023

  1. fix simulations

    zsystm committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    6322bf6 View commit details
    Browse the repository at this point in the history
  2. update reduction

    zsystm committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    ef8cb94 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2023

  1. Merge remote-tracking branch 'origin/liquidstaking-module' into zsyst…

    …m/simulation-advance-epoch
    
    # Conflicts:
    #	app/params/weights.go
    #	proto/canto/liquidstaking/v1/liquidstaking.proto
    #	x/liquidstaking/keeper/liquidstaking.go
    #	x/liquidstaking/simulation/proposals.go
    #	x/liquidstaking/spec/02_state.md
    #	x/liquidstaking/spec/chunk_state_transition_diagram.png
    #	x/liquidstaking/spec/insurance_state_transition_diagram.png
    #	x/liquidstaking/types/liquidstaking.pb.go
    zsystm committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    f8247d4 View commit details
    Browse the repository at this point in the history
  2. resolve errors after merge

    zsystm committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    0263428 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2aa2462 View commit details
    Browse the repository at this point in the history
  4. update invariant and refactor some codes

    del shares can be less than 250K (e.g. slashing during re-delegation period, not yet reached epoch)
    zsystm committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    1276983 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2023

  1. remove un-used check and add more context to panic message

    now chunk invariants does not check its delegation shares.
    it can be changed by slashing during re-delegation.
    zsystm committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    d69186e View commit details
    Browse the repository at this point in the history
  2. fix: re-delegation matured logic

    decision must be based on current block time.
    if current block time >= info.CompletionTime, then it is matured.
    if not, it is un-matured.
    zsystm committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    b7e877f View commit details
    Browse the repository at this point in the history
  3. wip: fix some isseus and trouble shooting for seed 1623992154303935393

    disabled mimicking begin block logic of distribution module at epoch
    zsystm committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    e400e88 View commit details
    Browse the repository at this point in the history
  4. fix: simulation cancel provide insurance

    target insurance must be pairing
    zsystm committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    be9504b View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2023

  1. fix negative penaltyAmt

    zsystm committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    fae5123 View commit details
    Browse the repository at this point in the history
  2. sim: change power reduction

    zsystm committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    cdeac2f View commit details
    Browse the repository at this point in the history
  3. fix: not updated validator problem and power reduction

    must use validator retrieved from latest state.
    zsystm committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    6cdfeb7 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2023

  1. exclude epochs key

    EpochInfo.CurrentEpochStartHeight is set to the block height at the time of init genesis.
    This state is changeable when export and import, so exclude it.
    zsystm committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    e2cdcae View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2a9b63f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cfb616f View commit details
    Browse the repository at this point in the history
  4. fix: restOutIns can have paired chunk

    when ins directs Unbonding validator, then this situation can happen.
    In this situation, we just unpair and undelegate it.
    zsystm committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    c1f8596 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2023

  1. temp: disable lsm param change

    * fix dynamic fee rate as default
    zsystm committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    13003eb View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2023

  1. fix: out insurance's status must not be updated

    this is related with recent patch.
    outIns is already unpairing for unpairing_for_withdrawa, so we must not update it.
    
    chore: removed un-used method.
    zsystm committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    9e82ef0 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2023

  1. fix: out insurance status

    out insurance can be PAIRED status (ranked out but no replacement).
    if it is not unpairing or unpairing for withdrawal we must change its status to unpairing because unbonding will be started.
    zsystm committed Aug 9, 2023
    Configuration menu
    Copy the full SHA
    b7da931 View commit details
    Browse the repository at this point in the history
  2. fix: simop liquid unstake

    when decide unstakable chunk, we should consider whether it is already queued or not.
    zsystm committed Aug 9, 2023
    Configuration menu
    Copy the full SHA
    fabb46f View commit details
    Browse the repository at this point in the history
  3. optimize gas consumption (add InsuranceState) and update sim

    optimize gas consumption
    * added new internal state InsuranceState
    * when calc NetAmount we don't need insurance states. so separate that state which will be used when query.
    
    update sim
    * apply default genesis
    * don't allow param change
    * enable inflation module
    
    temp: apply sdk.DefaultPowerReduction when calc epoch provision. this will be changed at next PR
    zsystm committed Aug 9, 2023
    Configuration menu
    Copy the full SHA
    7aa59e6 View commit details
    Browse the repository at this point in the history
  4. add missing files

    zsystm committed Aug 9, 2023
    Configuration menu
    Copy the full SHA
    335d028 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    eb034c0 View commit details
    Browse the repository at this point in the history
  6. clarify tc

    more understandable and readable tc
    zsystm committed Aug 9, 2023
    Configuration menu
    Copy the full SHA
    5b6759d View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2023

  1. Configuration menu
    Copy the full SHA
    6a5555f View commit details
    Browse the repository at this point in the history
  2. remove un-used weights

    zsystm committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    a9b2103 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    781a833 View commit details
    Browse the repository at this point in the history
  4. add missing proto file

    zsystm committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    72d2a68 View commit details
    Browse the repository at this point in the history
  5. remove epoch infos keys

    epoch module's state can be changed when initGenesis.
    zsystm committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    58a181b View commit details
    Browse the repository at this point in the history
  6. roll-back change and add NetAmountStateEssentials

    all core logics using NetAmount before now use NetAmountEssentials.
    NetAmount is used just for querying.
    zsystm committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    29125c1 View commit details
    Browse the repository at this point in the history
  7. add missing files

    zsystm committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    e47ac8d View commit details
    Browse the repository at this point in the history
  8. apply ethermint reduction

    for this, applied custom ibc-go and cosmos-sdk to updated initialStake as sdk.Int
    zsystm committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    bed5d90 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    04d03d3 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    e9b728d View commit details
    Browse the repository at this point in the history