Skip to content

Commit

Permalink
Revert "fix case where manager would panic when adding v1 transaction…
Browse files Browse the repository at this point in the history
… after v2 require height"

This reverts commit 2b881e6.
  • Loading branch information
lukechampine committed Feb 17, 2024
1 parent 2b881e6 commit 49a5d88
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions chain/manager.go
Expand Up @@ -14,9 +14,6 @@ import (
var (
// ErrFutureBlock is returned when a block's timestamp is too far in the future.
ErrFutureBlock = errors.New("block's timestamp is too far in the future")
// ErrV1AfterV2Required is returned when a v1 transaction is introduced after
// v2 transactions are required.
ErrV1AfterV2Required = errors.New("v1 transaction added after v2 require height")
)

// An ApplyUpdate reflects the changes to the blockchain resulting from the
Expand Down Expand Up @@ -299,9 +296,6 @@ func (m *Manager) applyTip(index types.ChainIndex) error {
panic("applyTip called with non-attaching block")
} else if bs == nil {
bs = new(consensus.V1BlockSupplement)
if cs.Index.Height > cs.Network.HardforkV2.RequireHeight && len(b.Transactions) > 0 {
return ErrV1AfterV2Required
}
*bs = m.store.SupplementTipBlock(b)
if err := consensus.ValidateBlock(m.tipState, b, *bs); err != nil {
m.markBadBlock(index.ID, err)
Expand Down Expand Up @@ -991,10 +985,6 @@ func (m *Manager) AddPoolTransactions(txns []types.Transaction) (known bool, err
return true, m.txpool.invalidTxnSets[setID]
}

if m.tipState.Index.Height > m.tipState.Network.HardforkV2.RequireHeight {
return false, m.markBadTxnSet(setID, fmt.Errorf("transactions are invalid: %w", ErrV1AfterV2Required))
}

// validate as a standalone set
ms := consensus.NewMidState(m.tipState)
for _, txn := range txns {
Expand Down

0 comments on commit 49a5d88

Please sign in to comment.