multi: increase min cltv delta to 24
This commit is contained in:
1 parent
4bce4ebe03
commit
3fb59b1b6b
7 files changed
+13
-13
No files matched your search
@@ -295,7 +295,7 @@ func testUpdateChannelPolicy(ht *lntest.HarnessTest) {
|
|||||||
// propagated.
|
// propagated.
|
||||||
baseFee = int64(800)
|
baseFee = int64(800)
|
||||||
feeRate = int64(123)
|
feeRate = int64(123)
|
||||||
timeLockDelta = uint32(22)
|
timeLockDelta = uint32(24)
|
||||||
maxHtlc *= 2
|
maxHtlc *= 2
|
||||||
inboundBaseFee := int32(-400)
|
inboundBaseFee := int32(-400)
|
||||||
inboundFeeRatePpm := int32(-60)
|
inboundFeeRatePpm := int32(-60)
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
finalCltvDelta = routing.MinCLTVDelta // 18.
|
finalCltvDelta = routing.MinCLTVDelta // 24.
|
||||||
thawHeightDelta = finalCltvDelta * 2 // 36.
|
thawHeightDelta = finalCltvDelta * 2 // 48.
|
||||||
)
|
)
|
||||||
|
|
||||||
// makeRouteHints creates a route hints that will allow Carol to be reached
|
// makeRouteHints creates a route hints that will allow Carol to be reached
|
||||||
|
|||||||
@@ -352,7 +352,7 @@ func (b *blindedForwardTest) setupNetwork(ctx context.Context,
|
|||||||
withInterceptor bool) {
|
withInterceptor bool) {
|
||||||
|
|
||||||
carolArgs := []string{
|
carolArgs := []string{
|
||||||
"--bitcoin.timelockdelta=18",
|
"--bitcoin.timelockdelta=24",
|
||||||
fmt.Sprintf("--bitcoin.defaultremotedelay=%v", toLocalCSV),
|
fmt.Sprintf("--bitcoin.defaultremotedelay=%v", toLocalCSV),
|
||||||
}
|
}
|
||||||
if withInterceptor {
|
if withInterceptor {
|
||||||
@@ -360,7 +360,7 @@ func (b *blindedForwardTest) setupNetwork(ctx context.Context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
daveArgs := []string{
|
daveArgs := []string{
|
||||||
"--bitcoin.timelockdelta=18",
|
"--bitcoin.timelockdelta=24",
|
||||||
fmt.Sprintf("--bitcoin.defaultremotedelay=%v", toLocalCSV),
|
fmt.Sprintf("--bitcoin.defaultremotedelay=%v", toLocalCSV),
|
||||||
}
|
}
|
||||||
cfgs := [][]string{nil, nil, carolArgs, daveArgs}
|
cfgs := [][]string{nil, nil, carolArgs, daveArgs}
|
||||||
|
|||||||
@@ -879,7 +879,7 @@ func testSweepHTLCs(ht *lntest.HarnessTest) {
|
|||||||
// Before we mine empty blocks to check the RBF behavior, we need to be
|
// Before we mine empty blocks to check the RBF behavior, we need to be
|
||||||
// aware that Bob's incoming HTLC will expire before his outgoing HTLC
|
// aware that Bob's incoming HTLC will expire before his outgoing HTLC
|
||||||
// deadline is reached. This happens because the incoming HTLC is sent
|
// deadline is reached. This happens because the incoming HTLC is sent
|
||||||
// onchain at CLTVDelta-BroadcastDelta=18-10=8, which means after 8
|
// onchain at CLTVDelta-BroadcastDelta=24-16=8, which means after 8
|
||||||
// blocks are mined, we expect Bob force closes the channel Alice->Bob.
|
// blocks are mined, we expect Bob force closes the channel Alice->Bob.
|
||||||
blocksTillIncomingSweep := cltvDelta -
|
blocksTillIncomingSweep := cltvDelta -
|
||||||
lncfg.DefaultIncomingBroadcastDelta
|
lncfg.DefaultIncomingBroadcastDelta
|
||||||
|
|||||||
+5
-5
@@ -54,15 +54,15 @@ const (
|
|||||||
// mining blocks.
|
// mining blocks.
|
||||||
maxBlocksAllowed = 100
|
maxBlocksAllowed = 100
|
||||||
|
|
||||||
finalCltvDelta = routing.MinCLTVDelta // 18.
|
finalCltvDelta = routing.MinCLTVDelta // 24.
|
||||||
thawHeightDelta = finalCltvDelta * 2 // 36.
|
thawHeightDelta = finalCltvDelta * 2 // 48.
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// MaxBlocksMinedPerTest is the maximum number of blocks that we allow
|
// MaxBlocksMinedPerTest is the maximum number of blocks that we allow
|
||||||
// a test to mine. This is an exported global variable so it can be
|
// a test to mine. This is an exported global variable so it can be
|
||||||
// overwritten by other projects that don't have the same constraints.
|
// overwritten by other projects that don't have the same constraints.
|
||||||
MaxBlocksMinedPerTest = 50
|
MaxBlocksMinedPerTest = 70
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestCase defines a test case that's been used in the integration test.
|
// TestCase defines a test case that's been used in the integration test.
|
||||||
@@ -409,13 +409,13 @@ func (h *HarnessTest) checkAndLimitBlocksMined(startHeight int32) {
|
|||||||
desc += "1. break test into smaller individual tests, especially if " +
|
desc += "1. break test into smaller individual tests, especially if " +
|
||||||
"this is a table-drive test.\n" +
|
"this is a table-drive test.\n" +
|
||||||
"2. use smaller CSV via `--bitcoin.defaultremotedelay=1.`\n" +
|
"2. use smaller CSV via `--bitcoin.defaultremotedelay=1.`\n" +
|
||||||
"3. use smaller CLTV via `--bitcoin.timelockdelta=18.`\n" +
|
"3. use smaller CLTV via `--bitcoin.timelockdelta=24.`\n" +
|
||||||
"4. remove unnecessary CloseChannel when test ends.\n" +
|
"4. remove unnecessary CloseChannel when test ends.\n" +
|
||||||
"5. use `CreateSimpleNetwork` for efficient channel creation.\n"
|
"5. use `CreateSimpleNetwork` for efficient channel creation.\n"
|
||||||
h.Log(desc)
|
h.Log(desc)
|
||||||
|
|
||||||
// We enforce that the test should not mine more than
|
// We enforce that the test should not mine more than
|
||||||
// MaxBlocksMinedPerTest (50 by default) blocks, which is more than
|
// MaxBlocksMinedPerTest (70 by default) blocks, which is more than
|
||||||
// enough to test a multi hop force close scenario.
|
// enough to test a multi hop force close scenario.
|
||||||
require.LessOrEqualf(
|
require.LessOrEqualf(
|
||||||
h, int(blocksMined), MaxBlocksMinedPerTest,
|
h, int(blocksMined), MaxBlocksMinedPerTest,
|
||||||
|
|||||||
+1
-1
@@ -1878,7 +1878,7 @@
|
|||||||
; DefaultIncomingBroadcastDelta set by lnd, otherwise the channel will be force
|
; DefaultIncomingBroadcastDelta set by lnd, otherwise the channel will be force
|
||||||
; closed anyway. A warning will be logged on startup if this value is not large
|
; closed anyway. A warning will be logged on startup if this value is not large
|
||||||
; enough to prevent force closes.
|
; enough to prevent force closes.
|
||||||
; invoices.holdexpirydelta=12
|
; invoices.holdexpirydelta=18
|
||||||
|
|
||||||
[routing]
|
[routing]
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ const (
|
|||||||
// We adhere to the recommendation in BOLT 02 for terminal payments.
|
// We adhere to the recommendation in BOLT 02 for terminal payments.
|
||||||
// See also:
|
// See also:
|
||||||
// https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
|
// https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
|
||||||
DefaultAssumedFinalCLTVDelta = 18
|
DefaultAssumedFinalCLTVDelta = 24
|
||||||
|
|
||||||
// feeRateParts is the total number of parts used to express fee rates.
|
// feeRateParts is the total number of parts used to express fee rates.
|
||||||
feeRateParts = 1e6
|
feeRateParts = 1e6
|
||||||
|
|||||||
Reference in new issue
Block a user