diff --git a/proto/dymensionxyz/dymension/lightclient/genesis.proto b/proto/dymensionxyz/dymension/lightclient/genesis.proto index fb0b9c3e2..98bc6c591 100644 --- a/proto/dymensionxyz/dymension/lightclient/genesis.proto +++ b/proto/dymensionxyz/dymension/lightclient/genesis.proto @@ -17,6 +17,7 @@ message HeaderSignerEntry { message GenesisState { repeated CanonicalClient canonical_clients = 1 [ (gogoproto.nullable) = false ]; repeated HeaderSignerEntry header_signers = 3 [ (gogoproto.nullable) = false ]; + repeated string hard_fork_keys = 4; } message CanonicalClient { diff --git a/x/lightclient/keeper/canonical_client.go b/x/lightclient/keeper/canonical_client.go index c5a0880ad..ba192cf50 100644 --- a/x/lightclient/keeper/canonical_client.go +++ b/x/lightclient/keeper/canonical_client.go @@ -9,6 +9,7 @@ import ( ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" "github.com/cosmos/ibc-go/v7/modules/core/exported" ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/dymensionxyz/dymension/v3/x/lightclient/types" ) @@ -62,7 +63,7 @@ func (k Keeper) GetAllCanonicalClients(ctx sdk.Context) (clients []types.Canonic return } -func (k Keeper) expectedClient(ctx sdk.Context) ibctm.ClientState { +func (k Keeper) expectedClient() ibctm.ClientState { return types.DefaultExpectedCanonicalClientParams() } @@ -77,7 +78,7 @@ func (k Keeper) validClient(ctx sdk.Context, clientID string, cs exported.Client return errChainIDMismatch } - expClient := k.expectedClient(ctx) + expClient := k.expectedClient() if err := types.IsCanonicalClientParamsValid(tmClientState, &expClient); err != nil { return errorsmod.Wrap(err, "params") diff --git a/x/lightclient/keeper/genesis.go b/x/lightclient/keeper/genesis.go index 2cc0d3c2f..155e9a290 100644 --- a/x/lightclient/keeper/genesis.go +++ b/x/lightclient/keeper/genesis.go @@ -3,6 +3,7 @@ package keeper import ( "cosmossdk.io/collections" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/dymensionxyz/dymension/v3/x/lightclient/types" ) @@ -18,13 +19,18 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genesisState types.GenesisState) { panic(err) } } + for _, rollappID := range genesisState.HardForkKeys { + k.SetHardForkInProgress(ctx, rollappID) + } } func (k Keeper) ExportGenesis(ctx sdk.Context) types.GenesisState { clients := k.GetAllCanonicalClients(ctx) + hardForkKeys := k.ListHardForkKeys(ctx) ret := types.GenesisState{ CanonicalClients: clients, + HardForkKeys: hardForkKeys, } if err := k.headerSigners.Walk(ctx, nil, diff --git a/x/lightclient/keeper/genesis_test.go b/x/lightclient/keeper/genesis_test.go index c3d240742..ac0efff28 100644 --- a/x/lightclient/keeper/genesis_test.go +++ b/x/lightclient/keeper/genesis_test.go @@ -4,9 +4,10 @@ import ( "reflect" "testing" + "github.com/stretchr/testify/require" + keepertest "github.com/dymensionxyz/dymension/v3/testutil/keeper" "github.com/dymensionxyz/dymension/v3/x/lightclient/types" - "github.com/stretchr/testify/require" ) func TestInitGenesis(t *testing.T) { @@ -18,6 +19,7 @@ func TestInitGenesis(t *testing.T) { keeper.InitGenesis(ctx, types.GenesisState{ CanonicalClients: clients, + HardForkKeys: []string{"rollapp-1", "rollapp-2"}, }) ibc, found := keeper.GetCanonicalClient(ctx, "rollapp-1") @@ -26,6 +28,10 @@ func TestInitGenesis(t *testing.T) { ibc, found = keeper.GetCanonicalClient(ctx, "rollapp-2") require.True(t, found) require.Equal(t, "client-2", ibc) + hfks := keeper.ListHardForkKeys(ctx) + require.Len(t, hfks, 2) + require.Equal(t, "rollapp-1", hfks[0]) + require.Equal(t, "rollapp-2", hfks[1]) } func TestExportGenesis(t *testing.T) { @@ -33,6 +39,8 @@ func TestExportGenesis(t *testing.T) { keeper.SetCanonicalClient(ctx, "rollapp-1", "client-1") keeper.SetCanonicalClient(ctx, "rollapp-2", "client-2") + keeper.SetHardForkInProgress(ctx, "rollapp-1") + keeper.SetHardForkInProgress(ctx, "rollapp-2") genesis := keeper.ExportGenesis(ctx) @@ -41,6 +49,9 @@ func TestExportGenesis(t *testing.T) { require.Equal(t, "client-2", genesis.CanonicalClients[1].IbcClientId) require.Equal(t, "rollapp-1", genesis.CanonicalClients[0].RollappId) require.Equal(t, "rollapp-2", genesis.CanonicalClients[1].RollappId) + require.Len(t, genesis.HardForkKeys, 2) + require.Equal(t, "rollapp-1", genesis.HardForkKeys[0]) + require.Equal(t, "rollapp-2", genesis.HardForkKeys[1]) } func TestImportExportGenesis(t *testing.T) { @@ -69,6 +80,7 @@ func TestImportExportGenesis(t *testing.T) { Height: 43, }, }, + HardForkKeys: []string{"rollapp-1", "rollapp-2"}, } k.InitGenesis(ctx, g) diff --git a/x/lightclient/keeper/keeper.go b/x/lightclient/keeper/keeper.go index f99780d20..ad2c1c685 100644 --- a/x/lightclient/keeper/keeper.go +++ b/x/lightclient/keeper/keeper.go @@ -9,13 +9,15 @@ import ( errorsmod "cosmossdk.io/errors" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/dymensionxyz/gerr-cosmos/gerrc" + "github.com/dymensionxyz/dymension/v3/internal/collcompat" "github.com/dymensionxyz/dymension/v3/x/lightclient/types" sequencertypes "github.com/dymensionxyz/dymension/v3/x/sequencer/types" - "github.com/dymensionxyz/gerr-cosmos/gerrc" ) func (k Keeper) Logger(ctx sdk.Context) log.Logger { @@ -142,9 +144,8 @@ func (k Keeper) LightClient(goCtx context.Context, req *types.QueryGetLightClien return &types.QueryGetLightClientResponse{ClientId: id}, nil } -func (k Keeper) ExpectedClientState(goCtx context.Context, req *types.QueryExpectedClientStateRequest) (*types.QueryExpectedClientStateResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - c := k.expectedClient(ctx) +func (k Keeper) ExpectedClientState(context.Context, *types.QueryExpectedClientStateRequest) (*types.QueryExpectedClientStateResponse, error) { + c := k.expectedClient() anyClient, err := ibcclienttypes.PackClientState(&c) if err != nil { return nil, errorsmod.Wrap(errors.Join(gerrc.ErrInternal, err), "pack client state") @@ -152,7 +153,7 @@ func (k Keeper) ExpectedClientState(goCtx context.Context, req *types.QueryExpec return &types.QueryExpectedClientStateResponse{ClientState: anyClient}, nil } -func (k Keeper) setHardForkInProgress(ctx sdk.Context, rollappID string) { +func (k Keeper) SetHardForkInProgress(ctx sdk.Context, rollappID string) { ctx.KVStore(k.storeKey).Set(types.HardForkKey(rollappID), []byte{0x01}) } @@ -166,6 +167,17 @@ func (k Keeper) IsHardForkingInProgress(ctx sdk.Context, rollappID string) bool return ctx.KVStore(k.storeKey).Has(types.HardForkKey(rollappID)) } +func (k Keeper) ListHardForkKeys(ctx sdk.Context) []string { + prefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.HardForkPrefix) + iter := prefixStore.Iterator(nil, nil) + defer iter.Close() // nolint: errcheck + var ret []string + for ; iter.Valid(); iter.Next() { + ret = append(ret, string(iter.Key())) + } + return ret +} + func (k Keeper) pruneSigners(ctx sdk.Context, client string, h uint64, isAbove bool) error { var rng *collections.PairRange[string, uint64] if isAbove { diff --git a/x/lightclient/keeper/rollback.go b/x/lightclient/keeper/rollback.go index 588dbdd22..b5fbfae71 100644 --- a/x/lightclient/keeper/rollback.go +++ b/x/lightclient/keeper/rollback.go @@ -44,7 +44,7 @@ func (k Keeper) RollbackCanonicalClient(ctx sdk.Context, rollappId string, newRe } // marks that hard fork is in progress - k.setHardForkInProgress(ctx, rollappId) + k.SetHardForkInProgress(ctx, rollappId) // freeze the client // it will be released after the hardfork is resolved (on the next state update) diff --git a/x/lightclient/types/genesis.go b/x/lightclient/types/genesis.go index d6c0b2399..d12d11eae 100644 --- a/x/lightclient/types/genesis.go +++ b/x/lightclient/types/genesis.go @@ -1,6 +1,6 @@ package types -import fmt "fmt" +import "fmt" func DefaultGenesisState() GenesisState { return GenesisState{ diff --git a/x/lightclient/types/genesis.pb.go b/x/lightclient/types/genesis.pb.go index 737c834f9..94c4e0e5b 100644 --- a/x/lightclient/types/genesis.pb.go +++ b/x/lightclient/types/genesis.pb.go @@ -88,6 +88,7 @@ func (m *HeaderSignerEntry) GetHeight() uint64 { type GenesisState struct { CanonicalClients []CanonicalClient `protobuf:"bytes,1,rep,name=canonical_clients,json=canonicalClients,proto3" json:"canonical_clients"` HeaderSigners []HeaderSignerEntry `protobuf:"bytes,3,rep,name=header_signers,json=headerSigners,proto3" json:"header_signers"` + HardForkKeys []string `protobuf:"bytes,4,rep,name=hard_fork_keys,json=hardForkKeys,proto3" json:"hard_fork_keys,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -137,6 +138,13 @@ func (m *GenesisState) GetHeaderSigners() []HeaderSignerEntry { return nil } +func (m *GenesisState) GetHardForkKeys() []string { + if m != nil { + return m.HardForkKeys + } + return nil +} + type CanonicalClient struct { RollappId string `protobuf:"bytes,1,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` IbcClientId string `protobuf:"bytes,2,opt,name=ibc_client_id,json=ibcClientId,proto3" json:"ibc_client_id,omitempty"` @@ -200,30 +208,32 @@ func init() { } var fileDescriptor_5520440548912168 = []byte{ - // 363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x4f, 0x4b, 0xfb, 0x40, - 0x14, 0x4c, 0x7e, 0x2d, 0xe5, 0xd7, 0xad, 0xd5, 0x76, 0x11, 0x09, 0x8a, 0xb1, 0xe4, 0x54, 0x10, - 0x12, 0xb1, 0x08, 0x5e, 0x6d, 0x11, 0xed, 0x35, 0xf5, 0xe4, 0x25, 0x24, 0x9b, 0x67, 0xb2, 0x90, - 0xee, 0xc6, 0xec, 0x56, 0x1a, 0x3f, 0x85, 0x1f, 0xab, 0xc7, 0x1e, 0xc5, 0x83, 0x48, 0xfb, 0x45, - 0x24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, 0x81, 0x85, 0x56, 0xc9, 0x4d, 0x2e, 0xfe, - 0x62, 0xf2, 0xad, 0xa9, 0xd2, 0xa6, 0x19, 0xae, 0x7d, 0x08, 0xe3, 0x0e, 0xed, 0x6d, 0xad, 0x83, - 0x8f, 0x11, 0x4a, 0x78, 0x14, 0xb9, 0x71, 0x9c, 0xb5, 0x54, 0x54, 0x59, 0x2f, 0x99, 0xa1, 0x8f, - 0x0d, 0xd4, 0xa4, 0x1e, 0x71, 0xb6, 0x7b, 0x6c, 0x50, 0x8f, 0x0c, 0xca, 0x2a, 0xfb, 0xf6, 0x6c, - 0xa1, 0xab, 0xf3, 0x85, 0xae, 0x7e, 0x2c, 0x74, 0xf5, 0x65, 0xa9, 0x2b, 0xf3, 0xa5, 0xae, 0xbc, - 0x2e, 0x75, 0xe5, 0xfe, 0x32, 0xa0, 0x32, 0x9c, 0x78, 0x26, 0xe1, 0x63, 0xeb, 0x87, 0xd3, 0x79, - 0xea, 0x59, 0xd3, 0x8d, 0xfb, 0x91, 0x69, 0x0c, 0xc2, 0xab, 0xe5, 0x47, 0xd0, 0xfb, 0x0c, 0x00, - 0x00, 0xff, 0xff, 0xb7, 0x25, 0x65, 0x00, 0x72, 0x02, 0x00, 0x00, + // 395 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcd, 0xca, 0xd3, 0x40, + 0x14, 0x4d, 0xbe, 0x94, 0x0f, 0x33, 0xdf, 0x8f, 0xed, 0x20, 0x12, 0x14, 0x63, 0x09, 0x2e, 0x02, + 0x42, 0x22, 0x16, 0xc1, 0xad, 0x2d, 0xfe, 0x14, 0x77, 0xa9, 0x2b, 0x37, 0x21, 0x99, 0xb9, 0x4d, + 0x86, 0xa6, 0x33, 0x71, 0x66, 0x2a, 0x8d, 0x2b, 0x1f, 0xc1, 0xc7, 0xea, 0xb2, 0x4b, 0x57, 0x22, + 0xed, 0x8b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xf3, 0x26, 0x6f, 0xac, 0x9a, 0xc0, 0xca, 0xb1, 0x1a, + 0x93, 0x17, 0xff, 0x63, 0xf2, 0x47, 0x53, 0x9d, 0xcd, 0x4d, 0x7e, 0xf4, 0xa1, 0xf0, 0x13, 0x74, + 0x9b, 0x27, 0x92, 0xc6, 0x73, 0x21, 0x17, 0xf1, 0x02, 0x2a, 0xe5, 0xf4, 0x86, 0x96, 0x6f, 0x47, + 0xd7, 0x35, 0xfb, 0x46, 0xc8, 0xc5, 0x7b, 0xa8, 0x94, 0xf7, 0x01, 0xdd, 0x3d, 0x5b, 0x1a, 0x3f, + 0x42, 0x48, 0x8a, 0xa2, 0x48, 0xca, 0xb2, 0xee, 0xb2, 0x2d, 0xdc, 0xee, 0x98, 0x29, 0xc5, 0x1e, + 0xba, 0x61, 0x29, 0x89, 0xcf, 0xdb, 0xbe, 0x62, 0x29, 0x99, 0x74, 0x85, 0x8f, 0xa3, 0xcd, 0xce, + 0x35, 0xb7, 0x3b, 0xd7, 0xfc, 0xb9, 0x73, 0xcd, 0x6f, 0x7b, 0xd7, 0xd8, 0xee, 0x5d, 0xe3, 0xfb, + 0xde, 0x35, 0x3e, 0xbe, 0xcc, 0x98, 0xce, 0x57, 0x69, 0x40, 0xc4, 0x32, 0xfc, 0xcb, 0x81, 0x7d, + 0x1e, 0x85, 0xeb, 0x93, 0x2b, 0xd3, 0x55, 0x09, 0x2a, 0xbd, 0x6c, 0x4e, 0x65, 0xf4, 0x2b, 0x00, + 0x00, 0xff, 0xff, 0x68, 0x01, 0x4e, 0x62, 0x98, 0x02, 0x00, 0x00, } func (m *HeaderSignerEntry) Marshal() (dAtA []byte, err error) { @@ -288,6 +298,15 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.HardForkKeys) > 0 { + for iNdEx := len(m.HardForkKeys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.HardForkKeys[iNdEx]) + copy(dAtA[i:], m.HardForkKeys[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.HardForkKeys[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } if len(m.HeaderSigners) > 0 { for iNdEx := len(m.HeaderSigners) - 1; iNdEx >= 0; iNdEx-- { { @@ -405,6 +424,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.HardForkKeys) > 0 { + for _, s := range m.HardForkKeys { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -661,6 +686,38 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HardForkKeys", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HardForkKeys = append(m.HardForkKeys, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/lightclient/types/keys.go b/x/lightclient/types/keys.go index 7cde722ff..fe49e6e16 100644 --- a/x/lightclient/types/keys.go +++ b/x/lightclient/types/keys.go @@ -13,7 +13,7 @@ const ( var ( RollappClientKey = []byte{0x01} canonicalClientKey = []byte{0x04} - hardForkKey = []byte{0x05} + HardForkPrefix = []byte{0x05} HeaderSignersPrefixKey = collections.NewPrefix("headerSigners/") ClientHeightToSigner = collections.NewPrefix("clientHeightToSigner/") ) @@ -31,7 +31,7 @@ func CanonicalClientKey(clientID string) []byte { } func HardForkKey(rollappID string) []byte { - key := hardForkKey + key := HardForkPrefix key = append(key, []byte(rollappID)...) return key } diff --git a/x/rollapp/client/cli/query_latest_height.go b/x/rollapp/client/cli/query_latest_height.go index c4ca3b51f..531696335 100644 --- a/x/rollapp/client/cli/query_latest_height.go +++ b/x/rollapp/client/cli/query_latest_height.go @@ -1,8 +1,6 @@ package cli import ( - "context" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" @@ -34,7 +32,7 @@ func CmdShowLatestHeight() *cobra.Command { Finalized: argFinalized, } - res, err := queryClient.LatestHeight(context.Background(), req) + res, err := queryClient.LatestHeight(cmd.Context(), req) if err != nil { return err } diff --git a/x/rollapp/types/fraud_proposal.pb.go b/x/rollapp/types/fraud_proposal.pb.go index 2a63ebe44..861064106 100644 --- a/x/rollapp/types/fraud_proposal.pb.go +++ b/x/rollapp/types/fraud_proposal.pb.go @@ -40,7 +40,7 @@ type MsgRollappFraudProposal struct { FraudHeight uint64 `protobuf:"varint,4,opt,name=fraud_height,json=fraudHeight,proto3" json:"fraud_height,omitempty"` // sequencer address to punish. optional PunishSequencerAddress string `protobuf:"bytes,6,opt,name=punish_sequencer_address,json=punishSequencerAddress,proto3" json:"punish_sequencer_address,omitempty"` - // rewardAddr is sdk acc addr + // rewardAddr is bech32 for sdk acc addr Rewardee string `protobuf:"bytes,7,opt,name=rewardee,proto3" json:"rewardee,omitempty"` } diff --git a/x/rollapp/types/tx.pb.go b/x/rollapp/types/tx.pb.go index e00ef5606..0d578e088 100644 --- a/x/rollapp/types/tx.pb.go +++ b/x/rollapp/types/tx.pb.go @@ -306,7 +306,7 @@ type MsgUpdateState struct { BDs BlockDescriptors `protobuf:"bytes,7,opt,name=BDs,proto3" json:"BDs"` // last is true if this is the last batch of the sequencer Last bool `protobuf:"varint,8,opt,name=last,proto3" json:"last,omitempty"` - // rollapp_revision is the revision of the rollapp chain + // rollapp_revision is the revision of the rollapp chain. increases after hard fork RollappRevision uint64 `protobuf:"varint,9,opt,name=rollapp_revision,json=rollappRevision,proto3" json:"rollapp_revision,omitempty"` }