Skip to content

Commit

Permalink
Update EIP-7609: update security considerations with reference points
Browse files Browse the repository at this point in the history
Merged by EIP-Bot.
  • Loading branch information
charles-cooper authored Mar 21, 2024
1 parent 810c347 commit 8135bcc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions EIPS/eip-7609.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ One of the most important use cases that EIP-1153 enables is cheap reentrancy pr

Furthermore, it seems that transient storage is fundamentally overpriced. Its pricing does not interact with refunds, it only requires a new allocation on contract load (as opposed to memory, which requires a fresh allocation on every call), and has no interaction with the physical database.

This EIP proposes a pricing model which charges additional gas per allocation, which is cheaper for common cases (fewer than 33 slots are written per contract), while making DoS using transient storage prohibitively expensive.
This EIP proposes a pricing model which charges additional gas per allocation, which is cheaper for common cases (fewer than ~95 slots are written per contract), while making DoS using transient storage prohibitively expensive.

## Specification

Expand Down Expand Up @@ -73,7 +73,9 @@ num_calls_per_txn = block_gas_limit // gas_used_by_contract ~= 8.8
max_transient_slots = num_calls_per_txn * num_slots == 22927
```

Thus, the maximum number of transient slots which can be allocated in a single transaction with this method is roughly 23,000, which totals 736KB. Note that this cap scales linearly with the gas limit, which is a useful property when considering future block gas limit increases.
Thus, the maximum number of transient slots which can be allocated in a single transaction with this method is roughly 23,000, which totals 736KB. Compared to the current gas schedule (which allows allocating approximately `30_000_000 / 100 * 32 == 9.6MB` worth of memory), this is a net *reduction* in the total memory which can be allocated on a client using transient storage, so this EIP presents a stronger bound on the resources which can be used by transient storage. As a comparison point, the total amount of memory which can be allocated on a client by `SSTORE`s in a given transaction is `30_000_000 / 20_000 * 32`, or 48KB.

Note that this cap scales linearly with the gas limit, which is a useful property when considering future block gas limit increases.

## Copyright

Expand Down

0 comments on commit 8135bcc

Please sign in to comment.