-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check veto processing delay during redemption proposal generation
The optimistic redemption upgrade introduces a veto mechanism that enforces a processing delay on each redemption request. The exact delay value depends on the number of objections raised against the given redemption request. The `WalletProposalValidator` contract has been modified to include validation of that delay factor. Here we introduce the same for the redemption proposal generator. This ensures the generator issues proposals that conform the on-chain validation rules and coordination windows are not being wasted. See: keep-network/tbtc-v2#788
- Loading branch information
1 parent
e278aaa
commit ed9c4ae
Showing
8 changed files
with
204 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
60 changes: 60 additions & 0 deletions
60
pkg/tbtcpg/internal/test/testdata/find_pending_redemptions_scenario_3.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"Title": "pending redemptions with different processing delays exist", | ||
"ChainParameters":{ | ||
"AverageBlockTime": 10, | ||
"CurrentBlock": 100000, | ||
"RequestTimeout": 86400, | ||
"RequestMinAge": 3600 | ||
}, | ||
"MaxNumberOfRequests": 10, | ||
"WalletPublicKeyHash": "0x928d992e5f5b71de51a1b40fcc4056b99a88a647", | ||
"PendingRedemptions": [ | ||
{ | ||
"WalletPublicKeyHash": "0x928d992e5f5b71de51a1b40fcc4056b99a88a647", | ||
"RedeemerOutputScript": "0x00140000000000000000000000000000000000000001", | ||
"RequestedAmount": 1000000000, | ||
"Age": 3000, | ||
"Delay": 0 | ||
}, | ||
{ | ||
"WalletPublicKeyHash": "0x928d992e5f5b71de51a1b40fcc4056b99a88a647", | ||
"RedeemerOutputScript": "0x00140000000000000000000000000000000000000002", | ||
"RequestedAmount": 2000000000, | ||
"Age": 4000, | ||
"Delay": 0 | ||
}, | ||
{ | ||
"WalletPublicKeyHash": "0x928d992e5f5b71de51a1b40fcc4056b99a88a647", | ||
"RedeemerOutputScript": "0x00140000000000000000000000000000000000000003", | ||
"RequestedAmount": 3000000000, | ||
"Age": 4000, | ||
"Delay": 7200 | ||
}, | ||
{ | ||
"WalletPublicKeyHash": "0x928d992e5f5b71de51a1b40fcc4056b99a88a647", | ||
"RedeemerOutputScript": "0x00140000000000000000000000000000000000000004", | ||
"RequestedAmount": 4000000000, | ||
"Age": 8000, | ||
"Delay": 7200 | ||
}, | ||
{ | ||
"WalletPublicKeyHash": "0x928d992e5f5b71de51a1b40fcc4056b99a88a647", | ||
"RedeemerOutputScript": "0x00140000000000000000000000000000000000000005", | ||
"RequestedAmount": 5000000000, | ||
"Age": 8000, | ||
"Delay": 14400 | ||
}, | ||
{ | ||
"WalletPublicKeyHash": "0x928d992e5f5b71de51a1b40fcc4056b99a88a647", | ||
"RedeemerOutputScript": "0x00140000000000000000000000000000000000000006", | ||
"RequestedAmount": 6000000000, | ||
"Age": 15000, | ||
"Delay": 14400 | ||
} | ||
], | ||
"ExpectedRedeemersOutputScripts": [ | ||
"0x00140000000000000000000000000000000000000006", | ||
"0x00140000000000000000000000000000000000000004", | ||
"0x00140000000000000000000000000000000000000002" | ||
] | ||
} |
This file contains 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
This file contains 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