-
Notifications
You must be signed in to change notification settings - Fork 4.7k
add cost tracking for each bank during replay #30035
add cost tracking for each bank during replay #30035
Conversation
14b9aa7
to
3a702c7
Compare
658eddd
to
0b286e2
Compare
343ed24
to
c99fb81
Compare
To confirm,
And the last bullet is why this could affect consensus, and why we need a feature gate for this change and any subsequent modifications to these file. Is that all correct? |
Exactly, all points correct. Checking during replay prevents large-than-limits blocks from being replayed, potentially causing validators skipping slots. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things look good to me, but looks like there is a merge issue that will require resolution and thus me looking again since a ship it would get dismissed.
c99fb81
to
c8bb4d7
Compare
c8bb4d7
to
8012381
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, got the PR down to the bare minimum to introduce the feature gate!
Thank you ❤️ |
)" This reverts commit 51bace2.
Problem
Leaders use
cost_tracker
to ensure each block produced are with block limits. Same cost tracking and checking against limits should be symmetrically performed during replay, blocks exceed limits should fail replay.Summary of Changes
bank.cost_tracker.try_add(tx)
during replaying, return error if block exceeds limitsFeature Gate Issue: #29595
NOTE: Until this point, cost_model and cost_tracker are exclusively used by leaders during block packing, so we enjoyed the freedom to change how it works without worrying much about breaking consensus. With this PR, future changes to
cost_model.rs
,cost_tracker.rs
,block_cost_limits.rs
and maybe other models that would change how transaction cost measures against block limits could break consensus, therefore need to be feature gated.