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

fix: merge main to base #281

Open
wants to merge 111 commits into
base: base/consumer-chain-support
Choose a base branch
from

Conversation

SebastianElvis
Copy link
Member

@SebastianElvis SebastianElvis commented Jan 14, 2025

Resolves #300

This PR merges the latest main to the base branch.

NOTE: CI pipelines using Docker registry do not work for some reason, asking devops atm. All e2e tests pass locally.

Lazar955 and others added 30 commits September 25, 2024 13:08
Run e2e tests with babylond in docker container.

Seems that in order to execute tests with `t.Parallel()` we will need to
do some refactoring in eots manager. Will be done in next PR.
Ensures that our e2e tests version use a correct version of babylond
from go.mod
In the previous implementation, once a finality provider is jailed, when
the fpd is restarted, it will panic due to error from Babylon when fast
sync. This PR fixed this issue with the following changes:
1. We implemented `unjail` finality provider CLI other than using the
one from Babylon. This implementation will set the fp instance status to
`inactive` after `unjail` tx is successfully sent (will later updated to
active if the fp has voting power).
2. Once `jailed` error is detected while starting a fp instance, it will
fail but the fpd will not panic, meaning that the loop for updating
stored fp status continues running.

Now the flow of jailing/unjailing becomes the follows:
1. fpd detects jailing via err when sending a fp sig or a loop for
checking fp status
2. once `jailed` detected, fpd terminates the fp instance without
terminating the program
3. the operator checks fp signing info to get the `jail_until` via
`babylond q finality signing-info [fp-pk-hex]`
4. after the `jail_until` is passed, the operator can unjail the fp by
executing `fpd unjail-finality-provider [fp-pk-hex]`
5. if everything goes well, the fp will continue sending finality votes
if it has voting power after a period of waiting for state transition
New release `v0.5.x` should be created after this PR
This update involves:
- Enabling gosec in the github workflow and updating the github workflow
versions.
- Update the codebase to fix findings from gosec. Highlights:
   - Some unhandled errors
- Config types allowed for very large values. For example, the retry
intervals and the commit gaps allowed for uint64. All values related to
block sizes were left to uint64, but the others were reduced to uint32.
   - Prometheus server protection against Slowloris
This PR partly addresses
#34 by
disallowing running multiple fp instances within the fp manager. Keyring
level improvement will be done in a separate PR to address #63. Notable
changes in this PR:

1. Remove `MaxNumFinalityProviders` from config as it is not applicable
2. If `--eots-pk` is not specified in `fpd start`, fp app will start
without any fp instances. To run a fp instance, `--eots-pk` must be
given
3. fp manager only keeps a single fp instance instead of a map
Also created an empty changelog and bumped the .github dependency
This PR

- sets up Go releaser for Babylon. Currently it only supports linux
amd64. Other targets will be supported in the future. To test locally,
run `make release-snapshot`
- moves changelog reminder out from the CI flow
- Adds CLI support to edit finality provider description

_Note: I did try using the edit cmd defined in Babylon, but I wasn't
successful as the cmd context is getting passed into the edit cmd
resulting in a flags error._

[References
issue](#12)
- Add checks for finality activation height
- Pub rand commit start height at activation height or last commited
height whatever is higher
- Finality vote, only vote in blocks after the finality activation
height
- Update babylon to v014
Running `fpd version` now prints info on the built binary:

<img width="370" alt="image"
src="https://github.com/user-attachments/assets/e61f8757-1e76-45a1-89ba-525a276ab3e5">

[Related to
issue](#11)
Closes #63:
* Replace `eotsd` cli library with `cobra` lib to be consistent with
`fpd`
* Remove `export-pop` and `sign-schnorr` because they are not needed for
phase-2
* Reuse `keys` commands from `cosmos-sdk`
* Wrap `keys add` commands to save the public key and key name wrapping
* Refactor eotsd cmd folder architect

Example after change:
```
❯ ./build/eotsd keys add "test-key-0" --keyring-backend=test

**Important** write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.

topic expire slush beyond room cube train tenant dice negative winter lamp unaware winner story bounce space try rotate tiny assault grain scheme pact

name: test-key-0
pub_key_hex: e40ea1364293afd9d7400b58f336e7b6b10baf83ef31ef83b447f3fcdd928b59
```
Fixes linting configuration (currently 126 issues outstanding)
Closes #118. Notable changes:
* remove fast sync completely
* introduce batch process for catching up
* introduce signature submission interval to config
* introduce batch submission size to config
Remaining CVEs that fires alarms:
| Lib | CVE | Current version | Fixed version | Indirect |
| -------- |
------------------------------------------------------------------------
| ---------------- | ------------- | -------- |
| CometBFT |
[GHSA-p7mv-53f2-4cwj](GHSA-p7mv-53f2-4cwj)
| 0.38.9 | 0.38.15 | |
| CometBFT |
[GHSA-g5xx-c4hv-9ccc](GHSA-g5xx-c4hv-9ccc)
| 0.38.9 | 0.38.12 | |
| wasmd |
[GHSA-g8w7-7vgg-x7xg](GHSA-g8w7-7vgg-x7xg)
| 0.52.0 | 0.53.0 | |
| wasmd |
[GHSA-fpgj-cr28-fvpx](GHSA-fpgj-cr28-fvpx)
| 0.52.0 | 0.53.0 | |
| lnd | [CVE-2024-38359](https://avd.aquasec.com/nvd/cve-2024-38359) |
v0.16.4-beta.rc1 | 0.17.0-beta | |
RafilxTenfen and others added 7 commits January 24, 2025 09:11
Closes #289. With this pr, the `fpd start` flow becomes the follows:

- If --eots-pk is specified, start the specified fp instance. Otherwise,
- if no fp records found from db, start the daemon and show logs asking
for registration
- if there's one fp record found from db, start the daemon with the fp
- if there are multiple fp record found from db, fail the cmd execution
asking for set of --eots-pk
Comment on lines +22 to +38
name: Backport
runs-on: ubuntu-latest
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport')
)
)
steps:
- uses: tibdex/backport@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
)
)
steps:
- uses: tibdex/backport@v2

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Backport' step
Uses Step
uses 'tibdex/backport' with ref 'v2', not a pinned commit hash
Comment on lines +10 to +11
uses: babylonlabs-io/.github/.github/workflows/[email protected]
secrets: inherit

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
Comment on lines +10 to +11
uses: babylonlabs-io/.github/.github/workflows/[email protected]
secrets: inherit

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
@SebastianElvis SebastianElvis force-pushed the merbe-main-to-base-2025 branch from fea9538 to 74913c6 Compare January 29, 2025 07:58
samricotta and others added 5 commits January 29, 2025 19:22
closes: #282

Previously commission rate was required although it should be optional.
This fix fetches the already set commission rate otherwise will submit
the new one if it is specified by the operator.
@SebastianElvis SebastianElvis marked this pull request as ready for review January 30, 2025 03:17
@SebastianElvis SebastianElvis force-pushed the merbe-main-to-base-2025 branch 7 times, most recently from df5a7e9 to 97c1276 Compare January 31, 2025 04:41
@SebastianElvis
Copy link
Member Author

All tests have been fixed now. Please feel free to review @gusin13 @maurolacy @gitferry @Lazar955

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.

9 participants