You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider adding new rule for blocks: if the height difference of the block and last final block (see block_header.inner_rest.last_final_block field) is >= 15, its gas limit must be zero.
This implies that no txs/receipts (even delayed) will be processed in this block. It serves several purposes:
If blocks are not finalized for a long time, we don’t know for sure which fork will be final. Thus it doesn’t make sense to do heavy computations in long forks, because they can be discarded in the future.
During consensus lags, empty blocks help to reach consensus faster, because their computational complexity is low and we rely only on the network here.
(FS-related purpose) We want to charge storage_read fees proportional to 2 disk reads. During consensus lag we may need more disk reads, because FS represents only one fork. We could store more data on disk or use Trie instead, but it would lead to big undercharging. But if there are no txs/receipts to process, there is no undercharging :)
The check should just iterate over parents, until we reach the last final block or the height difference becomes >= 15. Last block headers should be cached somewhere to avoid additional disk reads. 15 is chosen to limit summary size of flat storage deltas properly. However, we may want to check this delta on real blocks and consider other values.
The text was updated successfully, but these errors were encountered:
Longarithm
changed the title
Set block gas limit to zero during consensus lag
Consider setting block gas limit to zero in case of delayed finality
Jan 25, 2023
NEP draft: near/NEPs#460
Consider adding new rule for blocks: if the height difference of the block and last final block (see block_header.inner_rest.last_final_block field) is >= 15, its gas limit must be zero.
This implies that no txs/receipts (even delayed) will be processed in this block. It serves several purposes:
The check should just iterate over parents, until we reach the last final block or the height difference becomes >= 15. Last block headers should be cached somewhere to avoid additional disk reads. 15 is chosen to limit summary size of flat storage deltas properly. However, we may want to check this delta on real blocks and consider other values.
The text was updated successfully, but these errors were encountered: