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

add max_total_htlc_out to listpeerchannels #8084

Merged
merged 6 commits into from
Feb 21, 2025

Conversation

rustyrussell
Copy link
Contributor

This was #7193 but I closed that by accident.

@rustyrussell rustyrussell added this to the v25.02 milestone Feb 12, 2025
@rustyrussell rustyrussell force-pushed the guilt/pr-7193 branch 2 times, most recently from 7f6a22d to 9330714 Compare February 13, 2025 04:00
@rustyrussell
Copy link
Contributor Author

Gah, this requires more work. I will rebase on #8089 once that is merged!

@rustyrussell rustyrussell force-pushed the guilt/pr-7193 branch 2 times, most recently from bca0265 to 391119d Compare February 16, 2025 23:19
@rustyrussell rustyrussell force-pushed the guilt/pr-7193 branch 2 times, most recently from 4b10c23 to 0ed14c3 Compare February 20, 2025 04:17
@endothermicdev
Copy link
Collaborator

test_sql needs to be updated. The deprecated field is still in the table when we check here:

       for table, schema in expected_schemas.items():
            res = only_one(l2.rpc.listsqlschemas(table)['schemas'])
            assert res['tablename'] == table
            assert res.get('indices') == schema.get('indices')
            sqlcolumns = [{'name': c['name'], 'type': sqltypemap[c['type']]} for c in [rowidcol] + schema['columns']]
            assert res['columns'] == sqlcolumns

But then we later query against all these fields, which isn't allowed for deprecated columns(Deprecated column table peerchannels... error). I'm not sure the correct way to resolve this, but I have a commit that hopefully captures the problem at least.

Otherwise, deprecating a field causes SELECT * to fail:

```
>       l1.rpc.sql(f"SELECT * FROM peerchannels;")
...
>           raise RpcError(method, payload, resp['error'])
E           pyln.client.lightning.RpcError: RPC call failed: method: sql, payload: ('SELECT * FROM peerchannels;',), error: {'code': -1, 'message': 'query failed with access to peerchannels.max_total_htlc_in_msat is prohibited (Deprecated column table peerchannels.max_total_htlc_in_msat)'}
```

So if they use a wildcard, allow access: though "SELECT *" is fraught,
"COUNT(*)" is perfectly legit.

Signed-off-by: Rusty Russell <[email protected]>
@rustyrussell rustyrussell force-pushed the guilt/pr-7193 branch 3 times, most recently from db089e7 to 4b81a5c Compare February 21, 2025 04:06
Lagrang3 and others added 4 commits February 21, 2025 15:05
Changelog-Added: JSON-RPC: `listpeerchannels` new output fields `their_max_total_htlc_out_msat` and `our_max_total_htlc_out_msat` as the value of `max_htlc_value_in_flight` (as of BOLT02) set by the local and remote nodes on channel creation.

Changelog-Deprecated: JSON-RPC: `listpeerchannels` value `max_total_htlc_in_msat`: use `our_max_total_htlc_out_msat` instead to follow spec naming convention.
The parameter max_htlc_value_in_flight_msat stablished by peers on
channel opening (BOLT02) can now be retrived from the
gossmods_from_listpeerchannels API.

Adapted the corresponding callback functions in renepay and askrene to
take into account that value as a constraint to the value we can send
through a channel.

Changelog-Add: fetch max_htlc_value_in_flight_msat from gossmods_listpeerchannels API

Signed-off-by: Lagrang3 <[email protected]>
with fixed our/their_max_htlc_value_in_flight_msat values

suggested by @ShahanaFarooqui
Copy link
Collaborator

@endothermicdev endothermicdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 986245f

@endothermicdev endothermicdev merged commit 5b83eff into ElementsProject:master Feb 21, 2025
40 checks passed
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

Successfully merging this pull request may close these issues.

3 participants