Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
71354ee
feat: add unknown payload envelope sync flow
wemeetagain Apr 20, 2026
1076647
fix: requeue incomplete gloas block inputs
wemeetagain Apr 21, 2026
bb509e7
chore: lint fix
wemeetagain Apr 21, 2026
555d6c3
chore: add some comments
wemeetagain Apr 21, 2026
06e9a8a
test: improve unknown block payload sync coverage
wemeetagain Apr 21, 2026
16356ac
fix: preserve queued payload envelopes
wemeetagain Apr 21, 2026
a791964
feat: implement EIP-7843 slot_number in ExecutionPayload (specs#4840)
ensi321 Apr 20, 2026
3958681
Revert changes introduced by accident
ensi321 Apr 21, 2026
a912bc8
Bump version, skip fast_confirmation
ensi321 Apr 20, 2026
03c4349
Rest of the changes
ensi321 Apr 21, 2026
d3d74a9
Skip some tests
ensi321 Apr 21, 2026
40b5f9f
lint
ensi321 Apr 21, 2026
da7cc41
ethspecify
ensi321 Apr 21, 2026
e49b699
lint
ensi321 Apr 21, 2026
813cb52
ethspecify
ensi321 Apr 21, 2026
845bec9
fix unit test
ensi321 Apr 22, 2026
1d15ece
fix e2e
ensi321 Apr 22, 2026
c3d429d
address comment
ensi321 Apr 22, 2026
afbb9c1
feat: add processParentExecutionPayload and remove withdrawal early r…
ensi321 Apr 15, 2026
311eeca
refactor: add processParentExecutionPayload as first step in processB…
ensi321 Apr 15, 2026
e2d3ad2
refactor: transform processExecutionPayloadEnvelope to pure verification
ensi321 Apr 15, 2026
c3c73b4
refactor: remove executionPayloadStateRoot from fork choice onExecuti…
ensi321 Apr 15, 2026
bc621c3
refactor: simplify envelope import pipeline for deferred processing
ensi321 Apr 15, 2026
f4d4021
feat: block production, gossip validation, and cleanup for deferred p…
ensi321 Apr 15, 2026
63e5271
fix: type errors in processParentExecutionPayload and produceBlockBody
ensi321 Apr 15, 2026
06ab9c1
Fix spec test
ensi321 Apr 16, 2026
6552bc8
Address comments & follow up on spec change
ensi321 Apr 16, 2026
e10d287
fix upgrade state
ensi321 Apr 17, 2026
5421487
fix spec test
ensi321 Apr 20, 2026
b5937ec
Harmonize
ensi321 Apr 22, 2026
a0bbecf
Merge remote-tracking branch 'origin/unstable' into nc/defer-payload-…
nflaig Apr 22, 2026
941a710
review
nflaig Apr 22, 2026
532ffcc
ethspecify
nflaig Apr 22, 2026
16941ff
restore some comments
nflaig Apr 22, 2026
b21400b
Merge remote-tracking branch 'origin/nc/defer-payload-processing' int…
wemeetagain Apr 22, 2026
e12a16e
fix: address payload envelope review feedback
wemeetagain Apr 22, 2026
6b08376
Remove block production
ensi321 Apr 22, 2026
8967ae5
refactor
nflaig Apr 23, 2026
5b1e344
simplify applyParentExecutionPayload function signature
nflaig Apr 23, 2026
9a9fe6b
remove genesis block handling, will be separate pr
nflaig Apr 23, 2026
b07b363
Merge branch 'unstable' into nc/defer-payload-processing
nflaig Apr 23, 2026
bf7009e
we don't know and it's wrong, removed confusing todo
nflaig Apr 23, 2026
d2424d5
review computeAnchorCheckpoint
nflaig Apr 23, 2026
9bf5103
review fork_choice.test.ts
nflaig Apr 23, 2026
08b2712
revert changes to computeAnchorCheckpoint
nflaig Apr 23, 2026
e62a7a1
ahhh damn, we need that for spec tests
nflaig Apr 23, 2026
8acf7c8
remove type cast
nflaig Apr 23, 2026
24a3da5
clarify withdrawals
nflaig Apr 23, 2026
a04a4d0
review getExpectedWithdrawalsForFullParent
nflaig Apr 23, 2026
2fa1c4f
review processParentExecutionPayload.ts
nflaig Apr 23, 2026
b89af0b
review operations.test.ts
nflaig Apr 23, 2026
c2ef8aa
final pass on processParentExecutionPayload
nflaig Apr 23, 2026
78a7201
small nit
nflaig Apr 23, 2026
f8c73af
fix order of gossip checks
nflaig Apr 23, 2026
e399921
clarify comment
nflaig Apr 23, 2026
56f686c
review import
nflaig Apr 23, 2026
f78ca51
test: run unknown block harness on gloas
wemeetagain Apr 23, 2026
7728204
Update packages/beacon-node/src/chain/blocks/types.ts
nflaig Apr 23, 2026
11f9d16
Update packages/beacon-node/test/spec/presets/fork_choice.test.ts
nflaig Apr 23, 2026
2054188
Update packages/state-transition/src/block/index.ts
nflaig Apr 23, 2026
2a7d8e6
Update packages/state-transition/src/block/processWithdrawals.ts
nflaig Apr 23, 2026
372f485
.
nflaig Apr 23, 2026
6218a8e
wording
nflaig Apr 23, 2026
e450f52
restore some comments
nflaig Apr 23, 2026
232e294
ok that's it
nflaig Apr 23, 2026
e7759b0
not yet
nflaig Apr 23, 2026
c06c946
why is that comment even modified...
nflaig Apr 23, 2026
037c066
fix: address payload sync review feedback
wemeetagain Apr 23, 2026
1d7e898
Merge branch 'nc/defer-payload-processing' into cayman/recover-pruned…
wemeetagain Apr 23, 2026
a1dcf20
fix: handle envelope verification payload errors
wemeetagain Apr 23, 2026
b2765b0
Merge branch 'unstable' into cayman/recover-pruned-payload-inputs
wemeetagain Apr 24, 2026
6db66a8
fix: align payload envelope cache pruning with unstable
wemeetagain Apr 24, 2026
8cd0683
chore: make diff smaller
wemeetagain Apr 24, 2026
0b098f7
Merge branch 'unstable' into cayman/recover-pruned-payload-inputs
nflaig Apr 24, 2026
1f98405
chore: remove stray merge conflict
wemeetagain Apr 24, 2026
a2f9c4b
Merge remote-tracking branch 'origin/unstable' into cayman/recover-pr…
wemeetagain Apr 24, 2026
2b08e78
chore: fix merge
wemeetagain Apr 24, 2026
c9c64b0
chore: add unknown block sync gloas e2e tests
wemeetagain Apr 24, 2026
be00edb
chore: fix check-types
wemeetagain Apr 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/beacon-node/src/api/impl/beacon/blocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,10 @@ export function getBeaconBlockApi({
chain
.processBlock(blockForImport, opts)
.catch((e) => {
if (e instanceof BlockError && e.type.code === BlockErrorCode.PARENT_UNKNOWN) {
if (
e instanceof BlockError &&
(e.type.code === BlockErrorCode.PARENT_UNKNOWN || e.type.code === BlockErrorCode.PARENT_PAYLOAD_UNKNOWN)
) {
chain.emitter.emit(ChainEvent.blockUnknownParent, {
blockInput: blockForImport,
peer: IDENTITY_PEER_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,24 @@ export function verifyBlocksSanityChecks(
} else {
// When importing a block segment, only the first NON-IGNORED block must be known to the fork-choice.
const parentRoot = toRootHex(block.message.parentRoot);
parentBlock = isGloasBeaconBlock(block.message)
? chain.forkChoice.getBlockHexAndBlockHash(
parentRoot,
toRootHex(block.message.body.signedExecutionPayloadBid.message.parentBlockHash)
)
: chain.forkChoice.getBlockHexDefaultStatus(parentRoot);
if (!parentBlock) {
const parentBlockDefaultStatus = chain.forkChoice.getBlockHexDefaultStatus(parentRoot);
if (!parentBlockDefaultStatus) {
throw new BlockError(block, {code: BlockErrorCode.PARENT_UNKNOWN, parentRoot});
}

parentBlock = parentBlockDefaultStatus;
if (isGloasBeaconBlock(block.message)) {
const parentBlockHash = toRootHex(block.message.body.signedExecutionPayloadBid.message.parentBlockHash);
const parentBlockWithPayload = chain.forkChoice.getBlockHexAndBlockHash(parentRoot, parentBlockHash);
if (!parentBlockWithPayload) {
throw new BlockError(block, {
code: BlockErrorCode.PARENT_PAYLOAD_UNKNOWN,
parentRoot,
parentBlockHash,
});
}
parentBlock = parentBlockWithPayload;
}
// Parent is known to the fork-choice
parentBlockSlot = parentBlock.slot;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/beacon-node/src/metrics/metrics/lodestar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,10 @@ export function createLodestarMetrics(
name: "lodestar_sync_unknown_block_pending_blocks_size",
help: "Current size of UnknownBlockSync pending blocks cache",
}),
pendingPayloads: register.gauge({
name: "lodestar_sync_unknown_block_pending_payloads_size",
help: "Current size of UnknownBlockSync pending payloads cache",
}),
knownBadBlocks: register.gauge({
name: "lodestar_sync_unknown_block_known_bad_blocks_size",
help: "Current size of UnknownBlockSync known bad blocks cache",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
} catch (e) {
if (e instanceof BlockGossipError) {
logger.debug("Gossip block has error", {slot, root: blockShortHex, code: e.type.code});
if (e.type.code === BlockErrorCode.PARENT_UNKNOWN && blockInput) {
if (
(e.type.code === BlockErrorCode.PARENT_UNKNOWN || e.type.code === BlockErrorCode.PARENT_PAYLOAD_UNKNOWN) &&
blockInput
) {
chain.emitter.emit(ChainEvent.blockUnknownParent, {
blockInput,
peer: peerIdStr,
Expand Down
72 changes: 72 additions & 0 deletions packages/beacon-node/src/sync/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import {RootHex, Slot} from "@lodestar/types";
import {SignedExecutionPayloadEnvelope} from "@lodestar/types/gloas";
import {toRootHex} from "@lodestar/utils";
import {IBlockInput} from "../chain/blocks/blockInput/index.js";
import {PayloadEnvelopeInput} from "../chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js";

export enum PendingBlockType {
/**
Expand All @@ -26,6 +29,14 @@ export enum PendingBlockInputStatus {
processing = "processing",
}

export enum PendingPayloadInputStatus {
pending = "pending",
fetching = "fetching",
waitingForBlock = "waiting_for_block",
downloaded = "downloaded",
processing = "processing",
}

export type PendingBlockInput = {
status: PendingBlockInputStatus;
blockInput: IBlockInput;
Expand All @@ -44,14 +55,75 @@ export type PendingRootHex = {

export type BlockInputSyncCacheItem = PendingBlockInput | PendingRootHex;

export type PendingPayloadInput = {
status:
| PendingPayloadInputStatus.pending
| PendingPayloadInputStatus.fetching
| PendingPayloadInputStatus.downloaded
| PendingPayloadInputStatus.processing;
payloadInput: PayloadEnvelopeInput;
timeAddedSec: number;
timeSyncedSec?: number;
peerIdStrings: Set<string>;
};

export type PendingPayloadRootHex = {
status: PendingPayloadInputStatus.pending | PendingPayloadInputStatus.fetching;
rootHex: RootHex;
timeAddedSec: number;
timeSyncedSec?: number;
peerIdStrings: Set<string>;
};

export type PendingPayloadEnvelope = {
status: PendingPayloadInputStatus.waitingForBlock;
envelope: SignedExecutionPayloadEnvelope;
timeAddedSec: number;
peerIdStrings: Set<string>;
};

export type PayloadSyncCacheItem = PendingPayloadInput | PendingPayloadRootHex | PendingPayloadEnvelope;

export function isPendingBlockInput(pending: BlockInputSyncCacheItem): pending is PendingBlockInput {
return "blockInput" in pending;
}

export function isPendingPayloadInput(pending: PayloadSyncCacheItem): pending is PendingPayloadInput {
return "payloadInput" in pending;
}

export function isPendingPayloadEnvelope(pending: PayloadSyncCacheItem): pending is PendingPayloadEnvelope {
return "envelope" in pending;
}

export function getBlockInputSyncCacheItemRootHex(block: BlockInputSyncCacheItem): RootHex {
return isPendingBlockInput(block) ? block.blockInput.blockRootHex : block.rootHex;
}

export function getBlockInputSyncCacheItemSlot(block: BlockInputSyncCacheItem): Slot | string {
return isPendingBlockInput(block) ? block.blockInput.slot : "unknown";
}

export function getPayloadSyncCacheItemRootHex(payload: PayloadSyncCacheItem): RootHex {
if (isPendingPayloadInput(payload)) {
return payload.payloadInput.blockRootHex;
}

if (isPendingPayloadEnvelope(payload)) {
return toRootHex(payload.envelope.message.beaconBlockRoot);
}

return payload.rootHex;
}

export function getPayloadSyncCacheItemSlot(payload: PayloadSyncCacheItem): Slot | string {
if (isPendingPayloadInput(payload)) {
return payload.payloadInput.slot;
}

if (isPendingPayloadEnvelope(payload)) {
return payload.envelope.message.payload.slotNumber;
}

return "unknown";
}
Loading
Loading