discussions-to for: Add EIP: Linear, Page-Based Memory Costing by charles-cooper · Pull Request #9556 · ethereum/EIPs · GitHub
adding the EIP link, now that it has been merged: EIP-7923: Linear, Page-Based Memory Costing
discussions-to for: Add EIP: Linear, Page-Based Memory Costing by charles-cooper · Pull Request #9556 · ethereum/EIPs · GitHub
adding the EIP link, now that it has been merged: EIP-7923: Linear, Page-Based Memory Costing
Isn’t this advocating for removing the 63/64 rule?
Bit off topic, but yes, I think that should be removed as well.
Since memory access gets substantially more expensive after around 32MB, I considered several variants:
I think all of these fall in the realm of ‘acceptable’ solutions. I personally prefer 1, 4 or 3, in that order.
63/64 rule is still necessary if for page-based memory since this does not limit the memory of child calls. Is there an alternative mechanism that should be done. Limiting maximum memory size on a transactions level based on gas limit?
I think one of the motivations for this EIP actually is that the memory limit is invariant wrt the state of the call stack, so you don’t need to think about how allocation patterns across the call stack can affect memory usage. In this EIP, there is an implied limit of memory usage based on the gas limit, which in the current iteration of the draft, would be gas_limit * 4096 / 109
, where 4096
is the number of bytes per page, and 109
is the cost to allocate a page.
I’ve added this transaction global limit in the latest commit: Add EIP: Linear, Page-Based Memory Costing by charles-cooper · Pull Request #9556 · ethereum/EIPs · GitHub
Do you benchmarks also include clearing costs; as memory will have to be zeroed to not leak data between transactions
Yes – that’s included in the 100 gas cost to allocate+zero a page.