Closed liamsi closed 9 months ago
In this context we also need to reserve space for the intermediate state roots: Copied from: https://github.com/lazyledger/lazyledger-core/pull/83#discussion_r513535480
relevant proposal #7750
the current approach to this is do reap more txs than can fit in the block assuming that most of them are still valid, so I think we can close this issue
Summary
Current
mempool.ReapMaxDataBytes
logic doesn't seem like the right approach for LL core as we need to reap as many Tx as shares would fit into the max square size.Problem Definition
The current mechanism needs to be based on the max square size instead of gas only: https://github.com/lazyledger/lazyledger-core/blob/6d99bdda1b59d1b1e5b6c83635ad879bfdffb19e/state/execution.go#L103-L110
Proposal
One rough idea @adlerjohn and I talked about is the following approach:
This probably terminates after one or two iterations but it would be could if can formalize this a bit further and have small proof for the upper bound of iterations.
ref: https://github.com/lazyledger/lazyledger-specs/pull/79