Post
Topic
Board Development & Technical Discussion
Re: Fixed length loops for scripts
by
nybble41
on 02/05/2013, 00:41:16 UTC
Sure, but under what circumstances would anyone care about the cost of a script which they wouldn't be running anyway?
It would allow a transaction to be dropped quickly without having to actually run the script.
The savings from that approach seem negligible. You still have to design the system to handle the worst case, which is a script just short enough to get past the filter. A malicious attacker would design the script to use the maximum amount of time without triggering the filter, so you have the cost of the script plus the cost of checking its complexity. The only case where you would save anything would be where someone accidentally created a script which requires too much time or memory, which should be rare (akin to creating malformed scripts which fail on valid input for other reasons).