-
Notifications
You must be signed in to change notification settings - Fork 210
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
fix: exclude config from default output in gateway-cli info rpc #5070
base: master
Are you sure you want to change the base?
Conversation
45edd3e
to
7981b97
Compare
This will unfortunately break backwards compatibility. To maintain backwards compatibility, you will need to change the The devimint tests will need to be updated. Then after a major release, we can invert the flag (or remove it entirely) so that its excluded by default. |
@m1sterc001guy, done. I updated the flag from |
We need to get to the bottom of the backwards compatibility failures. Is there a default value for |
BTW. Probably good idea to make this controlled via env var (optionally), so in scritpts and for backward compat it can be set once for all invocations. |
Old clients won't send the exclude flag, so new servers need a default. New clients may send the exclude flag, but old servers should ignore it due to JSON. |
e6f55d3
to
9fef138
Compare
9fef138
to
e27f447
Compare
The exclude_config parameter now defaults to true and is optional. However, the backward compatibility job is still failing. I'm not sure if this is related or not |
Try rebasing and let's re-run the tests and see if it is still broken |
710c754
to
c8cff66
Compare
@m1sterc001guy Done |
gateway/cli/src/main.rs
Outdated
@@ -155,6 +163,9 @@ pub enum LightningCommands { | |||
/// The delay between retries | |||
#[clap(long)] | |||
retry_delay_seconds: Option<u64>, | |||
|
|||
#[clap(long)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can use default_value
in clap
gateway/cli/src/main.rs
Outdated
@@ -324,7 +350,9 @@ async fn main() -> anyhow::Result<()> { | |||
block_height, | |||
max_retries, | |||
retry_delay_seconds, | |||
exclude_config, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're just throwing away the config below anyway since the only field that is used is block_height
, so this doesn't need to be a parameter. Just set it to true in the actual get_info
RPC
gateway/ln-gateway/src/rpc/mod.rs
Outdated
@@ -65,7 +68,8 @@ pub struct WithdrawPayload { | |||
pub struct FederationInfo { | |||
pub federation_id: FederationId, | |||
pub balance_msat: Amount, | |||
pub config: ClientConfig, | |||
#[serde(skip_serializing_if = "Option::is_none")] // Skip serializing if config is None | |||
pub config: Option<ClientConfig>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm so the backwards compatibility tests might be failing because this changed from ClientConfig
to Option<ClientConfig>
(havent confirmed myself yet).
I don't think changing this is actually necessary. The main issue with the ClientConfig
is just that it clutters up the CLI response. I think we should still return ClientConfig
on the get_info
requests, but on the CLI just filter out the config according to the exclude_config
flag. This will make it so the CLI is more readable but also keep the change simple on the API/server side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh perfect, sounds like a straightforward solution then. We will just update one file.
I've made the changes and updated the PR. Can you please review it again and run the jobs to check if the backward compatibility issue still occurs?
refactor: Simplify payload structure in integration tests (redundant fieldname) fix: change flag from include-config to exclude-config to prevent backward compatibility erros fix: fix backward compatibility issue fix: Trigger CI fix: exclude config from default output in gateway-cli info rpc fix: exclude config from default output in gateway-cli info rpc
c8cff66
to
a37f2a8
Compare
Somewhere in the tests we assume that the config field is present, needs to be changed for this PR. https://github.com/fedimint/fedimint/actions/runs/9142510136/job/25229423380?pr=5070#step:9:250 |
This PR addresses the feedback from issue #4365 by modifying the
gateway-cli info
command to exclude theconfig
section from the default output.Changes:
--include-config