From b49d4f5ea55134173e9402143b5cab9dc74fe8c6 Mon Sep 17 00:00:00 2001 From: zale144 Date: Wed, 6 Nov 2024 11:44:18 +0100 Subject: [PATCH 1/2] fix(rollapp): add latest height and latest finalized height to rollapp summary (#1407) --- x/rollapp/keeper/grpc_query_rollapp.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/x/rollapp/keeper/grpc_query_rollapp.go b/x/rollapp/keeper/grpc_query_rollapp.go index 8afa4eb1b..888209578 100644 --- a/x/rollapp/keeper/grpc_query_rollapp.go +++ b/x/rollapp/keeper/grpc_query_rollapp.go @@ -67,10 +67,21 @@ func getSummaryResponse(ctx sdk.Context, k Keeper, rollapp types.Rollapp, ok, wi latestStateInfoIndex, found := k.GetLatestStateInfoIndex(ctx, rollapp.RollappId) if found { s.LatestStateIndex = &latestStateInfoIndex + + latestStateInfo, foundFin := k.GetStateInfo(ctx, rollapp.RollappId, latestStateInfoIndex.Index) + if foundFin { + s.LatestHeight = latestStateInfo.GetLatestHeight() + } } - latestFinalizedStateInfoIndex, found := k.GetLatestFinalizedStateIndex(ctx, rollapp.RollappId) - if found { + + latestFinalizedStateInfoIndex, foundFinIdx := k.GetLatestFinalizedStateIndex(ctx, rollapp.RollappId) + if foundFinIdx { s.LatestFinalizedStateIndex = &latestFinalizedStateInfoIndex + + latestFinalizedStateInfo, foundFin := k.GetStateInfo(ctx, rollapp.RollappId, latestFinalizedStateInfoIndex.Index) + if foundFin { + s.LatestFinalizedHeight = latestFinalizedStateInfo.GetLatestHeight() + } } resp := &types.QueryGetRollappResponse{ From ea79caf41821e2d23693a491074071f864fe40b4 Mon Sep 17 00:00:00 2001 From: Michael Tsitrin <114929630+mtsitrin@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:56:50 +0200 Subject: [PATCH 2/2] fix(crisis): Fix crisis module wiring (#1424) --- app/keepers/keepers.go | 8 ++++---- scripts/src/genesis_config_commands.sh | 1 - x/delayedack/client/cli/query.go | 9 ++++++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 984c0a897..26bf98cfe 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -189,10 +189,6 @@ func (a *AppKeepers) InitKeepers( a.CapabilityKeeper.Seal() - a.CrisisKeeper = crisiskeeper.NewKeeper( - appCodec, a.keys[crisistypes.StoreKey], invCheckPeriod, a.BankKeeper, authtypes.FeeCollectorName, govModuleAddress, - ) - a.UpgradeKeeper = upgradekeeper.NewKeeper( skipUpgradeHeights, a.keys[upgradetypes.StoreKey], @@ -226,6 +222,10 @@ func (a *AppKeepers) InitKeepers( govModuleAddress, ) + a.CrisisKeeper = crisiskeeper.NewKeeper( + appCodec, a.keys[crisistypes.StoreKey], invCheckPeriod, a.BankKeeper, authtypes.FeeCollectorName, govModuleAddress, + ) + a.StakingKeeper = stakingkeeper.NewKeeper( appCodec, a.keys[stakingtypes.StoreKey], diff --git a/scripts/src/genesis_config_commands.sh b/scripts/src/genesis_config_commands.sh index 16feffebf..884f7f567 100644 --- a/scripts/src/genesis_config_commands.sh +++ b/scripts/src/genesis_config_commands.sh @@ -17,7 +17,6 @@ set_hub_params() { jq '.app_state.rollapp.params.dispute_period_in_blocks = "50"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE" - jq '.app_state.sequencer.params.unbonding_time = "1209600s"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE" jq '.app_state.sequencer.params.notice_period = "60s"' "$GENESIS_FILE" > "$tmp" && mv "$tmp" "$GENESIS_FILE" #increase the tx size cost per byte from 10 to 100 diff --git a/x/delayedack/client/cli/query.go b/x/delayedack/client/cli/query.go index 1451de912..fbda768bd 100644 --- a/x/delayedack/client/cli/query.go +++ b/x/delayedack/client/cli/query.go @@ -8,6 +8,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" + sdk "github.com/cosmos/cosmos-sdk/types" + commontypes "github.com/dymensionxyz/dymension/v3/x/common/types" "github.com/dymensionxyz/dymension/v3/x/delayedack/types" ) @@ -223,7 +225,7 @@ func CmdGetPendingPacketsByAddress() *cobra.Command { cmd := &cobra.Command{ Use: "pending-packets-by-address [address]", Short: "Get pending packets by address", - Args: cobra.MinimumNArgs(1), + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { @@ -231,6 +233,11 @@ func CmdGetPendingPacketsByAddress() *cobra.Command { } queryClient := types.NewQueryClient(clientCtx) + _, err = sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + res, err := queryClient.GetPendingPacketsByAddress(cmd.Context(), &types.QueryPendingPacketsByAddressRequest{ Address: args[0], Pagination: nil, // TODO: handle pagination