diff --git a/.changesets/allow-max-revision.md b/.changesets/allow-max-revision.md new file mode 100644 index 0000000..a9057e0 --- /dev/null +++ b/.changesets/allow-max-revision.md @@ -0,0 +1,7 @@ +--- +default: minor +--- + +# Allow revisions to set MaxRevisionNumber + +`MaxRevisionNumber` was previously used to finalize contracts, but that is not the case anymore, so the restriction can be removed. \ No newline at end of file diff --git a/consensus/validation.go b/consensus/validation.go index 61f09e6..ee5e80d 100644 --- a/consensus/validation.go +++ b/consensus/validation.go @@ -761,10 +761,6 @@ func validateV2FileContracts(ms *MidState, txn types.V2Transaction) error { return fmt.Errorf("file contract revision %v parent (%v) %s", i, fcr.Parent.ID, err) } else if cur.ProofHeight < ms.base.childHeight() { return fmt.Errorf("file contract revision %v cannot be applied to contract after proof height (%v)", i, cur.ProofHeight) - } else if rev.RevisionNumber == types.MaxRevisionNumber { - // NOTE: disallowing this means that resolutions always take - // precedence over revisions - return fmt.Errorf("file contract revision %v resolves contract", i) } else if err := validateRevision(fcr.Parent, rev); err != nil { return fmt.Errorf("file contract revision %v %s", i, err) } diff --git a/consensus/validation_test.go b/consensus/validation_test.go index d1d8842..c4cbf93 100644 --- a/consensus/validation_test.go +++ b/consensus/validation_test.go @@ -1128,13 +1128,6 @@ func TestValidateV2Block(t *testing.T) { txn.NewFoundationAddress = &addr }, }, - { - "revision that resolves contract", - func(b *types.Block) { - txn := &b.V2.Transactions[0] - txn.FileContractRevisions[0].Revision.RevisionNumber = types.MaxRevisionNumber - }, - }, { "revision with window that starts in past", func(b *types.Block) {