Skip to content

Commit

Permalink
Merge pull request #402 from babylonlabs-io/base/consumer-chain-support
Browse files Browse the repository at this point in the history
feat: merge base branch to main
  • Loading branch information
filippos47 authored Jan 23, 2025
2 parents cd2e006 + 3273ea8 commit 10905e7
Show file tree
Hide file tree
Showing 200 changed files with 35,593 additions and 909 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ jobs:
run: |
make test-e2e-cache-btc-staking-pre-approval
# Disable this test because v1 upgrade does not cover integration features
# TODO: Reenable this test after having v2 upgrade
e2e-run-upgrade-v1:
if: false
needs: [e2e-docker-build-babylon, e2e-docker-build-e2e-init-chain]
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -224,4 +227,4 @@ jobs:
sudo make test-e2e-cache-upgrade-v1
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
uses: jwalton/gh-docker-logs@v2
11 changes: 3 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## Unreleased

### Improvements
### State Machine Breaking

- [#402](https://github.com/babylonlabs-io/babylon/pull/402) **Babylon multi-staking support**.
This PR contains a series of PRs on multi-staking support and BTC stakingintegration.
- [#391](https://github.com/babylonlabs-io/babylon/pull/391) Fix e2e `TestBTCRewardsDistribution` flunky
check of rewards
- [#419](https://github.com/babylonlabs-io/babylon/pull/419) Add new modules to swagger config
Expand Down Expand Up @@ -371,8 +373,6 @@ by add ibc default gen state and min gas price specification of `1ubbn`

### State Machine Breaking

* [#80](https://github.com/babylonlabs-io/babylon/pull/80) Implement ADR-25 and
enable jailing/unjailing finality providers
* [#45](https://github.com/babylonlabs-io/babylon/pull/45) Implement ADR-23 and improve
BTC staking parameters
* [#51](https://github.com/babylonlabs-io/babylon/pull/51) Implement ADR-24 and
Expand All @@ -384,11 +384,6 @@ processes `MsgCreateFinalityProvider` message during upgrade execution
* [#4](https://github.com/babylonlabs-io/babylon/pull/4) Add upgrade that
Insert BTC headers into `btclightclient` module state during upgrade execution

### Misc Improvements

* [#84](https://github.com/babylonlabs-io/babylon/pull/84) Add `unjail-finality-provider`
cmd to `finality` module CLI.

## v0.9.3

## v0.9.2
Expand Down
24 changes: 14 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ mockgen_cmd=go run github.com/golang/mock/[email protected]
mocks: $(MOCKS_DIR) ## Generate mock objects for testing
$(mockgen_cmd) -source=x/checkpointing/types/expected_keepers.go -package mocks -destination testutil/mocks/checkpointing_expected_keepers.go
$(mockgen_cmd) -source=x/checkpointing/keeper/bls_signer.go -package mocks -destination testutil/mocks/bls_signer.go
$(mockgen_cmd) -source=x/zoneconcierge/types/expected_keepers.go -package types -destination x/zoneconcierge/types/mocked_keepers.go
$(mockgen_cmd) -source=x/btcstaking/types/expected_keepers.go -package types -destination x/btcstaking/types/mocked_keepers.go
$(mockgen_cmd) -source=x/finality/types/expected_keepers.go -package types -destination x/finality/types/mocked_keepers.go
$(mockgen_cmd) -source=x/incentive/types/expected_keepers.go -package types -destination x/incentive/types/mocked_keepers.go
Expand Down Expand Up @@ -263,20 +264,20 @@ endif
test-e2e: build-docker-e2e test-e2e-cache

test-e2e-cache:
go test -mod=readonly -timeout=60m -v $(PACKAGES_E2E) --tags=e2e
$(MAKE) test-e2e-cache-btc-timestamping
$(MAKE) test-e2e-cache-btc-staking
$(MAKE) clean-e2e
$(MAKE) test-e2e-cache-btc-staking-pre-approval
$(MAKE) test-e2e-cache-ibc-transfer
# $(MAKE) test-e2e-cache-upgrade-v1

test-e2e-cache-ibc-transfer:
go test -run TestIBCTranferTestSuite -mod=readonly -timeout=60m -v $(PACKAGES_E2E) --tags=e2e
clean-e2e:
docker container rm -f $(shell docker container ls -a -q) || true
docker network prune -f || true

test-e2e-cache-btc-timestamping:
go test -run TestBTCTimestampingTestSuite -mod=readonly -timeout=60m -v $(PACKAGES_E2E) --tags=e2e

test-e2e-cache-btc-timestamping-phase-2-hermes:
go test -run TestBTCTimestampingPhase2HermesTestSuite -mod=readonly -timeout=60m -v $(PACKAGES_E2E) --tags=e2e

test-e2e-cache-btc-timestamping-phase-2-rly:
go test -run TestBTCTimestampingPhase2RlyTestSuite -mod=readonly -timeout=60m -v $(PACKAGES_E2E) --tags=e2e

test-e2e-cache-btc-staking:
go test -run TestBTCStakingTestSuite -mod=readonly -timeout=60m -v $(PACKAGES_E2E) --tags=e2e

Expand All @@ -286,6 +287,9 @@ test-e2e-cache-btc-rewards:
test-e2e-cache-btc-staking-pre-approval:
go test -run TestBTCStakingPreApprovalTestSuite -mod=readonly -timeout=60m -v $(PACKAGES_E2E) --tags=e2e

test-e2e-cache-ibc-transfer:
go test -run TestIBCTranferTestSuite -mod=readonly -timeout=60m -v $(PACKAGES_E2E) --tags=e2e

test-e2e-cache-upgrade-v1:
go test -run TestSoftwareUpgradeV1TestnetTestSuite -mod=readonly -timeout=60m -v $(PACKAGES_E2E) --tags=e2e

Expand Down Expand Up @@ -442,7 +446,7 @@ build-cosmos-relayer-docker: ## Build Docker image for the Cosmos relayer
$(MAKE) -C contrib/images cosmos-relayer

clean-docker-network:
$(DOCKER) network rm ${dockerNetworkList}
$(DOCKER) network rm ${dockerNetworkList} || true

build-test-wasm: ## Build WASM bindings for testing
$(DOCKER) run --rm -v "$(WASM_DIR)":/code \
Expand Down
79 changes: 47 additions & 32 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,36 @@ import (
"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/babylonlabs-io/babylon/app/ante"
appkeepers "github.com/babylonlabs-io/babylon/app/keepers"
appparams "github.com/babylonlabs-io/babylon/app/params"
"github.com/babylonlabs-io/babylon/app/signer"
"github.com/babylonlabs-io/babylon/app/upgrades"
"github.com/babylonlabs-io/babylon/client/docs"
bbn "github.com/babylonlabs-io/babylon/types"
"github.com/babylonlabs-io/babylon/x/btccheckpoint"
btccheckpointtypes "github.com/babylonlabs-io/babylon/x/btccheckpoint/types"
"github.com/babylonlabs-io/babylon/x/btclightclient"
btclightclienttypes "github.com/babylonlabs-io/babylon/x/btclightclient/types"
"github.com/babylonlabs-io/babylon/x/btcstaking"
btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types"
"github.com/babylonlabs-io/babylon/x/btcstkconsumer"
bsctypes "github.com/babylonlabs-io/babylon/x/btcstkconsumer/types"
"github.com/babylonlabs-io/babylon/x/checkpointing"
checkpointingtypes "github.com/babylonlabs-io/babylon/x/checkpointing/types"
"github.com/babylonlabs-io/babylon/x/epoching"
epochingtypes "github.com/babylonlabs-io/babylon/x/epoching/types"
"github.com/babylonlabs-io/babylon/x/finality"
finalitytypes "github.com/babylonlabs-io/babylon/x/finality/types"
"github.com/babylonlabs-io/babylon/x/incentive"
incentivekeeper "github.com/babylonlabs-io/babylon/x/incentive/keeper"
incentivetypes "github.com/babylonlabs-io/babylon/x/incentive/types"
"github.com/babylonlabs-io/babylon/x/mint"
minttypes "github.com/babylonlabs-io/babylon/x/mint/types"
"github.com/babylonlabs-io/babylon/x/monitor"
monitortypes "github.com/babylonlabs-io/babylon/x/monitor/types"
"github.com/babylonlabs-io/babylon/x/zoneconcierge"
zctypes "github.com/babylonlabs-io/babylon/x/zoneconcierge/types"
abci "github.com/cometbft/cometbft/abci/types"
cmtos "github.com/cometbft/cometbft/libs/os"
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
Expand Down Expand Up @@ -88,34 +118,6 @@ import (
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
"github.com/spf13/cast"

"github.com/babylonlabs-io/babylon/x/mint"
minttypes "github.com/babylonlabs-io/babylon/x/mint/types"

"github.com/babylonlabs-io/babylon/app/ante"
appkeepers "github.com/babylonlabs-io/babylon/app/keepers"
appparams "github.com/babylonlabs-io/babylon/app/params"
"github.com/babylonlabs-io/babylon/app/signer"
"github.com/babylonlabs-io/babylon/app/upgrades"
"github.com/babylonlabs-io/babylon/client/docs"
bbn "github.com/babylonlabs-io/babylon/types"
"github.com/babylonlabs-io/babylon/x/btccheckpoint"
btccheckpointtypes "github.com/babylonlabs-io/babylon/x/btccheckpoint/types"
"github.com/babylonlabs-io/babylon/x/btclightclient"
btclightclienttypes "github.com/babylonlabs-io/babylon/x/btclightclient/types"
"github.com/babylonlabs-io/babylon/x/btcstaking"
btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types"
"github.com/babylonlabs-io/babylon/x/checkpointing"
checkpointingtypes "github.com/babylonlabs-io/babylon/x/checkpointing/types"
"github.com/babylonlabs-io/babylon/x/epoching"
epochingtypes "github.com/babylonlabs-io/babylon/x/epoching/types"
"github.com/babylonlabs-io/babylon/x/finality"
finalitytypes "github.com/babylonlabs-io/babylon/x/finality/types"
"github.com/babylonlabs-io/babylon/x/incentive"
incentivekeeper "github.com/babylonlabs-io/babylon/x/incentive/keeper"
incentivetypes "github.com/babylonlabs-io/babylon/x/incentive/types"
"github.com/babylonlabs-io/babylon/x/monitor"
monitortypes "github.com/babylonlabs-io/babylon/x/monitor/types"
)

const (
Expand Down Expand Up @@ -310,6 +312,9 @@ func NewBabylonApp(
btccheckpoint.NewAppModule(appCodec, app.BtcCheckpointKeeper),
checkpointing.NewAppModule(appCodec, app.CheckpointingKeeper),
monitor.NewAppModule(appCodec, app.MonitorKeeper),
// Babylon modules - integration
btcstkconsumer.NewAppModule(appCodec, app.BTCStkConsumerKeeper, app.AccountKeeper, app.BankKeeper),
zoneconcierge.NewAppModule(appCodec, app.ZoneConciergeKeeper, app.AccountKeeper, app.BankKeeper),
// Babylon modules - btc staking
btcstaking.NewAppModule(appCodec, app.BTCStakingKeeper),
finality.NewAppModule(appCodec, app.FinalityKeeper),
Expand Down Expand Up @@ -366,6 +371,9 @@ func NewBabylonApp(
ibctransfertypes.ModuleName,
ibcfeetypes.ModuleName,
wasmtypes.ModuleName,
// Integration related modules
bsctypes.ModuleName,
zctypes.ModuleName,
// BTC staking related modules
btcstakingtypes.ModuleName,
finalitytypes.ModuleName,
Expand Down Expand Up @@ -394,6 +402,9 @@ func NewBabylonApp(
ibctransfertypes.ModuleName,
ibcfeetypes.ModuleName,
wasmtypes.ModuleName,
// Integration related modules
bsctypes.ModuleName,
zctypes.ModuleName,
// BTC staking related modules
btcstakingtypes.ModuleName,
finalitytypes.ModuleName,
Expand Down Expand Up @@ -426,6 +437,9 @@ func NewBabylonApp(
ibctransfertypes.ModuleName,
ibcfeetypes.ModuleName,
wasmtypes.ModuleName,
// Integration related modules
bsctypes.ModuleName,
zctypes.ModuleName,
// BTC staking related modules
btcstakingtypes.ModuleName,
finalitytypes.ModuleName,
Expand Down Expand Up @@ -542,10 +556,11 @@ func NewBabylonApp(

// At startup, after all modules have been registered, check that all proto
// annotations are correct.
protoFiles, err := proto.MergedRegistry()
if err != nil {
panic(err)
}
// FIXME (https://github.com/babylonlabs-io/babylon-private/issues/266): This is a temporary fix
protoFiles, _ := proto.MergedRegistry()
// if err != nil {
// panic(err)
// }
err = msgservice.ValidateProtoAnnotations(protoFiles)
if err != nil {
// Once we switch to using protoreflect-based antehandlers, we might
Expand Down
Loading

0 comments on commit 10905e7

Please sign in to comment.