Skip to content

Commit 954b022

Browse files
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>
1 parent a7d6695 commit 954b022

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

contracts/HubPool.sol

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
7575
bytes32 public identifier = "IS_ACROSS_V2_BUNDLE_VALID";
7676

7777
// Interest rate payment that scales the amount of pending fees per second paid to LPs. 0.0000015e18 will pay out
78-
// the full amount of fees entitled to LPs in ~ 7.72 days, just over the standard L2 7 day liveness.
78+
// the full amount of fees entitled to LPs in ~ 7.72 days assuming no contract interactions. If someone interacts
79+
// with the contract then the LP rewards are smeared sublinearly over the window (i.e spread over the remaining
80+
// period for each interaction which approximates a decreasing exponential function).
7981
uint256 public lpFeeRatePerSecond = 1500000000000;
8082

8183
// Mapping of l1TokenAddress to cumulative unclaimed protocol tokens that can be sent to the protocolFeeCaptureAddress
@@ -560,7 +562,7 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
560562

561563
uint32 requestExpirationTimestamp = uint32(getCurrentTime()) + liveness;
562564

563-
delete rootBundleProposal; // Only one bundle of roots can be executed at a time.
565+
delete rootBundleProposal; // Only one bundle of roots can be executed at a time. Delete the previous bundle.
564566

565567
rootBundleProposal.requestExpirationTimestamp = requestExpirationTimestamp;
566568
rootBundleProposal.unclaimedPoolRebalanceLeafCount = poolRebalanceLeafCount;
@@ -588,7 +590,6 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
588590
* from this contract to the SpokePool designated in the leaf, and will also publish relayer refund and slow
589591
* relay roots to the SpokePool on the network specified in the leaf.
590592
* @dev In some cases, will instruct spokePool to send funds back to L1.
591-
* @notice Deletes the published root bundle if this is the last leaf to be executed in the root bundle.
592593
* @param chainId ChainId number of the target spoke pool on which the bundle is executed.
593594
* @param groupIndex If set to 0, then relay roots to SpokePool via cross chain bridge. Used by off-chain validator
594595
* to organize leaves with the same chain ID and also set which leaves should result in relayed messages.
@@ -794,7 +795,7 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable {
794795
emit ProtocolFeesCapturedClaimed(l1Token, _unclaimedAccumulatedProtocolFees);
795796
}
796797

797-
/**
798+
/**master
798799
* @notice Conveniently queries which destination token is mapped to the hash of an l1 token + destination chain ID.
799800
* @param destinationChainId Where destination token is deployed.
800801
* @param l1Token Ethereum version token.

contracts/HubPoolInterface.sol

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ interface HubPoolInterface {
1515
uint256 chainId;
1616
// Total LP fee amount per token in this bundle, encompassing all associated bundled relays.
1717
uint256[] bundleLpFees;
18-
// This array is grouped with the two above, and it represents the amount to send or request back from the
19-
// SpokePool. If positive, the pool will pay the SpokePool. If negative the SpokePool will pay the HubPool.
20-
// There can be arbitrarily complex rebalancing rules defined offchain. This number is only nonzero when the
21-
// rules indicate that a rebalancing action should occur. When a rebalance does occur, runningBalances should be
22-
// set to zero for this token and the netSendAmounts should be set to the previous runningBalances + relays -
23-
// deposits in this bundle. If non-zero then it must be set on the SpokePool's RelayerRefundLeaf amountToReturn
24-
// as -1 * this value to indicate if funds are being sent from or to the SpokePool.
18+
// Represents the amount to push to or pull from the SpokePool. If +, the pool pays the SpokePool. If negative
19+
// the SpokePool pays the HubPool. There can be arbitrarily complex rebalancing rules defined offchain. This
20+
// number is only nonzero when the rules indicate that a rebalancing action should occur. When a rebalance does
21+
// occur, runningBalances must be set to zero for this token and netSendAmounts should be set to the previous
22+
// runningBalances + relays - deposits in this bundle. If non-zero then it must be set on the SpokePool's
23+
// RelayerRefundLeaf amountToReturn as -1 * this value to show if funds are being sent from or to the SpokePool.
2524
int256[] netSendAmounts;
2625
// This is only here to be emitted in an event to track a running unpaid balance between the L2 pool and the L1
2726
// pool. A positive number indicates that the HubPool owes the SpokePool funds. A negative number indicates that
@@ -36,9 +35,9 @@ interface HubPoolInterface {
3635
uint256 groupIndex;
3736
// Used as the index in the bitmap to track whether this leaf has been executed or not.
3837
uint8 leafId;
39-
// The following arrays are required to be the same length. They are parallel arrays for the given chainId and
40-
// should be ordered by the l1Tokens field. All whitelisted tokens with nonzero relays on this chain in this
41-
// bundle in the order of whitelisting.
38+
// The bundleLpFees, netSendAmounts, and runningBalances are required to be the same length. They are parallel
39+
// arrays for the given chainId and should be ordered by the l1Tokens field. All whitelisted tokens with nonzero
40+
// relays on this chain in this bundle in the order of whitelisting.
4241
address[] l1Tokens;
4342
}
4443

0 commit comments

Comments
 (0)