Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
aa5c453
add binary
hard-nett Feb 12, 2025
7e67c69
Merge branch 'bitsongofficial:main' into main
hard-nett Mar 3, 2025
da0ebba
patch: replace cosmos-sdk, bump cometbft
Mar 10, 2025
8c1d0c9
dev: prep for v022 upgrade
Mar 10, 2025
e2aba36
remove binary
Mar 10, 2025
1fe5a81
dev: add custom export cli command
Mar 10, 2025
db258a5
dev: update ed25519 library used in-place-testnet
Mar 10, 2025
54b0f55
bump: add debug mod instructions
Mar 10, 2025
36b5561
logs: update replace docs
Mar 10, 2025
d259750
fix testnet issues
antstalepresh Mar 11, 2025
8a94295
Merge pull request #7 from antstalepresh/fix/testnet
hard-nett Mar 11, 2025
8817d90
docs
Mar 11, 2025
cff2de4
readd v021 upgradeHandler for in-place-testnet
Mar 11, 2025
4ec330a
add historical custom upgrade patch logic
Mar 11, 2025
c72ca38
dev: remove unnecessary x/account feegrant query
Mar 11, 2025
bbd8a08
dev: bumps to upggradeHandler logs & tests
Mar 11, 2025
dc38640
dev: bump export custom
Mar 11, 2025
64d02b0
dev: return err instead of panic, require no error in tests
Mar 11, 2025
8a3bce1
add default replace, bump docker alpine version
Mar 12, 2025
34ea59c
go mod tidy
Mar 12, 2025
a14dc3d
wip: retain broken validator in testnet for patch assertion
Mar 20, 2025
73d635b
wip: retain validator in staking store
Mar 21, 2025
5d819f8
tests: 1 log file printed for debugging v022 upgradeHandler, added up…
Mar 21, 2025
e1b1b11
Merge pull request #8 from permissionlessweb/v022-custom-testnet
hard-nett Mar 21, 2025
290c4d3
dev: access appKeepers from top level app
Mar 21, 2025
9460fe8
Merge pull request #9 from permissionlessweb/keeper-bump
hard-nett Mar 21, 2025
263a92c
test: add unbonded control validator to unit tests
Apr 12, 2025
6476cfd
spellcheck
May 10, 2025
1f6418c
[email protected], implement x/protocol-pool
May 10, 2025
c5672c6
register protocol pool in our app modules basic manager
May 10, 2025
15a441c
4444
May 10, 2025
7ee279f
ict: impl x/protocolpool tests
May 10, 2025
3e70aba
protocol-pool test
May 10, 2025
1dc9872
uncomment tests
May 10, 2025
9232ccd
init protocolpool keeper prior to distribution keeper
May 10, 2025
1561af6
Merge branch 'bitsongofficial:main' into v0.22.0-rc
hard-nett May 10, 2025
424ccd2
saftey
May 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build \
&& (file /code/build/bitsongd | grep "statically linked")

# --------------------------------------------------------
FROM alpine:3.16
FROM alpine:3.17

COPY --from=go-builder /code/build/bitsongd /usr/bin/bitsongd

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ help:

APP_DIR = ./app
BINDIR ?= $(GOPATH)/bin
BUILDDIR ?= $(CURDIR)/build

PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
PACKAGES_UNITTEST=$(shell go list ./... | grep -v '/simulation' | grep -v '/cli_test')
Expand All @@ -40,7 +41,6 @@ COMMIT := $(shell git log -1 --format='%H')

LEDGER_ENABLED ?= true
SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
BUILDDIR ?= $(CURDIR)/build

TENDERMINT_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::') # grab everything after the space in "github.com/tendermint/tendermint v0.34.7"

Expand Down
160 changes: 92 additions & 68 deletions app/app.go

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (app *BitsongApp) ExportAppStateAndValidators(
return servertypes.ExportedApp{}, err
}

validators, err := staking.WriteValidators(ctx, app.AppKeepers.StakingKeeper)
validators, err := staking.WriteValidators(ctx, app.StakingKeeper)
if err != nil {
return servertypes.ExportedApp{}, err
}
Expand Down Expand Up @@ -72,21 +72,21 @@ func (app *BitsongApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddr
}

/* Just to be safe, assert the invariants on current state. */
app.AppKeepers.CrisisKeeper.AssertInvariants(ctx)
app.CrisisKeeper.AssertInvariants(ctx)

/* Handle fee distribution state. */

// withdraw all validator commission
app.AppKeepers.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) {
_, err := app.AppKeepers.DistrKeeper.WithdrawValidatorCommission(ctx, sdk.ValAddress(val.GetOperator()))
app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) {
_, err := app.DistrKeeper.WithdrawValidatorCommission(ctx, sdk.ValAddress(val.GetOperator()))
if err != nil {
panic(err)
}
return false
})

// withdraw all delegator rewards
dels, err := app.AppKeepers.StakingKeeper.GetAllDelegations(ctx)
dels, err := app.StakingKeeper.GetAllDelegations(ctx)
if err != nil {
panic(err)
}
Expand All @@ -100,34 +100,34 @@ func (app *BitsongApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddr
if err != nil {
panic(err)
}
_, _ = app.AppKeepers.DistrKeeper.WithdrawDelegationRewards(ctx, delAddr, valAddr)
_, _ = app.DistrKeeper.WithdrawDelegationRewards(ctx, delAddr, valAddr)
}

// clear validator slash events
app.AppKeepers.DistrKeeper.DeleteAllValidatorSlashEvents(ctx)
app.DistrKeeper.DeleteAllValidatorSlashEvents(ctx)

// clear validator historical rewards
app.AppKeepers.DistrKeeper.DeleteAllValidatorHistoricalRewards(ctx)
app.DistrKeeper.DeleteAllValidatorHistoricalRewards(ctx)

// set context height to zero
height := ctx.BlockHeight()
ctx = ctx.WithBlockHeight(0)

// reinitialize all validators
app.AppKeepers.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) {
app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) {
// donate any unwithdrawn outstanding reward fraction tokens to the community pool
scraps, err := app.AppKeepers.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, sdk.ValAddress(val.GetOperator()))
scraps, err := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, sdk.ValAddress(val.GetOperator()))
if err != nil {
panic(err)
}
feePool, err := app.AppKeepers.DistrKeeper.FeePool.Get(ctx)
feePool, err := app.DistrKeeper.FeePool.Get(ctx)
if err != nil {
panic(err)
}
feePool.CommunityPool = feePool.CommunityPool.Add(scraps...)
app.AppKeepers.DistrKeeper.FeePool.Set(ctx, feePool)
app.DistrKeeper.FeePool.Set(ctx, feePool)

app.AppKeepers.DistrKeeper.Hooks().AfterValidatorCreated(ctx, sdk.ValAddress(val.GetOperator()))
app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, sdk.ValAddress(val.GetOperator()))
return false
})

Expand All @@ -141,8 +141,8 @@ func (app *BitsongApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddr
if err != nil {
panic(err)
}
app.AppKeepers.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr)
app.AppKeepers.DistrKeeper.Hooks().AfterDelegationModified(ctx, delAddr, valAddr)
app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr)
app.DistrKeeper.Hooks().AfterDelegationModified(ctx, delAddr, valAddr)
}

// reset context height
Expand All @@ -151,20 +151,20 @@ func (app *BitsongApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddr
/* Handle staking state. */

// iterate through redelegations, reset creation height
app.AppKeepers.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) {
app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) {
for i := range red.Entries {
red.Entries[i].CreationHeight = 0
}
app.AppKeepers.StakingKeeper.SetRedelegation(ctx, red)
app.StakingKeeper.SetRedelegation(ctx, red)
return false
})

// iterate through unbonding delegations, reset creation height
app.AppKeepers.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) {
app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) {
for i := range ubd.Entries {
ubd.Entries[i].CreationHeight = 0
}
app.AppKeepers.StakingKeeper.SetUnbondingDelegation(ctx, ubd)
app.StakingKeeper.SetUnbondingDelegation(ctx, ubd)
return false
})

Expand All @@ -176,7 +176,7 @@ func (app *BitsongApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddr

for ; iter.Valid(); iter.Next() {
addr := sdk.ValAddress(iter.Key()[1:])
validator, err := app.AppKeepers.StakingKeeper.GetValidator(ctx, addr)
validator, err := app.StakingKeeper.GetValidator(ctx, addr)
if err != nil {
panic("expected validator, not found")
}
Expand All @@ -186,24 +186,24 @@ func (app *BitsongApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddr
validator.Jailed = true
}

app.AppKeepers.StakingKeeper.SetValidator(ctx, validator)
app.StakingKeeper.SetValidator(ctx, validator)
counter++
}

iter.Close()

if _, err := app.AppKeepers.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx); err != nil {
if _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx); err != nil {
panic(err)
}

/* Handle slashing state. */

// reset start height on signing infos
app.AppKeepers.SlashingKeeper.IterateValidatorSigningInfos(
app.SlashingKeeper.IterateValidatorSigningInfos(
ctx,
func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) {
info.StartHeight = 0
app.AppKeepers.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info)
app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info)
return false
},
)
Expand Down
Loading
Loading