Skip to content

Commit a7c3735

Browse files
committed
Return an error in case when total block complexity exceeds limit.
1 parent b95ac07 commit a7c3735

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/state/appender.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,9 @@ func (a *txAppender) checkScriptsLimits(scriptsRuns uint64, blockID proto.BlockI
275275
}
276276
maxBlockComplexity := NewMaxScriptsComplexityInBlock().GetMaxScriptsComplexityInBlock(rideV5Activated)
277277
if a.sc.getTotalComplexity() > uint64(maxBlockComplexity) {
278-
// TODO this is definitely an error, should return it
279-
zap.S().Warnf("Complexity of scripts (%d) in block '%s' exceeds limit of %d", a.sc.getTotalComplexity(), blockID.String(), maxBlockComplexity)
278+
return errors.Errorf("complexity of scripts (%d) in block '%s' exceeds limit of %d",
279+
a.sc.getTotalComplexity(), blockID.String(), maxBlockComplexity,
280+
)
280281
}
281282
return nil
282283
} else if smartAccountsActivated {

0 commit comments

Comments
 (0)