-
Notifications
You must be signed in to change notification settings - Fork 75
fix[N06] Fix misleading comments #104
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
Conversation
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
|
Note that this PR was forked from https://github.com/across-protocol/contracts-v2/pull/102/files which should be merged first to avoid merge conflicts. |
|
@chrismaree going to hold off on reviewing this until the whitelisted routes update and the PR this is forked from are both merged, as I think they might require changes here. |
contracts/HubPool.sol
Outdated
| // Interest rate payment that scales the amount of pending fees per second paid to LPs. 0.0000015e18 will pay out | ||
| // the full amount of fees entitled to LPs in ~ 7.72 days, just over the standard L2 7 day liveness. | ||
| // the full amount of fees entitled to LPs in ~ 7.72 days assuming no contract interactions. If someone interacts | ||
| // with the contract then the LP rewards are smeared sublinearly over the window. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does "smeared sublinearly" mean? this is a bit handwavy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"because the _getAccumulatedFees function uses a fraction of the undistributedLpFees (which decreases over time for any given loan), rather than the total funds on loan."
contracts/HubPoolInterface.sol
Outdated
| // deposits in this bundle. If non-zero then it must be set on the SpokePool's RelayerRefundLeaf amountToReturn | ||
| // as -1 * this value to indicate if funds are being sent from or to the SpokePool. | ||
| int256[] netSendAmounts; | ||
| // This is only here to be emitted in an event to track a running unpaid balance between the L2 pool and the L1 pool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: additional changes:
- Line 17: Remove "This array is grouped with the two above"
- Line 39: Replace "The following arrays" with "The bundleLpFees, netSendAmounts, and runningBalances"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
o sorry. 17 was a result of a merge issue. this was taken out before but came back.
doing on 39.
nicholaspai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more changes then LGTM
Co-authored-by: nicholaspai <9457025+nicholaspai@users.noreply.github.com>
…art-contracts-v2 into chrismaree/no6
* fix[N04] Add additional documentation Signed-off-by: chrismaree <christopher.maree@gmail.com> * nit Signed-off-by: chrismaree <christopher.maree@gmail.com> * fix[N06] Fix missleading comments Signed-off-by: chrismaree <christopher.maree@gmail.com> * Apply suggestions from code review Co-authored-by: nicholaspai <9457025+nicholaspai@users.noreply.github.com> * nit Signed-off-by: chrismaree <christopher.maree@gmail.com> Co-authored-by: nicholaspai <9457025+nicholaspai@users.noreply.github.com>
) * improve: Update solc version to 8.13 * feat: Changes after running 8.13 wargames * Update Optimism_Adapter.json * Init commit: arbitrum rinkeby * finish arbitrum war games * fix[N06] Fix misleading comments (#104) * fix[N04] Add additional documentation Signed-off-by: chrismaree <christopher.maree@gmail.com> * nit Signed-off-by: chrismaree <christopher.maree@gmail.com> * fix[N06] Fix missleading comments Signed-off-by: chrismaree <christopher.maree@gmail.com> * Apply suggestions from code review Co-authored-by: nicholaspai <9457025+nicholaspai@users.noreply.github.com> * nit Signed-off-by: chrismaree <christopher.maree@gmail.com> Co-authored-by: nicholaspai <9457025+nicholaspai@users.noreply.github.com> * fix[N08] Propose fixes to some naming issues (#105) * fix[N02} Move all structs to the same place Signed-off-by: chrismaree <christopher.maree@gmail.com> * fix[N03] Fixed inconsistant token metadata versioning Signed-off-by: chrismaree <christopher.maree@gmail.com> * nit Signed-off-by: chrismaree <christopher.maree@gmail.com> * nit Signed-off-by: chrismaree <christopher.maree@gmail.com> * fix[N08] Propose fixes to some naming issues Signed-off-by: chrismaree <christopher.maree@gmail.com> * fix[L04] Enforce chainId requirements in PolygonTokenBridger (#115) * fix: Arbitrum Adapter needs to pay for L2 gas * Add helper scripts * Update Arbitrum_Adapter.sol Co-authored-by: Chris Maree <christopher.maree@gmail.com> Co-authored-by: Matt Rice <matthewcrice32@gmail.com>
Problem:
destination tokens, but does not mention that if the token is not whitelisted then the function
returns address(0).
version of the struct, making them hard to follow. For example, line 17 implies there are two
arrays above it (there is only one), and line 31 suggests there are multiple arrays below it (there
is only one).
root bundle, however it does not.
or "the calling contract" rather than "this contract".
The comments above the lpFeeRatePerSecond variable suggest that LP fees are released
linearly. In fact, they are released sublinearly, because the _getAccumulatedFees function uses
a fraction of the undistributedLpFees (which decreases over time for any given loan), rather
than the total funds on loan.
leaves per root. However, due to the indexing scheme in MerkleLib, there are a maximum of
2^248 different values of claimedWordIndex, with 256 different claimedBitIndexes. A more
clear comment might explain that there are 256x(2^248) leaves per root.
Solution:
Comments were updated.