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

Make accumulator objects more consistently pointers throughout #5848

Merged
merged 2 commits into from
Jul 18, 2023

Conversation

ValarDragon
Copy link
Member

Component of #5845

State compatible component of removing some unneeded store re-gets!

After this, we should be able to then remove some unneeded re-gets for accumulators :)

No new tests, safety of this should be covered by existing tests + resyncing on mainnet.

@ValarDragon ValarDragon added V:state/compatible/backport State machine compatible PR, should be backported A:no-changelog A:backport/v16.x backport patches to v16.x branch labels Jul 15, 2023
@@ -426,14 +426,15 @@ func (accum AccumulatorObject) ClaimRewards(positionName string) (sdk.Coins, sdk

// GetTotalShares returns the total number of shares in the accumulator
func (accum AccumulatorObject) GetTotalShares() (sdk.Dec, error) {
accum, err := GetAccumulator(accum.store, accum.name)
return accum.totalShares, err
// TODO: Make this not do an extra get.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TODO is the only new line introduced by this PR :)

Copy link
Member

@p0mvn p0mvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet

One question - In the PR description it says:
"State compatible component of removing some unneeded store re-gets!"

I didn't notice any removals. Just confirming - are these going to be added in a subsequent PR?

@ValarDragon
Copy link
Member Author

Yes, one is in #5849 !

@ValarDragon ValarDragon merged commit 04596ca into main Jul 18, 2023
@ValarDragon ValarDragon deleted the dev/make_accum_package_ptrs branch July 18, 2023 11:06
mergify bot pushed a commit that referenced this pull request Jul 18, 2023
* Make accumulator objects more consistently pointers throughout

* Update go mod

(cherry picked from commit 04596ca)

# Conflicts:
#	go.mod
#	go.sum
ValarDragon added a commit that referenced this pull request Jul 28, 2023
…ort #5848) (#5865)

* Make accumulator objects more consistently pointers throughout (#5848)

* Make accumulator objects more consistently pointers throughout

* Update go mod

(cherry picked from commit 04596ca)

# Conflicts:
#	go.mod
#	go.sum

* fix imports

---------

Co-authored-by: Dev Ojha <[email protected]>
Co-authored-by: Dev Ojha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v16.x backport patches to v16.x branch A:no-changelog C:x/concentrated-liquidity V:state/compatible/backport State machine compatible PR, should be backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants