Skip to content
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

Extended queries optional #899

Merged
merged 111 commits into from
Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from 103 commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
6e2d30f
Add extended query messages
sstone Sep 10, 2018
14e7255
Add a feature bit for extended channel range queries
sstone Sep 11, 2018
90a0393
Merge branch 'master' into wip-channel-update-queries
sstone Sep 14, 2018
ada3bbb
Peer connection: let users specify a custom init message
sstone Sep 14, 2018
6cedaeb
Correctly handle multiple channel_range_replies
sstone Sep 16, 2018
1f9025f
Merge branch 'fix-channel-queries-sync' into wip-channel-update-queries
sstone Sep 16, 2018
b5f53ce
RoutingSync: remove peer entry properly
sstone Sep 17, 2018
03c45bb
Routing Sync: rename Sync.count to Sync.totalMissingCount
sstone Sep 17, 2018
5a4b554
Merge branch 'fix-channel-queries-sync' into wip-channel-update-queries
sstone Sep 17, 2018
837dd97
Merge branch 'master' into wip-channel-update-queries
sstone Sep 17, 2018
338cf7d
Merge branch 'master' into wip-channel-update-queries
sstone Sep 17, 2018
0da9136
Do not send channel queries if we don't want to sync
sstone Sep 18, 2018
f7b3409
Router: clean our sync state when we (re)connect to a peer
sstone Sep 19, 2018
e740523
Router: fix syncing of outdated channels
sstone Sep 19, 2018
19f0c81
Routing: don't request their channel ids if we don't want a routing t…
sstone Sep 19, 2018
ebcd58c
Router: fix indentation
sstone Sep 19, 2018
c345b2f
Router: reset sync state on reconnection
sstone Sep 19, 2018
830f963
Revert "Routing: don't request their channel ids if we don't want a r…
sstone Sep 19, 2018
668f172
Merge branch 'routing-sync-fixes' into wip-channel-update-queries
sstone Sep 19, 2018
3e47d5f
Merge branch 'master' into wip-channel-update-queries
sstone Sep 19, 2018
28383fa
Merge branch 'master' into wip-channel-update-queries
sstone Sep 20, 2018
da012f9
add extended query flag to our log message
sstone Sep 21, 2018
2744613
Merge branch 'master' into wip-channel-update-queries
sstone Sep 24, 2018
e70043d
Merge branch 'master' into wip-channel-update-queries
sstone Oct 11, 2018
71a4542
Merge branch 'master' into wip-channel-update-queries
pm47 Oct 18, 2018
da25696
Merge branch 'master' into wip-channel-update-queries
sstone Oct 23, 2018
eb44823
Router: implement new extended queries
sstone Oct 26, 2018
f22728c
Merge branch 'master' into wip-channel-update-queries
sstone Oct 26, 2018
4f513c4
Extended channel queries: refactor handlers, add more tests
sstone Oct 29, 2018
7e74e14
Merge branch 'master' into wip-channel-update-queries
pm47 Nov 20, 2018
7367313
Merge branch 'master' into wip-channel-update-queries
sstone Dec 2, 2018
a263200
Extended channel queries: clean up
sstone Dec 2, 2018
cbb951c
Merge branch 'master' into wip-channel-update-queries
pm47 Dec 13, 2018
515461f
Merge branch 'master' into wip-channel-update-queries
pm47 Jan 10, 2019
9e9c3c8
Merge branch 'master' into wip-channel-update-queries
pm47 Jan 11, 2019
22455c0
Merge branch 'master' into wip-channel-update-queries
pm47 Jan 14, 2019
aa6c930
Merge branch 'master' into wip-channel-update-queries
sstone Jan 16, 2019
e17ef25
added checksum prototype
pm47 Jan 20, 2019
928d165
major refactoring
pm47 Jan 21, 2019
5ffabe9
enable extended queries in flags
pm47 Jan 21, 2019
a16d3d7
only send updates if explicitely asked
pm47 Jan 21, 2019
6a41ce5
Merge branch 'master' into wip-channel-update-queries-pm
pm47 Jan 21, 2019
430823a
always return channel+updates in deprecated mode
pm47 Jan 21, 2019
fdbaf5d
fixed QueryChannelRange handler
pm47 Jan 21, 2019
21359e2
fixed sync progress calculation
pm47 Jan 21, 2019
919bad7
set feature bits 22/23 for extended channel queries
pm47 Jan 22, 2019
27c21a9
better logs + refactoring
pm47 Jan 22, 2019
3ba1f15
removed temporary test
pm47 Jan 22, 2019
428fd0a
fixed sync count
pm47 Jan 22, 2019
366507e
fixed numBlocks calculation
pm47 Jan 22, 2019
7685c7d
don't request stale channel_updates
pm47 Jan 23, 2019
0d9f285
cleaned function signature (removed unused args)
pm47 Jan 29, 2019
de866e2
fixed sync progress calculation
pm47 Jan 29, 2019
c04af36
Merge branch 'master' into wip-channel-update-queries-pm
pm47 Feb 6, 2019
304f12d
Merge branch 'master' into extended-queries-optional
pm47 Mar 10, 2019
c068b93
wip (tests not passing)
pm47 Mar 10, 2019
deb0708
fixed tests
pm47 Mar 11, 2019
7d72600
formatting
pm47 Mar 11, 2019
d3a1d19
fixed `QueryFlagTypes`
pm47 Mar 11, 2019
81023a2
rework feature bits
pm47 Mar 11, 2019
564c1c5
send extended queries if available
pm47 Mar 11, 2019
5bbbebb
better logs
pm47 Mar 11, 2019
7b40799
typed EncodingType
pm47 Mar 12, 2019
4ba355e
removed extended feature bit
pm47 Mar 12, 2019
4a2eb07
Merge branch 'master' into extended-queries-optional
pm47 Mar 14, 2019
7a6acd9
Merge branch 'master' into extended-queries-optional
pm47 Mar 15, 2019
94711a8
added test vectors
pm47 Mar 19, 2019
149deb7
Merge branch 'master' into extended-queries-optional
pm47 Mar 19, 2019
a18ec55
ignore fake test vector test
pm47 Mar 19, 2019
f2a18be
added tests on query flags
pm47 Mar 19, 2019
79d9aa0
Merge branch 'master' into extended-queries-optional
pm47 Mar 21, 2019
9ebfb5f
Merge branch 'master' into extended-queries-optional
pm47 Mar 25, 2019
0ace8da
fixed and improved tests
pm47 Mar 26, 2019
faa9a8c
tweak test
pm47 Mar 26, 2019
b488701
Merge branch 'master' into extended-queries-optional
pm47 Mar 26, 2019
ffa6183
Merge branch 'master' into extended-queries-optional
pm47 Apr 17, 2019
96e1c87
Merge branch 'master' into extended-queries-optional
pm47 Apr 24, 2019
3cf840e
Merge branch 'master' into extended-queries-optional
pm47 Apr 26, 2019
b282581
Merge branch 'master' into extended-queries-optional
pm47 May 9, 2019
640144b
Merge branch 'master' into extended-queries-optional
pm47 May 14, 2019
c97cfc5
Merge branch 'master' into extended-queries-optional
pm47 Jun 4, 2019
ddcf2d4
Merge branch 'master' into extended-queries-optional
pm47 Jun 14, 2019
3033696
fixed ddcf2d418732e4023fbec4875d9e00b2c3382ec3
pm47 Jun 14, 2019
5a1a58a
Merge branch 'master' into extended-queries-optional
pm47 Jul 3, 2019
1240166
Merge branch 'master' into extended-queries-optional
pm47 Jul 10, 2019
c4eb812
Merge branch 'master' into extended-queries-optional
pm47 Jul 16, 2019
3db77b4
Merge branch 'master' into extended-queries-optional
sstone Jul 29, 2019
a60048d
Update list of commands in eclair-cli help (#1091)
araspitzu Jul 29, 2019
7582402
Documentation update (#1092)
t-bast Jul 31, 2019
f53b770
Typed amounts (#1088)
araspitzu Aug 7, 2019
8be2227
Merge branch 'master' into extended-queries-optional
pm47 Aug 13, 2019
d321a21
Merge branch 'master' into extended-queries-optional
sstone Aug 22, 2019
0780fc2
Extended Queries: use TLV format for optional data (#1072)
sstone Aug 22, 2019
92d9f2a
Channel range queries: send back node announcements (#1108)
sstone Aug 26, 2019
c8b41c9
better naming
pm47 Aug 26, 2019
d404e5d
Router: fix tests and rework computeFlags
sstone Aug 26, 2019
9947887
Router: better naming
sstone Aug 26, 2019
e43d884
Merge branch 'master' into extended-queries-optional
sstone Aug 26, 2019
ea11036
Update comment [skip ci]
sstone Aug 26, 2019
217a8f7
Router: format code
sstone Aug 27, 2019
5d070d3
Include chain hash in ChannelUpdate checksum
sstone Aug 27, 2019
d3f283d
Extended Channel Queries: add CL interop test
sstone Aug 27, 2019
b937ac7
Channel Queries: update test checksums
sstone Aug 27, 2019
57abd93
minor log update
pm47 Aug 28, 2019
b2b1506
made encoding type configurable
pm47 Aug 28, 2019
bd86b06
renamed updateSync -> addToSync
pm47 Aug 28, 2019
361460d
added rationale for split size
pm47 Aug 28, 2019
69f2048
fixed tests
pm47 Aug 28, 2019
fd3682d
do nonreg on our own test vectors
pm47 Aug 28, 2019
cd90287
increased test timeout
pm47 Aug 28, 2019
310b9ba
inceased more timeouts
pm47 Aug 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eclair-core/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ eclair {
channel-exclude-duration = 60 seconds // when a temporary channel failure is returned, we exclude the channel from our payment routes for this duration
broadcast-interval = 60 seconds // see BOLT #7
init-timeout = 5 minutes
request-node-announcements = true // if true we will ask for node announcements when we receive channel ids that we don't know

// the values below will be used to perform route searching
path-finding {
Expand Down
9 changes: 7 additions & 2 deletions eclair-core/src/main/scala/fr/acinq/eclair/NodeParams.scala
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ case class NodeParams(keyManager: KeyManager,
routerConf: RouterConf,
socksProxy_opt: Option[Socks5ProxyParams],
maxPaymentAttempts: Int) {

val privateKey = keyManager.nodeKey.privateKey
val nodeId = keyManager.nodeId
}
Expand Down Expand Up @@ -187,6 +186,11 @@ object NodeParams {
claimMainBlockTarget = config.getInt("on-chain-fees.target-blocks.claim-main")
)

val feeBase = MilliSatoshi(config.getInt("fee-base-msat"))
// fee base is in msat but is encoded on 32 bits and not 64 in the BOLTs, which is why it has
// to be below 0x100000000 msat which is about 42 mbtc
require(feeBase <= MilliSatoshi(0xFFFFFFFFL), "fee-base-msat must be below 42 mbtc")

NodeParams(
keyManager = keyManager,
alias = nodeAlias,
Expand All @@ -210,7 +214,7 @@ object NodeParams {
toRemoteDelayBlocks = CltvExpiryDelta(config.getInt("to-remote-delay-blocks")),
maxToLocalDelayBlocks = CltvExpiryDelta(config.getInt("max-to-local-delay-blocks")),
minDepthBlocks = config.getInt("mindepth-blocks"),
feeBase = MilliSatoshi(config.getInt("fee-base-msat")),
feeBase = feeBase,
feeProportionalMillionth = config.getInt("fee-proportional-millionths"),
reserveToFundingRatio = config.getDouble("reserve-to-funding-ratio"),
maxReserveToFundingRatio = config.getDouble("max-reserve-to-funding-ratio"),
Expand All @@ -231,6 +235,7 @@ object NodeParams {
channelExcludeDuration = FiniteDuration(config.getDuration("router.channel-exclude-duration").getSeconds, TimeUnit.SECONDS),
routerBroadcastInterval = FiniteDuration(config.getDuration("router.broadcast-interval").getSeconds, TimeUnit.SECONDS),
randomizeRouteSelection = config.getBoolean("router.randomize-route-selection"),
requestNodeAnnouncements = config.getBoolean("router.request-node-announcements"),
searchMaxRouteLength = config.getInt("router.path-finding.max-route-length"),
searchMaxCltv = CltvExpiryDelta(config.getInt("router.path-finding.max-cltv")),
searchMaxFeeBase = Satoshi(config.getLong("router.path-finding.fee-threshold-sat")),
Expand Down
15 changes: 11 additions & 4 deletions eclair-core/src/main/scala/fr/acinq/eclair/io/Peer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ import akka.event.Logging.MDC
import akka.util.Timeout
import com.google.common.net.HostAndPort
import fr.acinq.bitcoin.Crypto.PublicKey
import fr.acinq.bitcoin.{ByteVector32, DeterministicWallet, Protocol, Satoshi}
import fr.acinq.eclair
import fr.acinq.bitcoin.{Block, ByteVector32, DeterministicWallet, Protocol, Satoshi}
import fr.acinq.eclair.blockchain.EclairWallet
import fr.acinq.eclair.channel._
import fr.acinq.eclair.crypto.TransportHandler
Expand Down Expand Up @@ -145,15 +144,23 @@ class Peer(val nodeParams: NodeParams, remoteNodeId: PublicKey, authenticator: A
if (remoteHasInitialRoutingSync) {
if (remoteHasChannelRangeQueriesOptional || remoteHasChannelRangeQueriesMandatory) {
// if they support channel queries we do nothing, they will send us their filters
log.info("{} has set initial routing sync and support channel range queries, we do nothing (they will send us a query)", remoteNodeId)
log.info("{} has set initial routing sync and supports channel range queries, we do nothing (they will send us a query)", remoteNodeId)
} else {
// "old" nodes, do as before
log.info("peer requested a full routing table dump")
router ! GetRoutingState
}
}
if (remoteHasChannelRangeQueriesOptional || remoteHasChannelRangeQueriesMandatory) {
// if they support channel queries, always ask for their filter
router ! SendChannelQuery(remoteNodeId, d.transport)
// README: for now we do not activate extended queries on mainnet
val flags_opt = nodeParams.chainHash match {
case Block.RegtestGenesisBlock.hash | Block.TestnetGenesisBlock.hash =>
log.info("using extended range queries")
Some(QueryChannelRangeTlv.QueryFlags(QueryChannelRangeTlv.QueryFlags.WANT_ALL))
case _ => None
}
router ! SendChannelQuery(remoteNodeId, d.transport, flags_opt = flags_opt)
}

// let's bring existing/requested channels online
Expand Down

This file was deleted.

Loading