Gas fees, among other things, make spamming expensive and thus prevent attackers to emit thousands of transactions.
Since testnets have no fees (or "free" tokens), what really prevents attackers to do such spamming ?
Gas fees, among other things, make spamming expensive and thus prevent attackers to emit thousands of transactions.
Since testnets have no fees (or "free" tokens), what really prevents attackers to do such spamming ?
I see a couple of reasons:
I don't want to link to another site but Vitalik chipped in - so no better source than him. What he said almost 10 years ago is still likely true.
"Depends what kind of "invalid" we're talking about. Invalid as in bad signature, those take constant time to detect. Invalid as in run out of gas, those are actually valid transactions - they go in the blockchain and they pay the fee at the sender's expense. - but they have the unfortunate effect of having their impact on the state reverted.
If a transaction pays for N gas (~computational steps), but takes more than N gas to execute, then the transaction can still be included in a block, but transaction execution is completely reverted, except the fee is still paid. This both prevents denial of service attacks by deliberately sending transactions that don't pay enough of a fee and removes the need for contracts to make themselves secure against attacks involving transactions that run out of gas in the middle of execution."