# Loop Attacks in Stateful Contracts

**URL:** <https://forum.scrt.network/t/loop-attacks-in-stateful-contracts/658>\
**Category:** Secret Nodes\
**Created:** [March 14, 2019, 2:33am UTC](https://forum.scrt.network/t/loop-attacks-in-stateful-contracts/658 "2019-03-14T02:33:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cardiff](https://avatars.discourse-cdn.com/v4/letter/c/c0e974/32.png) [@Cardiff](https://forum.scrt.network/u/Cardiff)\
**Post date:** [March 14, 2019, 2:33am UTC](https://forum.scrt.network/t/loop-attacks-in-stateful-contracts/658/1 "2019-03-14T02:33:17Z")

</div>

Could someone tie up a node by creating some type of loop or endless computation in a contract and running it? Or will there be some way to time out the computation?

Let’s say a computation will take an hour before it times out, how will the customer who requested the computation pay for that hour? Will ENG be put it some type of escrow and depending on how long the computation runs will charge and charge back accordingly? Or will computations be a flat fee?

If a loop attack is possible, I’m just wondering how cheap or expensive it would be for the attacker.

---

<div class="post-metadata">

**Author:** ![Zed](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.scrt.network/zed/32/187_2.png) [@Zed](https://forum.scrt.network/u/Zed)\
**Post date:** [March 14, 2019, 7:07am UTC](https://forum.scrt.network/t/loop-attacks-in-stateful-contracts/658/2 "2019-03-14T07:07:21Z")

</div>

I am pretty sure the first iteration allows anyone to run any computation, including an endless loop, so long as they have the funds to pay for the computations. There is no way to “time out” a computations, and the workers cannot choose to decline computations. See #4 here: [https://enigma.co/protocol/SubsystemArchitecture.html#payment-of-the-computation-fee](https://enigma.co/protocol/SubsystemArchitecture.html#payment-of-the-computation-fee)

The general idea for Ethereum is that it is expensive to attack the network by spamming computations. Similarly to how the Bitcoin network has been spam attacked-- it’s possible but expensive.
