2424 cache_sync_committee_contribution_for_vc ,
2525)
2626from .consensus import (
27+ consensus_is_valid_attestation_data ,
28+ consensus_is_valid_block ,
29+ consensus_is_valid_sync_committee_contribution ,
2730 consensus_on_attestation ,
2831 consensus_on_block ,
2932 consensus_on_sync_committee_contribution ,
@@ -119,6 +122,7 @@ def serve_attestation_duty(slashing_db: SlashingDB, attestation_duty: Attestatio
119122 # Only a single consensus_on_attestation instance should be
120123 # running at any given time
121124 attestation_data = consensus_on_attestation (slashing_db , attestation_duty )
125+ assert consensus_is_valid_attestation_data (slashing_db , attestation_data , attestation_duty )
122126 # Release lock on consensus_on_attestation here.
123127 # Add attestation to slashing DB
124128 update_attestation_slashing_db (slashing_db , attestation_data , attestation_duty .pubkey )
@@ -141,6 +145,7 @@ def serve_proposer_duty(slashing_db: SlashingDB, proposer_duty: ProposerDuty) ->
141145 # Only a single consensus_on_block instance should be
142146 # running at any given time
143147 block = consensus_on_block (slashing_db , proposer_duty )
148+ assert consensus_is_valid_block (slashing_db , block , proposer_duty )
144149 # Release lock on consensus_on_block here.
145150 # Add block to slashing DB
146151 update_block_slashing_db (slashing_db , block , proposer_duty .pubkey )
@@ -158,6 +163,7 @@ def serve_sync_committee_duty(slashing_db: SlashingDB, sync_committee_duty: Sync
158163 # Only a single consensus_on_sync_committee_contribution instance should be
159164 # running at any given time
160165 sync_committee_contribution = consensus_on_sync_committee_contribution (sync_committee_duty )
166+ assert consensus_is_valid_sync_committee_contribution (sync_committee_contribution , sync_committee_duty )
161167 # Release lock on consensus_on_block here.
162168 # TODO: Update slashing DB with sync committee contribution
163169 # Cache decided sync committee contribution value to provide to VC
0 commit comments