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

[backport] feat: add new cmd fpd commit-pubrand #153

Merged
merged 7 commits into from
Nov 28, 2024

Conversation

bap2pecs
Copy link
Collaborator

@bap2pecs bap2pecs commented Nov 22, 2024

Summary

backport https://github.com/babylonlabs-io/finality-provider/pull/131/files

Test Plan

$ ./build/fpd unsafe-cpr -h
[UNSAFE] Manually trigger public randomness commitment for a finality provider.
WARNING: this can drain the finality provider's balance if the target height is too high.

Usage:
  fpd unsafe-commit-pubrand [fp-eots-pk-hex] [target-height] [flags]

Aliases:
  unsafe-commit-pubrand, unsafe-cpr

Examples:
fpd unsafe-commit-pubrand --home /home/user/.fpd [fp-eots-pk-hex] [target-height]

Flags:
  -h, --help                help for unsafe-commit-pubrand
      --start-height uint   The block height to start committing pubrand from (optional) (default 18446744073709551615)

Global Flags:
      --home string   The application home directory (default "/Users/<redacted>/Library/Application Support/Fpd")

waiting for CI tests

@bap2pecs
Copy link
Collaborator Author

fixed two lint issues introduced by this PR. but the "rewrite if-else to switch statement" is just refactoring so irrelevant to this PR

image

@bap2pecs
Copy link
Collaborator Author

image

rest CI passing

@bap2pecs bap2pecs marked this pull request as ready for review November 22, 2024 13:55
@gitferry
Copy link
Member

Could you fix rest of linter errors?

@SebastianElvis
Copy link
Member

Btw for backport, we plan to test out this workflow babylonlabs-io/babylon#299. If it works then probably we can port it here

@bap2pecs
Copy link
Collaborator Author

Btw for backport, we plan to test out this workflow babylonlabs-io/babylon#299. If it works then probably we can port it here

How does it work? Will CI auto create a PR?

@SebastianElvis
Copy link
Member

Btw for backport, we plan to test out this workflow babylonlabs-io/babylon#299. If it works then probably we can port it here

How does it work? Will CI auto create a PR?

In theory yes, although we haven't seen it working yet

@bap2pecs
Copy link
Collaborator Author

In theory yes, although we haven't seen it working yet

based on my experience backporting PRs, I am not confident it will work. taking this pr as an example,

  • TestNewUnregisteredFinalityProviderInstance is only needed in https://github.com/babylonlabs-io/finality-provider/pull/131/files but not this PR. b/c in the base branch, NewFinalityProviderInstance has a check if sfp.Status < proto.FinalityProviderStatus_REGISTERED but main branch doesn't have it
  • the API interface in the base branch needs both the client controller and consumer controller as params but the main branch only need client controller due to a very early refactor we did in the base branch

I feel there is no way for the CI to have those knowledge

@SebastianElvis
Copy link
Member

For those PRs that do not affect tests or have merge conflicts, this will work. Otherwise, someone needs to modify the PR and get it merged

@gitferry gitferry mentioned this pull request Nov 26, 2024
@gitferry
Copy link
Member

@bap2pecs Could you fix the lint error so that we can merge it?

Copy link
Member

@gitferry gitferry 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 backporting it!

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Cirrus Gai <[email protected]>
@bap2pecs bap2pecs merged commit 36f1f9d into main Nov 28, 2024
10 checks passed
@bap2pecs bap2pecs deleted the backport/fpd-commit-pubrand branch November 28, 2024 12:45
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.

3 participants