Skip to content

Commit cf8fb6e

Browse files
committed
revert: undo full block pool
1 parent b6058b6 commit cf8fb6e

File tree

6 files changed

+3
-378
lines changed

6 files changed

+3
-378
lines changed

AllTests-mainnet.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -636,13 +636,6 @@ AllTests-mainnet
636636
+ load phase0 state OK
637637
+ should raise on unknown data OK
638638
```
639-
## Full block pool
640-
```diff
641-
+ Add envelope OK
642-
+ Block has been seen OK
643-
+ Envelope progress OK
644-
+ Envelope status OK
645-
```
646639
## Gas limit management [Beacon Node] [Preset: mainnet]
647640
```diff
648641
+ Configuring the gas limit [Beacon Node] [Preset: mainnet] OK

beacon_chain/consensus_object_pools/full_block_pool.nim

Lines changed: 0 additions & 185 deletions
This file was deleted.

beacon_chain/gossip_processing/eth2_processor.nim

Lines changed: 1 addition & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import
1717
../spec/[helpers, forks],
1818
../consensus_object_pools/[
1919
blob_quarantine, block_clearance, block_quarantine, blockchain_dag,
20-
attestation_pool, full_block_pool, light_client_pool,
20+
attestation_pool, light_client_pool,
2121
sync_committee_msg_pool, validator_change_pool],
2222
../validators/validator_pool,
2323
../beacon_clock,
@@ -131,7 +131,6 @@ type
131131
validatorPool*: ref ValidatorPool
132132
syncCommitteeMsgPool: ref SyncCommitteeMsgPool
133133
lightClientPool: ref LightClientPool
134-
fullBlockPool: ref FullBlockPool
135134

136135
doppelgangerDetection*: DoppelgangerProtection
137136

@@ -179,7 +178,6 @@ proc new*(T: type Eth2Processor,
179178
validatorPool: ref ValidatorPool,
180179
syncCommitteeMsgPool: ref SyncCommitteeMsgPool,
181180
lightClientPool: ref LightClientPool,
182-
fullBlockPool: ref FullBlockPool,
183181
quarantine: ref Quarantine,
184182
blobQuarantine: ref BlobQuarantine,
185183
dataColumnQuarantine: ref ColumnQuarantine,
@@ -199,7 +197,6 @@ proc new*(T: type Eth2Processor,
199197
validatorPool: validatorPool,
200198
syncCommitteeMsgPool: syncCommitteeMsgPool,
201199
lightClientPool: lightClientPool,
202-
fullBlockPool: fullBlockPool,
203200
quarantine: quarantine,
204201
blobQuarantine: blobQuarantine,
205202
dataColumnQuarantine: dataColumnQuarantine,
@@ -218,65 +215,6 @@ proc new*(T: type Eth2Processor,
218215
# any side effects until the message is fully validated, or invalid messages
219216
# could be used to push out valid messages.
220217

221-
proc processExecutionPayloadEnvelope(
222-
self: var Eth2Processor,
223-
signedBlock: gloas.SignedBeaconBlock,
224-
signedEnvelope: SignedExecutionPayloadEnvelope) =
225-
## Process execution payload when both the block and envelope are found.
226-
227-
logScope:
228-
blockRoot = shortLog(signedBlock.root)
229-
builderIdx = signedEnvelope.message.builder_index
230-
231-
# only process once
232-
if self.fullBlockPool[].isEnvelopeProcessed(signedEnvelope):
233-
return
234-
235-
trace "Execution payload processing"
236-
debugGloasComment("")
237-
238-
# process complete
239-
debug "Execution payload processed"
240-
self.fullBlockPool[].markEnvelopeProcessed(signedEnvelope)
241-
self.fullBlockPool[].markBlockExecutionEnabled(signedBlock)
242-
243-
proc processExecutionPayloadEnvelope(
244-
self: var Eth2Processor,
245-
signedBlock: gloas.SignedBeaconBlock) =
246-
## Received a valid block and checking if the envelope arrives
247-
248-
# check if the envelope exists
249-
let signedEnvelope = self.fullBlockPool[].getEnvelope(signedBlock).valueOr:
250-
return
251-
252-
# validate the envelope again as it wasn't validated without the block
253-
if not self.fullBlockPool[].isEnvelopeValid(signedEnvelope):
254-
self.dag.validateExecutionPayload(self.fullBlockPool, signedEnvelope).isOkOr:
255-
return
256-
self.fullBlockPool[].markEnvelopeValid(signedEnvelope)
257-
258-
# process
259-
self.processExecutionPayloadEnvelope(signedBlock, signedEnvelope)
260-
261-
proc processExecutionPayloadEnvelope(
262-
self: var Eth2Processor,
263-
signedEnvelope: SignedExecutionPayloadEnvelope) =
264-
## Received a valid envelope and the block should be in the chain
265-
266-
# find the block from the chain
267-
let signedBlock =
268-
block:
269-
let forkedBlock = self.dag.getForkedBlock(signedEnvelope.toBlockId()).valueOr:
270-
return
271-
withBlck(forkedBlock):
272-
when consensusFork >= ConsensusFork.Gloas:
273-
forkyBlck.asSigned()
274-
else:
275-
return
276-
277-
# process
278-
self.processExecutionPayloadEnvelope(signedBlock, signedEnvelope)
279-
280218
proc processSignedBeaconBlock*(
281219
self: var Eth2Processor, src: MsgSource,
282220
signedBlock: ForkySignedBeaconBlock,
@@ -342,9 +280,6 @@ proc processSignedBeaconBlock*(
342280
else:
343281
{.error: "Unknown fork " & $consensusFork.}
344282

345-
when type(signedBlock).kind >= ConsensusFork.Gloas:
346-
self.processExecutionPayloadEnvelope(signedBlock)
347-
348283
let validationDur = nanoseconds((self.getCurrentBeaconTime() - wallTime).nanoseconds)
349284
self.blockProcessor.enqueueBlock(
350285
src, signedBlock, sidecarsOpt, maybeFinalized, validationDur
@@ -356,37 +291,6 @@ proc processSignedBeaconBlock*(
356291

357292
ok()
358293

359-
proc processExecutionPayload*(
360-
self: var Eth2Processor, src: MsgSource,
361-
signedEnvelope: SignedExecutionPayloadEnvelope):
362-
ValidationRes =
363-
let
364-
wallTime = self.getCurrentBeaconTime()
365-
(_, wallSlot) = wallTime.toSlot(self.dag.timeParams)
366-
367-
logScope:
368-
blockRoot = shortLog(signedEnvelope.message.beacon_block_root)
369-
builderIdx = signedEnvelope.message.builder_index
370-
signature = shortLog(signedEnvelope.signature)
371-
wallSlot
372-
373-
let delay = wallTime -
374-
signedEnvelope.message.slot.start_beacon_time(self.dag.timeParams)
375-
debug "Execution payload received", delay
376-
377-
# always save the envelope in case the block arrives later
378-
self.fullBlockPool[].addEnvelope(signedEnvelope)
379-
380-
self.dag.validateExecutionPayload(self.fullBlockPool, signedEnvelope).isOkOr:
381-
return err(error)
382-
383-
trace "Execution payload validated"
384-
385-
self.fullBlockPool[].markEnvelopeValid(signedEnvelope)
386-
self.processExecutionPayloadEnvelope(signedEnvelope)
387-
388-
ok()
389-
390294
proc processBlobSidecar*(
391295
self: var Eth2Processor, src: MsgSource,
392296
blobSidecar: deneb.BlobSidecar, subnet_id: BlobId): ValidationRes =

beacon_chain/nimbus_beacon_node.nim

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import
1717
eth/enr/enr,
1818
eth/p2p/discoveryv5/random2,
1919
./consensus_object_pools/[
20-
blob_quarantine, blockchain_list, full_block_pool],
20+
blob_quarantine, blockchain_list],
2121
./consensus_object_pools/vanity_logs/vanity_logs,
2222
./networking/[topic_params, network_metadata_downloads],
2323
./rpc/[rest_api, state_ttl_cache],
@@ -404,7 +404,6 @@ proc initFullNode(
404404
let
405405
quarantine = newClone(
406406
Quarantine.init(dag.cfg))
407-
fullBlockPool = newClone(FullBlockPool.init(dag, quarantine))
408407
attestationPool = newClone(AttestationPool.init(
409408
dag, quarantine, onPhase0AttestationReceived,
410409
onSingleAttestationReceived))
@@ -529,8 +528,7 @@ proc initFullNode(
529528
config.doppelgangerDetection,
530529
blockProcessor, node.validatorMonitor, dag, attestationPool,
531530
validatorChangePool, node.attachedValidators, syncCommitteeMsgPool,
532-
lightClientPool, fullBlockPool,
533-
quarantine, blobQuarantine, dataColumnQuarantine,
531+
lightClientPool, quarantine, blobQuarantine, dataColumnQuarantine,
534532
rng, getBeaconTime, taskpool)
535533
syncManagerFlags =
536534
if node.config.longRangeSync != LongRangeSyncMode.Lenient:

tests/all_tests.nim

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import # Unit test
3131
./test_eth2_rest_serialization,
3232
./test_eth2_ssz_serialization,
3333
./test_forks,
34-
./test_full_block_pool,
3534
./test_gossip_transition,
3635
./test_gossip_validation,
3736
./test_helpers,

0 commit comments

Comments
 (0)