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

feat: finality gadget server #13

Merged
merged 97 commits into from
Aug 8, 2024
Merged

feat: finality gadget server #13

merged 97 commits into from
Aug 8, 2024

Conversation

parketh
Copy link
Collaborator

@parketh parketh commented Aug 5, 2024

Summary

This PR implements the finality gadget server, a stateful program used to track consecutive quorum and query the latest BTC-finalized block.

Integration tests are seperately added in the finality-provider repo (see below)

Test plan

To run tests:

make test

To run the finality gadget daemon:

make install
opfgd start --cfg config.toml

Note that running the daemon with the default configs will throw a block %d be finalized according to client but is not error, because there aren't any FPs signing blocks, i.e. blocks are not registered as finalized. For testing purposes, we can override queryIsBlockBabylonFinalized in finalitygadget.go to return true, nil for now.

one the daemon is running, we can use Postman to test gRPC (need to import the finalitygadget.proto file) with localhost:8080 as the URL:

image

then you can invoke queries like:
image

Copy link
Member

@SebastianElvis SebastianElvis left a comment

Choose a reason for hiding this comment

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

That's a lot. Great work!

cwclient/cwclient.go Show resolved Hide resolved
server/server.go Outdated Show resolved Hide resolved
proto/finalitygadget.proto Outdated Show resolved Hide resolved
Copy link
Collaborator

@bap2pecs bap2pecs left a comment

Choose a reason for hiding this comment

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

love this PR! great work

Vibing Silver Fox - WOT9tRmLbjw7M6m2R1

config.toml Outdated Show resolved Hide resolved
cwclient/cwclient.go Show resolved Hide resolved
db/bbolt.go Outdated Show resolved Hide resolved
db/bbolt.go Outdated Show resolved Hide resolved
db/bbolt.go Outdated Show resolved Hide resolved
finalitygadget/interface.go Show resolved Hide resolved
proto/finalitygadget.proto Outdated Show resolved Hide resolved
server/rpcserver.go Outdated Show resolved Hide resolved
server/server.go Outdated Show resolved Hide resolved
server/server.go Outdated Show resolved Hide resolved
@parketh
Copy link
Collaborator Author

parketh commented Aug 8, 2024

thanks for latest round of comments @SebastianElvis @bap2pecs, have addressed these

Copy link
Collaborator

@bap2pecs bap2pecs left a comment

Choose a reason for hiding this comment

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

thanks for the changes! look great. feel free to ship the code

Animation Boat - 3oz8xRQiRlaS1XwnPW

@parketh parketh merged commit 765db8b into main Aug 8, 2024
@parketh parketh deleted the feat/verifier-daemon branch August 8, 2024 14:37
@parketh parketh restored the feat/verifier-daemon branch August 8, 2024 14:55
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.

4 participants