Skip to content

Conversation

@wadealexc
Copy link
Contributor

@wadealexc wadealexc commented Jan 17, 2025

Reasoning: current encumberedMagnitude is a public getter that returns the non-updated version of an operator's encumbered magnitude.

When actually calling modifyAllocations, we use the updated version -- so this is probably more relevant to expose.

This PR makes the encumberedMagnitude mapping internal, and instead exposes a getter (getEncumberedMagnitude) that returns the current encumbered magnitude with completable deallocations included.

@wadealexc wadealexc force-pushed the alex/alm-magnitude-introspect branch 2 times, most recently from bc82389 to 03e41ea Compare January 17, 2025 19:36
@wadealexc wadealexc force-pushed the alex/alm-magnitude-introspect branch from 03e41ea to 321ff35 Compare January 17, 2025 19:58
@wadealexc wadealexc changed the title feat(wip): better introspection for encumbered magnitude feat: better introspection for encumbered magnitude Jan 17, 2025
@wadealexc wadealexc marked this pull request as ready for review January 17, 2025 19:59
Copy link
Collaborator

@ypatil12 ypatil12 left a comment

Choose a reason for hiding this comment

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

LGTM, one non-blocking nit. Would also be good to have a test confirming expected behavior of the view func

@wadealexc
Copy link
Contributor Author

LGTM, one non-blocking nit. Would also be good to have a test confirming expected behavior of the view func

So it doesn't really look like it because the updates I made to tests were very small, but the updated unit tests actually do check that the new function behaves correctly.

I was also planning to further dig into this in integration tests -- this version of getting encumbered magnitude makes integration test invariant/assertion writing much easier :)

Copy link
Contributor

@8sunyuan 8sunyuan 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 only code smell to me is how these view functions are implemented differently from the internal logic but thats been the case for a while. A bit late for a refactor.

@wadealexc wadealexc merged commit 4bde5b5 into slashing-magnitudes-fixes Jan 21, 2025
11 checks passed
@wadealexc wadealexc deleted the alex/alm-magnitude-introspect branch January 21, 2025 16:16
0xClandestine pushed a commit that referenced this pull request Feb 11, 2025
* feat: better introspection for encumbered magnitude

* chore: bindings

* chore: fix comment and make bindings
ypatil12 pushed a commit that referenced this pull request Feb 19, 2025
* feat: better introspection for encumbered magnitude

* chore: bindings

* chore: fix comment and make bindings
ypatil12 pushed a commit that referenced this pull request Feb 20, 2025
* feat: better introspection for encumbered magnitude

* chore: bindings

* chore: fix comment and make bindings
ypatil12 pushed a commit that referenced this pull request Feb 20, 2025
* feat: better introspection for encumbered magnitude

* chore: bindings

* chore: fix comment and make bindings
ypatil12 pushed a commit that referenced this pull request Feb 20, 2025
* feat: better introspection for encumbered magnitude

* chore: bindings

* chore: fix comment and make bindings
ypatil12 pushed a commit that referenced this pull request Feb 20, 2025
* feat: better introspection for encumbered magnitude

* chore: bindings

* chore: fix comment and make bindings
ypatil12 pushed a commit that referenced this pull request Feb 20, 2025
* feat: better introspection for encumbered magnitude

* chore: bindings

* chore: fix comment and make bindings
ypatil12 pushed a commit that referenced this pull request Feb 20, 2025
* feat: better introspection for encumbered magnitude

* chore: bindings

* chore: fix comment and make bindings
ypatil12 pushed a commit that referenced this pull request Feb 20, 2025
* feat: better introspection for encumbered magnitude

* chore: bindings

* chore: fix comment and make bindings
ypatil12 pushed a commit that referenced this pull request Feb 20, 2025
* feat: better introspection for encumbered magnitude

* chore: bindings

* chore: fix comment and make bindings
ypatil12 pushed a commit that referenced this pull request Feb 20, 2025
* feat: better introspection for encumbered magnitude

* chore: bindings

* chore: fix comment and make bindings
ypatil12 pushed a commit that referenced this pull request Feb 20, 2025
* feat: better introspection for encumbered magnitude

* chore: bindings

* chore: fix comment and make bindings
ypatil12 pushed a commit that referenced this pull request Feb 20, 2025
* feat: better introspection for encumbered magnitude

* chore: bindings

* chore: fix comment and make bindings
ypatil12 pushed a commit that referenced this pull request Feb 20, 2025
* feat: better introspection for encumbered magnitude

* chore: bindings

* chore: fix comment and make bindings
ypatil12 pushed a commit that referenced this pull request Feb 20, 2025
* feat: better introspection for encumbered magnitude

* chore: bindings

* chore: fix comment and make bindings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants