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

bfg: add config option to disable public ws conns #431

Merged
merged 3 commits into from
Mar 10, 2025

Conversation

joshuasing
Copy link
Contributor

Summary
Add a configuration option BFG_DISABLE_PUBLIC_CONNS to disable public WebSocket connections on BFG.
When a PoP Miner connects and this option is enabled, the PoP Miner will be disconnected with an authentication error, which will result in the PoP Miner not retrying the connection.

Changes

  • Add BFG_DISABLE_PUBLIC_CONNS environment variable to BFG.
  • Add handling to close public WebSocket connections with a protocol.ErrPublicKeyAuth error when DisablePublicConns is true.

@joshuasing joshuasing added type: refactor This refactors existing functionality area: bfg This is a change to BFG (Bitcoin Finality Governor) labels Mar 10, 2025
@joshuasing joshuasing requested a review from a team as a code owner March 10, 2025 16:26
Copy link
Contributor

@ClaytonNorthey92 ClaytonNorthey92 left a comment

Choose a reason for hiding this comment

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

hey @joshuasing , could we add a test case for this? you can find an example that you could copy and paste from here https://github.com/hemilabs/heminetwork/pull/359/files#diff-f7bc76e889209de062a2c7c80346ee555bf7d7b24f5290830fac4a06cc87dcd5L4011

ClaytonNorthey92 and others added 2 commits March 10, 2025 13:02
The PoP Miner uses errors.Is to check the authentication error,
so testing this allows us to make sure the error will be handled
correctly within the PoP Miner as well.
Copy link
Contributor

@jcvernaleo jcvernaleo left a comment

Choose a reason for hiding this comment

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

OK

@ClaytonNorthey92 ClaytonNorthey92 merged commit 6d30593 into main Mar 10, 2025
7 checks passed
@ClaytonNorthey92 ClaytonNorthey92 deleted the joshua/bfg-auth branch March 10, 2025 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: bfg This is a change to BFG (Bitcoin Finality Governor) type: refactor This refactors existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants