Skip to content

Commit

Permalink
fix(rollapp liveness): rename last state update height to liveness co…
Browse files Browse the repository at this point in the history
…untdown start height (#1512)
  • Loading branch information
danwt authored Nov 20, 2024
1 parent beb11a2 commit 64e217b
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 73 deletions.
14 changes: 7 additions & 7 deletions app/upgrades/v4/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,13 @@ func ConvertOldRollappToNew(oldRollapp rollapptypes.Rollapp) rollapptypes.Rollap
Tagline: "",
FeeDenom: nil,
},
GenesisInfo: genesisInfo,
InitialSequencer: "*",
VmType: rollapptypes.Rollapp_EVM, // EVM for existing rollapps
Launched: true, // Existing rollapps are already launched
PreLaunchTime: nil, // We can just let it be zero. Existing rollapps are already launched.
LivenessEventHeight: 0, // Filled lazily in runtime
LastStateUpdateHeight: 0, // Filled lazily in runtime
GenesisInfo: genesisInfo,
InitialSequencer: "*",
VmType: rollapptypes.Rollapp_EVM, // EVM for existing rollapps
Launched: true, // Existing rollapps are already launched
PreLaunchTime: nil, // We can just let it be zero. Existing rollapps are already launched.
LivenessEventHeight: 0, // Filled lazily in runtime
LivenessCountdownStartHeight: 0, // Filled lazily in runtime
Revisions: []rollapptypes.Revision{{
Number: 0,
StartHeight: 0,
Expand Down
6 changes: 3 additions & 3 deletions proto/dymensionxyz/dymension/rollapp/rollapp.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ message Rollapp {
// LivenessEventHeight is the height on the HUB of an upcoming liveness event (slash or
// jail against the rollapp). 0 means not set
int64 liveness_event_height = 17;
// The LastStateUpdateHeight HUB height when the last state update was
// received
int64 last_state_update_height = 18;
// The height on the HUB that we start counting liveness from. If the rollapp is not active
// for a long time after this height, a liveness event will happen.
int64 liveness_countdown_start_height = 18;

// Revisions is a list of all the rollapp revisions.
repeated Revision revisions = 19 [ (gogoproto.nullable) = false ];
Expand Down
4 changes: 2 additions & 2 deletions x/rollapp/keeper/liveness.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (k Keeper) IndicateLiveness(ctx sdk.Context, ra *types.Rollapp) {
// Modifies the passed-in rollapp object.
func (k Keeper) ResetLivenessClock(ctx sdk.Context, ra *types.Rollapp) {
k.DelLivenessEvents(ctx, ra.LivenessEventHeight, ra.RollappId)
ra.LastStateUpdateHeight = ctx.BlockHeight()
ra.LivenessCountdownStartHeight = ctx.BlockHeight()
ra.LivenessEventHeight = 0
}

Expand All @@ -91,7 +91,7 @@ func (k Keeper) ScheduleLivenessEvent(ctx sdk.Context, ra *types.Rollapp) {
params.LivenessSlashBlocks,
params.LivenessSlashInterval,
ctx.BlockHeight(),
ra.LastStateUpdateHeight,
ra.LivenessCountdownStartHeight,
)
ra.LivenessEventHeight = nextH
k.PutLivenessEvent(ctx, types.LivenessEvent{
Expand Down
122 changes: 61 additions & 61 deletions x/rollapp/types/rollapp.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 64e217b

Please sign in to comment.