Improve ProposerVM Window-er #1292
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Looking for someone to address this
warp
Milestone
When building a ProposerVM header for a block, the block builder can select any P-Chain height that is >= the parent P-Chain height. Nodes will consider the block valid iff they have accepted the P-Chain block at that height.
When the ProposerVM builds a new post-fork block: https://github.com/ava-labs/avalanchego/blob/master/vms/proposervm/block.go#L177
It calculates the optimal P-Chain Height here: https://github.com/ava-labs/avalanchego/blob/master/vms/proposervm/block.go#L191 by using the maximum of the parent proposervm header height (must be >= than the parent as mentioned above) and the result of
GetMinimumHeight
reported by the P-Chain: https://github.com/ava-labs/avalanchego/blob/master/vms/proposervm/vm.go#L779.GetMinimumHeight
uses a window of blocks accepted within the last 5 minutes where the "tip" of the window uses wall clock time to determine when to evict blocks that are >= 5 minutes old.This is intended as an optimization to ensure that if two nodes disagree slightly about the accepted tip of the P-Chain, they should in the happy path still agree on a block that was accepted X amount of time ago (5 minutes with the current code).
This issue is to suggest two possible changes:
Improvement (1) is based on the observation that 5 minutes is very high and we should be able to reduce the size of the window, which will reduce the cost of diff set calculations at a minimal cost. This is an optimization in the spirit of, if you never miss a flight, then you're wasting time at the airport.
Improvement (2) should improve fault isolation for the ProposerVM in the case that no blocks have been accepted on the P-Chain in the last 5 minutes, the current behavior is to use the last accepted block. Instead, we should use the timestamp of the last accepted block on the P-Chain as the tip of the window-er. This will ensure that on the happy path, block building will keep using a slightly older block with respect to the tip of the P-Chain as opposed to falling back to the current height after wall clock time advances 5 minutes.
The text was updated successfully, but these errors were encountered: