Skip to content

Commit e7c038e

Browse files
committed
fix: document possible temporary thaw requests blockage when thawing period is shortened (OZ L-02)
Signed-off-by: Tomás Migone <[email protected]>
1 parent fe8f0ba commit e7c038e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

packages/horizon/contracts/interfaces/internal/IHorizonStakingMain.sol

+4-2
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,8 @@ interface IHorizonStakingMain {
659659
/**
660660
* @notice Remove tokens from a provision and move them back to the service provider's idle stake.
661661
* @dev The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw
662-
* requests in the event that fulfilling all of them results in a gas limit error.
662+
* requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function
663+
* will attempt to fulfill all thaw requests until the first one that is not yet expired is found.
663664
*
664665
* Requirements:
665666
* - Must have previously initiated a thaw request using {thaw}.
@@ -783,7 +784,8 @@ interface IHorizonStakingMain {
783784
/**
784785
* @notice Withdraw undelegated tokens from a provision after thawing.
785786
* @dev The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw
786-
* requests in the event that fulfilling all of them results in a gas limit error.
787+
* requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function
788+
* will attempt to fulfill all thaw requests until the first one that is not yet expired is found.
787789
* @dev If the delegation pool was completely slashed before withdrawing, calling this function will fulfill
788790
* the thaw requests with an amount equal to zero.
789791
*

packages/horizon/contracts/staking/HorizonStaking.sol

+7-2
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,8 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
800800
/**
801801
* @notice Remove tokens from a provision and move them back to the service provider's idle stake.
802802
* @dev The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw
803-
* requests in the event that fulfilling all of them results in a gas limit error.
803+
* requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function
804+
* will attempt to fulfill all thaw requests until the first one that is not yet expired is found.
804805
* @param _serviceProvider The service provider address
805806
* @param _verifier The verifier address
806807
* @param _nThawRequests The number of thaw requests to fulfill. Set to 0 to fulfill all thaw requests.
@@ -956,7 +957,8 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
956957
/**
957958
* @notice Withdraw undelegated tokens from a provision after thawing.
958959
* @dev The parameter `nThawRequests` can be set to a non zero value to fulfill a specific number of thaw
959-
* requests in the event that fulfilling all of them results in a gas limit error.
960+
* requests in the event that fulfilling all of them results in a gas limit error. Otherwise, the function
961+
* will attempt to fulfill all thaw requests until the first one that is not yet expired is found.
960962
* @dev If the delegation pool was completely slashed before withdrawing, calling this function will fulfill
961963
* the thaw requests with an amount equal to zero.
962964
* @param _requestType The type of thaw request (Provision or Delegation).
@@ -1073,6 +1075,9 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain {
10731075

10741076
/**
10751077
* @notice Traverses a thaw request list and fulfills expired thaw requests.
1078+
* @dev Note that the list is traversed by creation date not by thawing until date. Traversing will stop
1079+
* when the first thaw request that is not yet expired is found even if later thaw requests have expired. This
1080+
* could happen for example when the thawing period is shortened.
10761081
* @param _params The parameters for fulfilling thaw requests
10771082
* @return The amount of thawed tokens
10781083
* @return The amount of tokens still thawing

0 commit comments

Comments
 (0)