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: simulations for cosmos modules #7

Closed

Conversation

poorphd
Copy link

@poorphd poorphd commented Jul 20, 2023

Description

broken simulations for cosmos modules are fixed
short versions of simulations are added for CI/CD


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • included the necessary unit and integration tests
  • reviewed "Files changed" and left comments if necessary

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

zsystm added 30 commits June 29, 2023 16:45
penalty from src validator happened during re-delegation period must be covered by unpairing insurance.
this option can make epoch periods as very fast
* remove possibility of out of index error by using map and re-create slices
* not allow re-delegation if src validator is in unbonding period
* not track re-delegation info if src validator is unbonded because it completes re-delegation immediately
* refactored tombstone related code - remove redundancy
* fix some minor logics in testing codes
includes minor refactoring
it does not return error
* coins must not contain any empty elements. so append it dynamically, not using fixed length of slice.

* only add positive amt

* check every coins are valid before sending it

* finally check inputs and outputs (should not trigger any error)
* add validity check before sending coins

* the destination(=output) is just a reward pool so we don't need to use InputOutputCoins. SendCoins will be ok.
* snedAmt must be positive
* refundCoins must be valid
* lsTokensToBurn must be valid to burn it
* sendCoins must be valid to send it to undelegator
zsystm and others added 27 commits July 13, 2023 13:34
maybe delegation share's token value is higher than chunk size. In that case, just follow zero penalty flow.
we just return chunk un-delegated chunk balance to un-delegator
covered edge case where re-delegation penalty is bigger than un-pairing insurance's balance
* simplified variable names
* diet code lines
* make a function for common logic
and fix endblocker sequences in app.go which operates during EnableAdvanaceEpoch is on
if valid insurance is finished its duty, then it can be Pairing insurance again.
updated invariance too.
hard to guarantee unstkaing amt always be gte than chunk size tokens
…ulation

# Conflicts:
#	app/app.go
#	app/sim_test.go
#	app/state.go
#	x/liquidstaking/keeper/liquidstaking.go
#	x/liquidstaking/keeper/liquidstaking_test.go
@poorphd poorphd requested review from dongsam and zsystm July 20, 2023 10:23
@poorphd poorphd closed this Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants