Skip to content

RebondTx should accept a range of heights #93

@jaekwon

Description

@jaekwon

Rebonding fails sometimes (repeatedly) for a validator.
Suggested change:

@@ -693,7 +693,8 @@ func ExecTx(blockCache *BlockCache, tx_ types.Tx, runCall bool, evc events.Firea
                }

                // tx.Height must be equal to the next height
-               if tx.Height != _s.LastBlockHeight+1 {
+               //if tx.Height != _s.LastBlockHeight+1 {
+               if _s.LastBlockHeight-(validatorTimeoutBlocks/2) <= tx.Height <= _s.LastBlockHeight+1 {
                        return errors.New(Fmt("Invalid rebond height.  Expected %v, got %v", _s.LastBlockHeight+1, tx.Height))
                }

I don’t see any problems with this approach because RebondTx isn’t very important for consensus or light client security… it’s only when it gets committed into the blockchain that the unbonding validator becomes active again.

Thanks Ethan for spotting the logical bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T:bugType Bug (Confirmed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions