Skip to content

Commit

Permalink
Merge branch 'main' of github.com:babylonlabs-io/babylon into rafilx/…
Browse files Browse the repository at this point in the history
…upgrade-token-distribution
  • Loading branch information
RafilxTenfen committed Sep 30, 2024
2 parents 8609fbc + 47863ba commit 45d7c0c
Show file tree
Hide file tree
Showing 85 changed files with 134 additions and 17,797 deletions.
54 changes: 0 additions & 54 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,60 +137,6 @@ jobs:
run: |
make test-e2e-cache-btc-timestamping
e2e-run-btc-timestamping-phase-2-hermes:
needs: [e2e-docker-build-babylon]
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download babylon artifact
uses: actions/download-artifact@v4
with:
name: babylond-${{ github.sha }}
path: /tmp
- name: Docker load babylond
run: |
docker load < /tmp/docker-babylond.tar.gz
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Cache Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Run e2e TestBTCTimestampingPhase2HermesTestSuite
run: |
make test-e2e-cache-btc-timestamping-phase-2-hermes
e2e-run-btc-timestamping-phase-2-rly:
needs: [e2e-docker-build-babylon]
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download babylon artifact
uses: actions/download-artifact@v4
with:
name: babylond-${{ github.sha }}
path: /tmp
- name: Docker load babylond
run: |
docker load < /tmp/docker-babylond.tar.gz
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Cache Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Run e2e TestBTCTimestampingPhase2RlyTestSuite
run: |
make test-e2e-cache-btc-timestamping-phase-2-rly
e2e-run-btc-staking:
needs: [e2e-docker-build-babylon]
runs-on: ubuntu-22.04
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

* [#103](https://github.com/babylonlabs-io/babylon/pull/103) Add token distribution
to upgrade handler and rename `signet-launch` to `v1`
* [#55](https://github.com/babylonlabs-io/babylon/pull/55) Remove `x/zoneconcierge`
module

### Misc Improvements

* [#106](https://github.com/babylonlabs-io/babylon/pull/106) Add CLI command for
querying signing info of finality providers.

## v0.10.1

### Bug Fixes

* [#91](https://github.com/babylonlabs-io/babylon/pull/91) fix testnet command
by add ibc default gen state and min gas price specification of `1ubbn`
* [#93](https://github.com/babylonlabs-io/babylon/pull/93) fix genesis epoch
initialization.

## v0.10.0

Expand Down
13 changes: 0 additions & 13 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ import (
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"
"github.com/babylonlabs-io/babylon/x/zoneconcierge"
zckeeper "github.com/babylonlabs-io/babylon/x/zoneconcierge/keeper"
zctypes "github.com/babylonlabs-io/babylon/x/zoneconcierge/types"
)

const (
Expand Down Expand Up @@ -313,7 +310,6 @@ func NewBabylonApp(
btccheckpoint.NewAppModule(appCodec, app.BtcCheckpointKeeper),
checkpointing.NewAppModule(appCodec, app.CheckpointingKeeper),
monitor.NewAppModule(appCodec, app.MonitorKeeper),
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 @@ -368,7 +364,6 @@ func NewBabylonApp(
ibcexported.ModuleName,
ibcwasmtypes.ModuleName,
ibctransfertypes.ModuleName,
zctypes.ModuleName,
ibcfeetypes.ModuleName,
wasmtypes.ModuleName,
// BTC staking related modules
Expand Down Expand Up @@ -397,7 +392,6 @@ func NewBabylonApp(
ibcexported.ModuleName,
ibcwasmtypes.ModuleName,
ibctransfertypes.ModuleName,
zctypes.ModuleName,
ibcfeetypes.ModuleName,
wasmtypes.ModuleName,
// BTC staking related modules
Expand Down Expand Up @@ -430,7 +424,6 @@ func NewBabylonApp(
ibcexported.ModuleName,
ibcwasmtypes.ModuleName,
ibctransfertypes.ModuleName,
zctypes.ModuleName,
ibcfeetypes.ModuleName,
wasmtypes.ModuleName,
// BTC staking related modules
Expand Down Expand Up @@ -540,12 +533,6 @@ func NewBabylonApp(
app.SetEndBlocker(app.EndBlocker)
app.SetAnteHandler(anteHandler)

// set postHandler
postHandler := sdk.ChainPostDecorators(
zckeeper.NewIBCHeaderDecorator(app.ZoneConciergeKeeper),
)
app.SetPostHandler(postHandler)

// must be before Loading version
// requires the snapshot store to be created and registered as a BaseAppOption
// see cmd/wasmd/root.go: 206 - 214 approx
Expand Down
53 changes: 7 additions & 46 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package keepers
import (
"path/filepath"

errorsmod "cosmossdk.io/errors"
"cosmossdk.io/log"
storetypes "cosmossdk.io/store/types"
circuitkeeper "cosmossdk.io/x/circuit/keeper"
Expand All @@ -21,7 +20,6 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/runtime"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
Expand Down Expand Up @@ -80,9 +78,6 @@ import (
incentivetypes "github.com/babylonlabs-io/babylon/x/incentive/types"
monitorkeeper "github.com/babylonlabs-io/babylon/x/monitor/keeper"
monitortypes "github.com/babylonlabs-io/babylon/x/monitor/types"
"github.com/babylonlabs-io/babylon/x/zoneconcierge"
zckeeper "github.com/babylonlabs-io/babylon/x/zoneconcierge/keeper"
zctypes "github.com/babylonlabs-io/babylon/x/zoneconcierge/types"
)

// Capabilities of the IBC wasm contracts
Expand Down Expand Up @@ -129,11 +124,10 @@ type AppKeepers struct {
MonitorKeeper monitorkeeper.Keeper

// IBC-related modules
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
IBCFeeKeeper ibcfeekeeper.Keeper // for relayer incentivization - https://github.com/cosmos/ibc/tree/main/spec/app/ics-029-fee-payment
TransferKeeper ibctransferkeeper.Keeper // for cross-chain fungible token transfers
IBCWasmKeeper ibcwasmkeeper.Keeper // for IBC wasm light clients
ZoneConciergeKeeper zckeeper.Keeper // for cross-chain fungible token transfers
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
IBCFeeKeeper ibcfeekeeper.Keeper // for relayer incentivization - https://github.com/cosmos/ibc/tree/main/spec/app/ics-029-fee-payment
TransferKeeper ibctransferkeeper.Keeper // for cross-chain fungible token transfers
IBCWasmKeeper ibcwasmkeeper.Keeper // for IBC wasm light clients

// BTC staking related modules
BTCStakingKeeper btcstakingkeeper.Keeper
Expand Down Expand Up @@ -198,7 +192,6 @@ func (ak *AppKeepers) InitKeepers(
ibctransfertypes.StoreKey,
ibcfeetypes.StoreKey,
ibcwasmtypes.StoreKey,
zctypes.StoreKey,
// BTC staking related modules
btcstakingtypes.StoreKey,
finalitytypes.StoreKey,
Expand Down Expand Up @@ -291,7 +284,6 @@ func (ak *AppKeepers) InitKeepers(
// grant capabilities for the ibc and ibc-transfer modules
scopedIBCKeeper := ak.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName)
scopedTransferKeeper := ak.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
scopedZoneConciergeKeeper := ak.CapabilityKeeper.ScopeToModule(zctypes.ModuleName)
scopedWasmKeeper := ak.CapabilityKeeper.ScopeToModule(wasmtypes.ModuleName)

// Applications that wish to enforce statically created ScopedKeepers should call `Seal` after creating
Expand Down Expand Up @@ -454,38 +446,13 @@ func (ak *AppKeepers) InitKeepers(
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

// create querier for KVStore
storeQuerier, ok := bApp.CommitMultiStore().(storetypes.Queryable)
if !ok {
panic(errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "multistore doesn't support queries"))
}

ak.IBCFeeKeeper = ibcfeekeeper.NewKeeper(
appCodec, keys[ibcfeetypes.StoreKey],
ak.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware
ak.IBCKeeper.ChannelKeeper,
ak.IBCKeeper.PortKeeper, ak.AccountKeeper, ak.BankKeeper,
)

zcKeeper := zckeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[zctypes.StoreKey]),
ak.IBCFeeKeeper,
ak.IBCKeeper.ClientKeeper,
ak.IBCKeeper.ChannelKeeper,
ak.IBCKeeper.PortKeeper,
ak.AccountKeeper,
ak.BankKeeper,
&btclightclientKeeper,
&checkpointingKeeper,
&btcCheckpointKeeper,
epochingKeeper,
storeQuerier,
scopedZoneConciergeKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
ak.ZoneConciergeKeeper = *zcKeeper

// Create Transfer Keepers
ak.TransferKeeper = ibctransferkeeper.NewKeeper(
appCodec,
Expand All @@ -510,12 +477,12 @@ func (ak *AppKeepers) InitKeepers(
epochingKeeper.SetMsgServiceRouter(bApp.MsgServiceRouter())
// make ZoneConcierge and Monitor to subscribe to the epoching's hooks
ak.EpochingKeeper = *epochingKeeper.SetHooks(
epochingtypes.NewMultiEpochingHooks(ak.ZoneConciergeKeeper.Hooks(), ak.MonitorKeeper.Hooks()),
epochingtypes.NewMultiEpochingHooks(ak.MonitorKeeper.Hooks()),
)

// set up Checkpointing, BTCCheckpoint, and BTCLightclient keepers
ak.CheckpointingKeeper = *checkpointingKeeper.SetHooks(
checkpointingtypes.NewMultiCheckpointingHooks(ak.EpochingKeeper.Hooks(), ak.ZoneConciergeKeeper.Hooks(), ak.MonitorKeeper.Hooks()),
checkpointingtypes.NewMultiCheckpointingHooks(ak.EpochingKeeper.Hooks(), ak.MonitorKeeper.Hooks()),
)
ak.BtcCheckpointKeeper = btcCheckpointKeeper
ak.BTCLightClientKeeper = *btclightclientKeeper.SetHooks(
Expand Down Expand Up @@ -562,7 +529,7 @@ func (ak *AppKeepers) InitKeepers(
// If evidence needs to be handled for the app, set routes in router here and seal
ak.EvidenceKeeper = *evidenceKeeper

wasmOpts = append(owasm.RegisterCustomPlugins(&ak.EpochingKeeper, &ak.ZoneConciergeKeeper, &ak.BTCLightClientKeeper), wasmOpts...)
wasmOpts = append(owasm.RegisterCustomPlugins(&ak.EpochingKeeper, &ak.CheckpointingKeeper, &ak.BTCLightClientKeeper), wasmOpts...)

ak.WasmKeeper = wasmkeeper.NewKeeper(
appCodec,
Expand Down Expand Up @@ -609,18 +576,13 @@ func (ak *AppKeepers) InitKeepers(
transferStack = transfer.NewIBCModule(ak.TransferKeeper)
transferStack = ibcfee.NewIBCMiddleware(transferStack, ak.IBCFeeKeeper)

var zoneConciergeStack porttypes.IBCModule
zoneConciergeStack = zoneconcierge.NewIBCModule(ak.ZoneConciergeKeeper)
zoneConciergeStack = ibcfee.NewIBCMiddleware(zoneConciergeStack, ak.IBCFeeKeeper)

var wasmStack porttypes.IBCModule
wasmStack = wasm.NewIBCHandler(ak.WasmKeeper, ak.IBCKeeper.ChannelKeeper, ak.IBCFeeKeeper)
wasmStack = ibcfee.NewIBCMiddleware(wasmStack, ak.IBCFeeKeeper)

// Create static IBC router, add ibc-transfer module route, then set and seal it
ibcRouter := porttypes.NewRouter().
AddRoute(ibctransfertypes.ModuleName, transferStack).
AddRoute(zctypes.ModuleName, zoneConciergeStack).
AddRoute(wasmtypes.ModuleName, wasmStack)

// Setting Router will finalize all routes by sealing router
Expand All @@ -637,7 +599,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
// whole usage of params module
paramsKeeper.Subspace(ibcexported.ModuleName)
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(zctypes.ModuleName)

return paramsKeeper
}
9 changes: 8 additions & 1 deletion app/upgrades/v1/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,17 @@ import (
finalitytypes "github.com/babylonlabs-io/babylon/x/finality/types"
)

const (
ZoneConciergeStoreKey = "zoneconcierge"
)

var Upgrade = upgrades.Upgrade{
UpgradeName: "v1",
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
// Upgrade necessary for deletions of `zoneconcierge`
StoreUpgrades: store.StoreUpgrades{
Deleted: []string{ZoneConciergeStoreKey},
},
}

type DataSignedFps struct {
Expand Down
Loading

0 comments on commit 45d7c0c

Please sign in to comment.