Open abi87 opened 6 days ago
The changes in this pull request primarily focus on enhancing the handling of payload verification during state transitions in the blockchain process. Key modifications include the introduction of a GetConsensusSyncing
method in the ConsensusBlock
interface and the addition of a boolean parameter in the ProcessProposal
and FinalizeBlock
methods to control payload verification based on the consensus syncing state. The executeStateTransition
method in process.go
has been updated to conditionally skip payload verification when the block is not in consensus syncing mode, while retaining existing error handling and control flow.
File Path | Change Summary |
---|---|
mod/beacon/blockchain/process.go |
Updated executeStateTransition to conditionally set SkipPayloadVerification based on blk.GetConsensusSyncing() . Comments on OptimisticEngine retained. |
mod/beacon/blockchain/types.go |
Added GetConsensusSyncing() method to ConsensusBlock interface. |
mod/consensus/pkg/cometbft/service/middleware/abci.go |
Modified ProcessProposal and FinalizeBlock methods to include new boolean parameters for payload verification control during synchronization. |
mod/consensus/pkg/types/consensus_block.go |
Added isConsensusSyncing field to ConsensusBlock , updated constructor and added GetConsensusSyncing() method. |
mod/node-core/pkg/components/interfaces.go |
Introduced GetConsensusBlockHeight() and GetConsensusSyncing() methods to ConsensusBlock interface. |
process.go
file, specifically updating the return types of methods related to state transitions, which aligns with the changes made in the main PR regarding the executeStateTransition
method.ProposerAddress
parameter to the executeStateTransition
method, which is directly related to the changes made in the main PR that also modifies this method to include additional context.executeStateTransition
method and its context handling.Merge me daddy
🐰 In the blockchain's dance, we now can skip,
Payload checks when syncing takes a trip.
With methods new and logic bright,
Our consensus flows, a joyous sight!
So hop along, let’s celebrate,
For smoother transitions, isn’t it great? 🎉
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 0%
with 12 lines
in your changes missing coverage. Please review.
Project coverage is 26.27%. Comparing base (
8a04173
) to head (66a8ca1
).
@abi87 imo adding this change is not absolutely crucial for now
We verified execution payload when we verify a consensus block in
ProcessBlock
. However we also verify payload when a block finalizes viaFinalizeBlock
. A block can be made final in two cases:This PR skips the validation in case the first case (block verified and finalized). Note that a change like this has been attempted in the past. (in https://github.com/berachain/beacon-kit/pull/1234) and reverted later on (https://github.com/berachain/beacon-kit/pull/1369). I don't currently know why this perf optimization was reverted and I am inclined to test and try it again. Wonder what @calbera thinks/knows of this?
Summary by CodeRabbit
New Features
Bug Fixes
Documentation