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

Allow connection of BFG to another BFG for L2 Keystone Notifications/Querying #286

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ClaytonNorthey92
Copy link
Contributor

@ClaytonNorthey92 ClaytonNorthey92 commented Oct 18, 2024

Summary
We want to make BFGs easier to run. This PR will do so by allow a BFG (ex. run by a PoP miner) to receive l2 keystones from another, trusted BFG (example Hemi Labs) and use a local Electrs+bitcoind to broadcast the transaction instead of Hemi Labs (or any third party). This will avoid congestion during: btc balance retrieval, btc utxos retrieval, btc height retrieval, and btc broadcasting.

fixes #261

Changes
allow a BFG to connect to another BFG. the client BFG will receive L2 Keystone notifications via the public websocket endpoint, it will then query for new keystones when it gets a notification.

you must use BFG_BFG_URL + BFG_BTC_PRIVKEY to connect to another BFG.

BFG will request the latest 3 keystones upon each notification then save them in the DB and broadcast the keystones to its connected clients

add ON CONFLICT DO NOTHING to no-op with keystones we've already received

updated readme

@github-actions github-actions bot added the area: bfg This is a change to BFG (Bitcoin Finality Governor) label Oct 18, 2024
@ClaytonNorthey92 ClaytonNorthey92 force-pushed the clayton/connected-bfgs branch 2 times, most recently from 4fe85f5 to 4f458f7 Compare October 18, 2024 19:18
@ClaytonNorthey92 ClaytonNorthey92 changed the title Clayton/connected bfgs Allow connection of BFG to another BFG for L2 Keystone Notifications/Querying Oct 18, 2024
@github-actions github-actions bot added the area: ci This is a change to CI files. Excluded from changelog label Oct 21, 2024
@ClaytonNorthey92 ClaytonNorthey92 force-pushed the clayton/connected-bfgs branch 2 times, most recently from 331df9e to b768be5 Compare October 21, 2024 20:26
@ClaytonNorthey92 ClaytonNorthey92 marked this pull request as ready for review October 21, 2024 20:28
@ClaytonNorthey92 ClaytonNorthey92 requested a review from a team as a code owner October 21, 2024 20:28
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
@ClaytonNorthey92 ClaytonNorthey92 force-pushed the clayton/connected-bfgs branch 3 times, most recently from d809324 to 7a12aa5 Compare October 25, 2024 16:09
ClaytonNorthey92 and others added 4 commits October 25, 2024 12:18
…ions

allow a BFG to connect to another BFG.  the client BFG will receive L2 Keystone notifications via the public websocket endpoint, it will then query for new keystones when it gets a notification.

you must use BFG_BFG_URL + BFG_BTC_PRIVKEY to connect to another BFG.

BFG will request the latest 3 keystones upon each notification then save them in the DB and broadcast the keystones to its connected clients

add ON CONFLICT DO NOTHING to no-op with keystones we've already received

updated readme
Co-authored-by: Joshua Sing <joshua@bloq.com>
cmd/bfgd/bfgd.go Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
ClaytonNorthey92 and others added 2 commits October 25, 2024 13:42
Co-authored-by: Joshua Sing <joshua@bloq.com>
Co-authored-by: Joshua Sing <joshua@bloq.com>
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) area: ci This is a change to CI files. Excluded from changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When using the self-host bfgd, got response with 0 keystones.
2 participants