-
Notifications
You must be signed in to change notification settings - Fork 354
gloas beacon_block gossip rules #10040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gloas beacon_block gossip rules #10040
Conversation
|
I don't mind this approach actually, I am questioning a bit every rule as a separate class, can probably group some of those who may never change into one and then having more fork specific separately. |
We definitely can group some rules under a single class (at least those that are always applied for all forks or those checking the same data like the slot related ones...) and we could also make the rules interfaces functional and implement the checks in lambdas (less files but less testable too). |
I like the approach, the operations are O(1) and is easier to see what is happening. |
.../java/tech/pegasys/teku/statetransition/validation/block/rules/deneb/KzgCommitmentsRule.java
Show resolved
Hide resolved
|
Closing in favour of #10140 |
PR Description
This PR refactors the monolithic
BlockGossipValidatorinto a more flexible, maintainable, and testable two-stage pipeline architecture. The new design addresses the challenges of adding fork-specific validation logic and improves the clarity of the validation process.Stateless Pipeline: Executes fast, preliminary checks (e.g., slot checks, parent known, equivocation peek) without needing the parent state.
Stateful Pipeline: Executes slower, state-dependent checks (e.g., signature verification, proposer index) only if the stateless checks pass.
Each validation check is now a small, single-responsibility class implementing either
StatelessValidationRuleorStatefulValidationRuledepending on if it needs a parent state access or not.The new
ForkValidationPipelinesclass composes these rules into ordered lists for each consensus fork, making fork-specific logic explicit and easy to manage.Fixed Issue(s)
#10064
Documentation
doc-change-requiredlabel to this PR if updates are required.Changelog
Note
Refactors block gossip validation into modular, fork-aware stateless/stateful pipelines with a separate equivocation checker, updating integrations and tests accordingly.
StatefulValidationRuleandStatelessValidationRuleinterfaces and per-fork rule sets viaBlockGossipValidationPipelines.validation.BlockGossipValidatorwithvalidation.block.BlockGossipValidatorthat executes stateless then stateful pipelines.EquivocationCheckerandSlotAndProposerIndex; removes old inline equivocation tracking.FutureSlotRule,BlockParent*,ExpectedProposerRule,ProposerSignatureRule, etc.), Bellatrix (ExecutionPayloadTimestampRule), Deneb (KzgCommitmentsRule), and Gloas (ExecutionPayloadParent*Rule).BeaconChainControllerandSyncingNodeManagerto buildBlockGossipValidatorwithEquivocationChecker.BlockBroadcastValidator/Implto reference newvalidation.blockclasses andEquivocationCheckerresults.Written by Cursor Bugbot for commit d32db74. This will update automatically on new commits. Configure here.