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

clboss does not handle addresses of type dns #257

Open
tsjk opened this issue Jan 7, 2025 · 1 comment
Open

clboss does not handle addresses of type dns #257

tsjk opened this issue Jan 7, 2025 · 1 comment

Comments

@tsjk
Copy link

tsjk commented Jan 7, 2025

The following is from clboss b6795c4 running on Core Lightning v24.11.1, on signet.
clboss wanted to open a channel to a node that only has an address of type dns:

[core-lightning] | 2025-01-06T13:38:21.630Z INFO    plugin-clboss: New block at 229676
[core-lightning] | 2025-01-06T13:38:21.633Z INFO    plugin-clboss: ChannelCreationDecider: High fees, but 100% of our funds are onchain, which is above our limit of 25%.Will create channels worth 2000160090000msat (99000000msat reserved for onchain actions).
[core-lightning] | 2025-01-06T13:38:21.664Z **BROKEN** plugin-clboss: ChannelCreator: Unexpected result from listnodes: {\"nodes\":[{\"nodeid\":\"0271cf3881e6eadad960f47125434342e57e65b98a78afa99f9b4191c02dd7ab3b\",\"alias\":\"eclair@wakiyamap\",\"color\":\"49daaa\",\"last_timestamp\":1710038347,\"features\":\"a080288a5941\",\"addresses\":[{\"type\":\"dns\",\"address\":\"signet-eclair.wakiyamap.dev\",\"port\":9735}]}]}

The pretty-print of the json is:

{
  "nodes": [
    {
      "nodeid": "0271cf3881e6eadad960f47125434342e57e65b98a78afa99f9b4191c02dd7ab3b",
      "alias": "eclair@wakiyamap",
      "color": "49daaa",
      "last_timestamp": 1710038347,
      "features": "a080288a5941",
      "addresses": [
        {
          "type": "dns",
          "address": "signet-eclair.wakiyamap.dev",
          "port": 9735
        }
      ]
    }
  ]
}

The message seems to come from

Manager::get_node_addr(Ln::NodeId n) {
assert(rpc);
return Ev::lift().then([this, n]() {
return rpc->command("listnodes"
, Json::Out()
.start_object()
.field("id", std::string(n))
.end_object()
);
}).then([this](Jsmn::Object res) {
auto rv = Net::IPAddrOrOnion();
try {
auto nodes = res["nodes"];
/* Node not known? */
if (nodes.length() == 0)
return Ev::lift(std::unique_ptr<Net::IPAddrOrOnion>());
auto node = nodes[0];
auto addrs = node["addresses"];
/* No addresses known for node? */
if (addrs.length() == 0)
return Ev::lift(std::unique_ptr<Net::IPAddrOrOnion>());
/* Report first address. */
auto addr_j = addrs[0];
auto addr_s = std::string(addr_j["address"]);
rv = Net::IPAddrOrOnion(addr_s);
} catch (...) {
return Boss::log( bus, Error
, "ChannelCreator: Unexpected result from "
"listnodes: %s"
, res.direct_text().c_str()
).then([]() {
return Ev::lift(std::unique_ptr<Net::IPAddrOrOnion>());
});
}
return Ev::lift(Util::make_unique<Net::IPAddrOrOnion>(std::move(rv)));
});
}
and is likely because the only type of address available here is of type dns.
clboss then crashed due to

[core-lightning] | clboss: Boss/Mod/ChannelCreator/Planner.cpp:55: Boss::Mod::ChannelCreator::Planner::Impl::Impl(Boss::Mod::ChannelCreator::Planner::DowserFunc, Ln::Amount, std::vector<std::pair<Ln::NodeId, Ln::NodeId> >, std::size_t, Ln::Amount, Ln::Amount, Ln::Amount): Assertion `min_amount + min_remaining <= max_amount' failed.

but this is another issue. It remains to be seen whether the brokenness due to the unexpected result from listnodes influences channel creation when the assertion does not fail.

@tsjk
Copy link
Author

tsjk commented Jan 8, 2025

It does influence it by such nodes being excluded. clboss created channels to other nodes later on.

2025-01-07T22:08:00.321Z INFO    plugin-clboss: New block at 229865
2025-01-07T22:08:00.325Z INFO    plugin-clboss: ChannelCreationDecider: High fees, but 100% of our funds are onchain, which is above our limit of 25%. Will create channels worth 25156303000msat (99000000msat reserved for onchain actions).
2025-01-07T22:08:00.356Z **BROKEN** plugin-clboss: ChannelCreator: Unexpected result from listnodes: {\"nodes\":[{\"nodeid\":\"0271cf3881e6eadad960f47125434342e57e65b98a78afa99f9b4191c02dd7ab3b\",\"alias\":\"eclair@wakiyamap\",\"color\":\"49daaa\",\"last_timestamp\":1710038347,\"features\":\"a080288a5941\",\"addresses\":[{\"type\":\"dns\",\"address\":\"signet-eclair.wakiyamap.dev\",\"port\":9735}]}]}
2025-01-07T22:08:00.370Z INFO    plugin-clboss: ChannelCreator: 025196512905b8a3f1597428b867bec63ec9a95e5089eb7dc7e63e2d2691669029: 12578151500msat, 0307238136c48cd35084c4efadc486143a7e8a7acd8ff8ac053fdab4efabc551c4: 12578151500msat
2025-01-07T22:08:07.396Z UNUSUAL 025196512905b8a3f1597428b867bec63ec9a95e5089eb7dc7e63e2d2691669029-chan#1: Ignoring fee limits!
2025-01-07T22:08:07.414Z INFO    plugin-chanbackup: Updating the SCB
2025-01-07T22:08:07.851Z UNUSUAL 0307238136c48cd35084c4efadc486143a7e8a7acd8ff8ac053fdab4efabc551c4-chan#2: Ignoring fee limits!
2025-01-07T22:08:07.872Z INFO    plugin-chanbackup: Updating the SCB
2025-01-07T22:08:07.999Z INFO    plugin-clboss: ChannelCreator: Created: 025196512905b8a3f1597428b867bec63ec9a95e5089eb7dc7e63e2d2691669029: 12578151000msat, 0307238136c48cd35084c4efadc486143a7e8a7acd8ff8ac053fdab4efabc551c4: 12578151000msat
2025-01-07T22:08:08.013Z INFO    plugin-clboss: ChannelCreation: 025196512905b8a3f1597428b867bec63ec9a95e5089eb7dc7e63e2d2691669029
2025-01-07T22:08:08.019Z INFO    plugin-clboss: ChannelCreation: 0307238136c48cd35084c4efadc486143a7e8a7acd8ff8ac053fdab4efabc551c4

...

2025-01-07T22:20:02.358Z INFO    025196512905b8a3f1597428b867bec63ec9a95e5089eb7dc7e63e2d2691669029-chan#1: State changed from CHANNELD_AWAITING_LOCKIN to CHANNELD_NORMAL
2025-01-07T22:20:07.778Z INFO    0307238136c48cd35084c4efadc486143a7e8a7acd8ff8ac053fdab4efabc551c4-chan#2: State changed from CHANNELD_AWAITING_LOCKIN to CHANNELD_NORMAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant