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

feat: tick init/deinit for CL #7622

Merged
merged 1 commit into from
Feb 28, 2024
Merged

feat: tick init/deinit for CL #7622

merged 1 commit into from
Feb 28, 2024

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented Feb 27, 2024

Closes: #XXX

What is the purpose of the change

Adding events for initializing and deinitializing ticks. This is needed by Numia for computing the APRs.

As a drive-by change, I noticed that we recomputed the spread rewards accumulators and removed the duplicate logic.

Testing and Verifying

  • Will run this change on a node since the beginning of v23.x once backported

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes?
  • Changelog entry added to Unreleased section of CHANGELOG.md?

Where is the change documented?

  • Specification (x/{module}/README.md)
  • Osmosis documentation site
  • Code comments?
  • N/A

CHANGELOG.md Outdated Show resolved Hide resolved
@p0mvn p0mvn added V:state/compatible/backport State machine compatible PR, should be backported A:backport/v23.x backport patches to v23.x branch labels Feb 27, 2024
x/concentrated-liquidity/lp.go Outdated Show resolved Hide resolved
@p0mvn p0mvn marked this pull request as ready for review February 27, 2024 06:18
Copy link
Contributor

@AlpinYukseloglu AlpinYukseloglu left a comment

Choose a reason for hiding this comment

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

LGTM! The tick initialization cleanup seems like a pretty big driveby change to make but it does seem correct. We should validate that that branch really did nothing

x/concentrated-liquidity/tick.go Outdated Show resolved Hide resolved
// set the tick's spread reward growth opposite direction of last traversal to the spread factor accumulator's value
if liquidityBefore.IsZero() {
if tickIndex <= currentTick {
accum, err := k.GetSpreadRewardAccumulator(ctx, poolId)
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing these reads should change the gas for this function so this is not state compatible right? Since even if this branch didn't do anything the reads were still happening

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. I will separate it into a separate PR

Copy link
Member Author

Choose a reason for hiding this comment

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

Moved here: #7625

@p0mvn
Copy link
Member Author

p0mvn commented Feb 28, 2024

Will backport and sync a v23.x node

@p0mvn p0mvn merged commit ea2310a into main Feb 28, 2024
1 check passed
@p0mvn p0mvn deleted the roman/cl-tick-events branch February 28, 2024 00:43
mergify bot pushed a commit that referenced this pull request Feb 28, 2024
(cherry picked from commit ea2310a)

# Conflicts:
#	CHANGELOG.md
mergify bot pushed a commit that referenced this pull request Feb 28, 2024
p0mvn added a commit that referenced this pull request Feb 28, 2024
(cherry picked from commit ea2310a)

Co-authored-by: Roman <roman@osmosis.team>
czarcas7ic added a commit that referenced this pull request Feb 29, 2024
czarcas7ic added a commit that referenced this pull request Feb 29, 2024
@github-actions github-actions bot mentioned this pull request Apr 1, 2024
@github-actions github-actions bot mentioned this pull request May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v23.x backport patches to v23.x branch 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.

None yet

2 participants