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

JDC is not logging any error on wrong TP configuration #863

Closed
GitGab19 opened this issue Apr 19, 2024 · 12 comments · Fixed by #987
Closed

JDC is not logging any error on wrong TP configuration #863

GitGab19 opened this issue Apr 19, 2024 · 12 comments · Fixed by #987
Assignees
Labels
bug Something isn't working good first issue Good for newcomers job-declarator-client
Milestone

Comments

@GitGab19
Copy link
Collaborator

JDC is not generating errors when a wrong TP configuration is used.
To reproduce it, you can simply change the port number randomly in tp_address parameter, and run it.
A discussion about this here: https://discord.com/channels/950687892169195530/1012371967992672321/1229368703737663508

@Sjors
Copy link
Collaborator

Sjors commented Apr 30, 2024

Worse, it's not logging any config error (it took me half an hour to realise I had to rename authority_public_key to authority_pubkey).

It does log when the config file doesn't exist.

@GitGab19
Copy link
Collaborator Author

GitGab19 commented May 6, 2024

I would label this as a good-first-issue.
Maybe I don't remember correctly, but didn't we do something in the past to fix these type of behaviours @plebhash ?

@plebhash
Copy link
Collaborator

didn't we do something in the past to fix these type of behaviours?

can you be more specific? are you referring to wrong TP config, or authority_public_key vs authority_pubkey?

@plebhash plebhash added bug Something isn't working good first issue Good for newcomers labels May 18, 2024
@GitGab19
Copy link
Collaborator Author

didn't we do something in the past to fix these type of behaviours?

can you be more specific? are you referring to wrong TP config, or authority_public_key vs authority_pubkey?

I don't remember specific details tbh. I just remember that we did something to better handle configurations in general, but maybe I'm wrong

@plebhash
Copy link
Collaborator

we had this issue: #695
which was closed via #859

@pavlenex pavlenex added this to the 1.0.2 milestone May 24, 2024
@jbesraa
Copy link
Contributor

jbesraa commented Jun 10, 2024

Happy to pick this up

@GitGab19 From what I understand from the discord discussion the user used 18442 instead of 8442 in one of the configs, but that is not strictly prohibited right? I wonder if this requires validation across configs or we should just validate its 8442 across all of configs?

@GitGab19
Copy link
Collaborator Author

Happy to pick this up

@GitGab19 From what I understand from the discord discussion the user used 18442 instead of 8442 in one of the configs, but that is not strictly prohibited right? I wonder if this requires validation across configs or we should just validate its 8442 across all of configs?

Hey I'm sorry for being late.
So, imo the important thing is to validate the config in order to avoid cases like the one described here: #863 (comment).
The 8442 port is not strictly mandatory, a user could change it in both TP and roles config, so I would not require it to be always 8442

@Sjors
Copy link
Collaborator

Sjors commented Jun 20, 2024

Indeed, you could check that the port is a valid integer between 0 and 65535. But just checking that it's an integer should be enough.

@jbesraa
Copy link
Contributor

jbesraa commented Jun 20, 2024

Because we are using serde the ser and de errors are generated also by serde which is fine. so I didnt need to do much beside handling this error https://github.com/stratum-mining/stratum/pull/987/files#diff-49408d7d429f7afceda135baa9cdd786c20024ec6ffd2a05353efe1b0c5c2e75R110

@rrybarczyk
Copy link
Collaborator

See my comment here.

I think we should address just the JDC config issue as a patch if you think it is urgent, or wait until #997 which I just opened.

@GitGab19
Copy link
Collaborator Author

See my comment here.

I think we should address just the JDC config issue as a patch if you think it is urgent, or wait until #997 which I just opened.

I would lean towards aggregating them into #997, since it seems a better wrapper for it. But @jbesraa feel free to let us know what you think about it (for me it's also ok to merge your contribution now)

@pavlenex pavlenex linked a pull request Jun 25, 2024 that will close this issue
@GitGab19
Copy link
Collaborator Author

Closed by #987

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers job-declarator-client
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants