Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
findings
dev_mint_index:parse_signal/3 double negation
in dev_mint_index:parse_signal the module was doing
{ok, <<"withdraw">>} -> {ok, -RawQuantity};however there is one important caveat - full pot -> outbox -> mint-index stack:dev_pot:undelegate/6callsdev_pot:send_delegation_notice/6with-Amountdev_pot:send_delegation_notice/6pass that -ve quantity as is todev_process_outbox:send/3dev_process_outbox:notify/3fwd the original notice fields to subscribers asx-*fields without changing the sign, as isdev_mint_index:notify/3receive that forwarded withdraw notification and callsparse_signal/3parse_signal/3then negated the already-negativeRawQuantityagain, turning a withdrawal delta into a +ve valueimpact: undelegations increase the internal
indexed-deposits/<address>model instead of decreasing itdev_mint_index:must_redelegate/4 inverted check
the must_redelegate/4 function was checking
UpdateEvery >= ChangesSinceUpdate.which means the function will always return true for any positive UpdateEvery and reset ChangesSinceUpdate to 0, so it would always redelegate on every change.there are no specific tests for this fn or doc spec, but i assumed it means "redelegate every N changes".
question:
should UpdateEvery default to 1 instead of 0, so it doesnt redelegate always at defaults?
clarification needed
re redelegate/3 and indexed-deposits:
redelegate/3: right now redelegate/3 only emits a redelegation event and resetschanges-since-update. what is the intended implementation of redelegate/3 here? is it currently incomplete/missing?deposit model: the current model assumes:indexed-deposits/<address>to track indexed deposits. is the model here assuming the following stack?1. AO: dev_pot (root pot) + dev_token2. FLPs: child pots3. PI: a 'special' child/index pot that mirrors AO-side delegation preference on the root AO potasking becauselupdate_model/4ignores resource, so it is currently assuming a single-resource parent mode