Skip to content

Commit

Permalink
Allow new and old span propose messages only at correct heights in Po…
Browse files Browse the repository at this point in the history
…stHandle
  • Loading branch information
avalkov committed Jan 7, 2025
1 parent 37daf72 commit 1a51ea2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bor/side_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ func PostHandleMsgEventSpan(ctx sdk.Context, k Keeper, msg sdk.Msg, sideTxResult
var proposeMsg types.MsgProposeSpanV2
switch msg := msg.(type) {
case types.MsgProposeSpan:
if ctx.BlockHeight() >= helper.GetAntevortaHeight() {
k.Logger(ctx).Error("Msg span is not allowed after Antevorta hardfork height")
return common.ErrSideTxValidation(k.Codespace()).Result()
}
proposeMsg = types.MsgProposeSpanV2{
ID: msg.ID,
Proposer: msg.Proposer,
Expand All @@ -170,6 +174,10 @@ func PostHandleMsgEventSpan(ctx sdk.Context, k Keeper, msg sdk.Msg, sideTxResult
Seed: msg.Seed,
}
case types.MsgProposeSpanV2:
if ctx.BlockHeight() < helper.GetAntevortaHeight() {
k.Logger(ctx).Error("Msg span v2 is not allowed before Antevorta hardfork height")
return common.ErrSideTxValidation(k.Codespace()).Result()
}
proposeMsg = msg
}

Expand Down

0 comments on commit 1a51ea2

Please sign in to comment.