@lodestar/beacon-node 1.43.0-dev.b741495bdc → 1.43.0-dev.b7d69444c9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js +1 -10
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js.map +1 -1
- package/lib/chain/chain.d.ts +2 -1
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +7 -0
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/interface.d.ts +2 -1
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +30 -10
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +3 -2
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +27 -13
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +11 -4
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +20 -18
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +749 -2
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/chain/blocks/writePayloadEnvelopeInputToDb.ts +8 -17
- package/src/chain/chain.ts +12 -0
- package/src/chain/interface.ts +2 -0
- package/src/chain/prepareNextSlot.ts +42 -12
- package/src/chain/produceBlock/produceBlockBody.ts +30 -11
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +22 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topic.d.ts","sourceRoot":"","sources":["../../../src/network/gossip/topic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAEL,QAAQ,EAMT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAE,iBAAiB,EAAmB,MAAM,iBAAiB,CAAC;AAEjF,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAiB,WAAW,EAAE,kBAAkB,EAAE,UAAU,EAAE,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AAEjH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAAC;CACzC;AAED,qBAAa,gBAAiB,YAAW,iBAAiB;IAG5C,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAF9C,OAAO,CAAC,gBAAgB,CAA4C;IAEpE,YAA6B,iBAAiB,EAAE,iBAAiB,EAAI;IAErE,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAQtC;IAED,8DAA8D;IAC9D,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEvD;IAED,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAInD;CACF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,CAKrG;AA8BD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW
|
|
1
|
+
{"version":3,"file":"topic.d.ts","sourceRoot":"","sources":["../../../src/network/gossip/topic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAEL,QAAQ,EAMT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAE,iBA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.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.43.0-dev.
|
|
14
|
+
"version": "1.43.0-dev.b7d69444c9",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -135,18 +135,18 @@
|
|
|
135
135
|
"@libp2p/peer-id": "^6.0.4",
|
|
136
136
|
"@libp2p/prometheus-metrics": "^5.0.14",
|
|
137
137
|
"@libp2p/tcp": "^11.0.13",
|
|
138
|
-
"@lodestar/api": "^1.43.0-dev.
|
|
139
|
-
"@lodestar/config": "^1.43.0-dev.
|
|
140
|
-
"@lodestar/db": "^1.43.0-dev.
|
|
141
|
-
"@lodestar/fork-choice": "^1.43.0-dev.
|
|
142
|
-
"@lodestar/light-client": "^1.43.0-dev.
|
|
143
|
-
"@lodestar/logger": "^1.43.0-dev.
|
|
144
|
-
"@lodestar/params": "^1.43.0-dev.
|
|
145
|
-
"@lodestar/reqresp": "^1.43.0-dev.
|
|
146
|
-
"@lodestar/state-transition": "^1.43.0-dev.
|
|
147
|
-
"@lodestar/types": "^1.43.0-dev.
|
|
148
|
-
"@lodestar/utils": "^1.43.0-dev.
|
|
149
|
-
"@lodestar/validator": "^1.43.0-dev.
|
|
138
|
+
"@lodestar/api": "^1.43.0-dev.b7d69444c9",
|
|
139
|
+
"@lodestar/config": "^1.43.0-dev.b7d69444c9",
|
|
140
|
+
"@lodestar/db": "^1.43.0-dev.b7d69444c9",
|
|
141
|
+
"@lodestar/fork-choice": "^1.43.0-dev.b7d69444c9",
|
|
142
|
+
"@lodestar/light-client": "^1.43.0-dev.b7d69444c9",
|
|
143
|
+
"@lodestar/logger": "^1.43.0-dev.b7d69444c9",
|
|
144
|
+
"@lodestar/params": "^1.43.0-dev.b7d69444c9",
|
|
145
|
+
"@lodestar/reqresp": "^1.43.0-dev.b7d69444c9",
|
|
146
|
+
"@lodestar/state-transition": "^1.43.0-dev.b7d69444c9",
|
|
147
|
+
"@lodestar/types": "^1.43.0-dev.b7d69444c9",
|
|
148
|
+
"@lodestar/utils": "^1.43.0-dev.b7d69444c9",
|
|
149
|
+
"@lodestar/validator": "^1.43.0-dev.b7d69444c9",
|
|
150
150
|
"@multiformats/multiaddr": "^13.0.1",
|
|
151
151
|
"datastore-core": "^11.0.2",
|
|
152
152
|
"datastore-fs": "^11.0.2",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"@libp2p/interface-internal": "^3.0.13",
|
|
170
170
|
"@libp2p/logger": "^6.2.2",
|
|
171
171
|
"@libp2p/utils": "^7.0.13",
|
|
172
|
-
"@lodestar/spec-test-util": "^1.43.0-dev.
|
|
172
|
+
"@lodestar/spec-test-util": "^1.43.0-dev.b7d69444c9",
|
|
173
173
|
"@types/js-yaml": "^4.0.5",
|
|
174
174
|
"@types/qs": "^6.9.7",
|
|
175
175
|
"@types/tmp": "^0.2.3",
|
|
@@ -186,5 +186,5 @@
|
|
|
186
186
|
"beacon",
|
|
187
187
|
"blockchain"
|
|
188
188
|
],
|
|
189
|
-
"gitHead": "
|
|
189
|
+
"gitHead": "a9cd886b22ad132505dfecd67e3a643f261e0ffc"
|
|
190
190
|
}
|
|
@@ -33,23 +33,14 @@ export async function persistPayloadEnvelopeInput(
|
|
|
33
33
|
this: BeaconChain,
|
|
34
34
|
payloadInput: PayloadEnvelopeInput
|
|
35
35
|
): Promise<void> {
|
|
36
|
-
await writePayloadEnvelopeInputToDb
|
|
37
|
-
.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"Error persisting payload envelope in hot db",
|
|
41
|
-
{
|
|
42
|
-
slot: payloadInput.slot,
|
|
43
|
-
root: payloadInput.blockRootHex,
|
|
44
|
-
},
|
|
45
|
-
e
|
|
46
|
-
);
|
|
47
|
-
})
|
|
48
|
-
.finally(() => {
|
|
49
|
-
this.seenPayloadEnvelopeInputCache.prune(payloadInput.blockRootHex);
|
|
50
|
-
this.logger.debug("Pruned payload envelope input", {
|
|
36
|
+
await writePayloadEnvelopeInputToDb.call(this, payloadInput).catch((e) => {
|
|
37
|
+
this.logger.error(
|
|
38
|
+
"Error persisting payload envelope in hot db",
|
|
39
|
+
{
|
|
51
40
|
slot: payloadInput.slot,
|
|
52
41
|
root: payloadInput.blockRootHex,
|
|
53
|
-
}
|
|
54
|
-
|
|
42
|
+
},
|
|
43
|
+
e
|
|
44
|
+
);
|
|
45
|
+
});
|
|
55
46
|
}
|
package/src/chain/chain.ts
CHANGED
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
ValidatorIndex,
|
|
40
40
|
Wei,
|
|
41
41
|
deneb,
|
|
42
|
+
electra,
|
|
42
43
|
gloas,
|
|
43
44
|
isBlindedBeaconBlock,
|
|
44
45
|
phase0,
|
|
@@ -886,6 +887,17 @@ export class BeaconChain implements IBeaconChain {
|
|
|
886
887
|
);
|
|
887
888
|
}
|
|
888
889
|
|
|
890
|
+
async getParentExecutionRequests(
|
|
891
|
+
parentBlockSlot: Slot,
|
|
892
|
+
parentBlockRootHex: RootHex
|
|
893
|
+
): Promise<electra.ExecutionRequests> {
|
|
894
|
+
const envelope = await this.getExecutionPayloadEnvelope(parentBlockSlot, parentBlockRootHex);
|
|
895
|
+
if (envelope === null) {
|
|
896
|
+
throw Error(`Parent execution payload envelope not found slot=${parentBlockSlot}, root=${parentBlockRootHex}`);
|
|
897
|
+
}
|
|
898
|
+
return envelope.message.executionRequests;
|
|
899
|
+
}
|
|
900
|
+
|
|
889
901
|
async getDataColumnSidecars(blockSlot: Slot, blockRootHex: string): Promise<DataColumnSidecar[]> {
|
|
890
902
|
const fork = this.config.getForkName(blockSlot);
|
|
891
903
|
|
package/src/chain/interface.ts
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
altair,
|
|
19
19
|
capella,
|
|
20
20
|
deneb,
|
|
21
|
+
electra,
|
|
21
22
|
gloas,
|
|
22
23
|
phase0,
|
|
23
24
|
rewards,
|
|
@@ -231,6 +232,7 @@ export interface IBeaconChain {
|
|
|
231
232
|
blockSlot: Slot,
|
|
232
233
|
blockRootHex: string
|
|
233
234
|
): Promise<gloas.SignedExecutionPayloadEnvelope | null>;
|
|
235
|
+
getParentExecutionRequests(parentBlockSlot: Slot, parentBlockRootHex: RootHex): Promise<electra.ExecutionRequests>;
|
|
234
236
|
|
|
235
237
|
produceCommonBlockBody(blockAttributes: BlockAttributes): Promise<CommonBlockBody>;
|
|
236
238
|
produceBlock(blockAttributes: BlockAttributes & {commonBlockBodyPromise: Promise<CommonBlockBody>}): Promise<{
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
isStatePostBellatrix,
|
|
11
11
|
isStatePostGloas,
|
|
12
12
|
} from "@lodestar/state-transition";
|
|
13
|
-
import {Bytes32, Slot} from "@lodestar/types";
|
|
13
|
+
import {Bytes32, Slot, electra} from "@lodestar/types";
|
|
14
14
|
import {Logger, fromHex, isErrorAborted, sleep} from "@lodestar/utils";
|
|
15
15
|
import {GENESIS_SLOT, ZERO_HASH_HEX} from "../constants/constants.js";
|
|
16
16
|
import {BuilderStatus} from "../execution/builder/http.js";
|
|
@@ -83,7 +83,7 @@ export class PrepareNextSlotScheduler {
|
|
|
83
83
|
const headBlock = this.chain.recomputeForkChoiceHead(ForkchoiceCaller.prepareNextSlot);
|
|
84
84
|
const {slot: headSlot, blockRoot: headRoot} = headBlock;
|
|
85
85
|
// may be updated below if we predict a proposer-boost-reorg
|
|
86
|
-
let
|
|
86
|
+
let updatedHead = headBlock;
|
|
87
87
|
|
|
88
88
|
// PS: previously this was comparing slots, but that gave no leway on the skipped
|
|
89
89
|
// slots on epoch bounday. Making it more fluid.
|
|
@@ -148,7 +148,7 @@ export class PrepareNextSlotScheduler {
|
|
|
148
148
|
{dontTransferCache: !isEpochTransition},
|
|
149
149
|
RegenCaller.predictProposerHead
|
|
150
150
|
);
|
|
151
|
-
|
|
151
|
+
updatedHead = proposerHead;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
// Update the builder status, if enabled shoot an api call to check status
|
|
@@ -165,14 +165,19 @@ export class PrepareNextSlotScheduler {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
let parentBlockHash: Bytes32;
|
|
168
|
+
let isExtendingPayload = false;
|
|
168
169
|
if (isStatePostGloas(updatedPrepareState)) {
|
|
169
|
-
|
|
170
|
+
isExtendingPayload = this.chain.forkChoice.shouldExtendPayload(updatedHead.blockRoot);
|
|
171
|
+
parentBlockHash = isExtendingPayload
|
|
170
172
|
? updatedPrepareState.latestExecutionPayloadBid.blockHash
|
|
171
173
|
: updatedPrepareState.latestExecutionPayloadBid.parentBlockHash;
|
|
172
174
|
} else {
|
|
173
175
|
parentBlockHash = updatedPrepareState.latestExecutionPayloadHeader.blockHash;
|
|
174
176
|
}
|
|
175
177
|
|
|
178
|
+
// Reused by the SSE emit below to avoid a second DB lookup on cache miss
|
|
179
|
+
let parentExecutionRequests: electra.ExecutionRequests | undefined;
|
|
180
|
+
|
|
176
181
|
if (feeRecipient) {
|
|
177
182
|
const preparationTime =
|
|
178
183
|
computeTimeAtSlot(this.config, prepareSlot, this.chain.genesisTime) - Date.now() / 1000;
|
|
@@ -182,6 +187,13 @@ export class PrepareNextSlotScheduler {
|
|
|
182
187
|
const finalizedBlockHash =
|
|
183
188
|
this.chain.forkChoice.getFinalizedBlock().executionPayloadBlockHash ?? ZERO_HASH_HEX;
|
|
184
189
|
|
|
190
|
+
if (isExtendingPayload) {
|
|
191
|
+
parentExecutionRequests = await this.chain.getParentExecutionRequests(
|
|
192
|
+
updatedHead.slot,
|
|
193
|
+
updatedHead.blockRoot
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
185
197
|
// awaiting here instead of throwing an async call because there is no other task
|
|
186
198
|
// left for scheduler and this gives nice semantics to catch and log errors in the
|
|
187
199
|
// try/catch wrapper here.
|
|
@@ -189,12 +201,13 @@ export class PrepareNextSlotScheduler {
|
|
|
189
201
|
this.chain,
|
|
190
202
|
this.logger,
|
|
191
203
|
fork as ForkPostBellatrix, // State is of execution type
|
|
192
|
-
fromHex(
|
|
204
|
+
fromHex(updatedHead.blockRoot),
|
|
193
205
|
parentBlockHash,
|
|
194
206
|
safeBlockHash,
|
|
195
207
|
finalizedBlockHash,
|
|
196
208
|
updatedPrepareState,
|
|
197
|
-
feeRecipient
|
|
209
|
+
feeRecipient,
|
|
210
|
+
parentExecutionRequests
|
|
198
211
|
);
|
|
199
212
|
this.logger.verbose("PrepareNextSlotScheduler prepared new payload", {
|
|
200
213
|
prepareSlot,
|
|
@@ -203,21 +216,38 @@ export class PrepareNextSlotScheduler {
|
|
|
203
216
|
});
|
|
204
217
|
}
|
|
205
218
|
|
|
219
|
+
if (ForkSeq[fork] >= ForkSeq.gloas) {
|
|
220
|
+
// Cutoff = slot of the parent of the block we'll actually build on (post-reorg).
|
|
221
|
+
// Steady state: cache holds just 2 entries — head (parent for next-slot production)
|
|
222
|
+
// and head.parent (proposer-boost-reorg fallback). Anything older is evicted.
|
|
223
|
+
const updatedHeadParent = this.chain.forkChoice.getBlockHexDefaultStatus(updatedHead.parentRoot);
|
|
224
|
+
if (updatedHeadParent) {
|
|
225
|
+
this.chain.seenPayloadEnvelopeInputCache.pruneBelow(updatedHeadParent.slot);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
206
229
|
this.computeStateHashTreeRoot(updatedPrepareState, isEpochTransition);
|
|
207
230
|
|
|
208
|
-
// If emitPayloadAttributes is true emit a SSE payloadAttributes event
|
|
231
|
+
// If emitPayloadAttributes is true emit a SSE payloadAttributes event for
|
|
232
|
+
// every slot. Without the flag, only emit the event if we are proposing in the next slot.
|
|
209
233
|
if (
|
|
210
|
-
this.chain.opts.emitPayloadAttributes === true &&
|
|
234
|
+
(feeRecipient || this.chain.opts.emitPayloadAttributes === true) &&
|
|
211
235
|
this.chain.emitter.listenerCount(routes.events.EventType.payloadAttributes)
|
|
212
236
|
) {
|
|
237
|
+
// if we didn't fetch above (not proposing), SSE still needs it here
|
|
238
|
+
if (!parentExecutionRequests && isExtendingPayload) {
|
|
239
|
+
parentExecutionRequests = await this.chain.getParentExecutionRequests(
|
|
240
|
+
updatedHead.slot,
|
|
241
|
+
updatedHead.blockRoot
|
|
242
|
+
);
|
|
243
|
+
}
|
|
213
244
|
const data = getPayloadAttributesForSSE(fork as ForkPostBellatrix, this.chain, {
|
|
214
245
|
prepareState: updatedPrepareState,
|
|
215
246
|
prepareSlot,
|
|
216
|
-
parentBlockRoot: fromHex(
|
|
247
|
+
parentBlockRoot: fromHex(updatedHead.blockRoot),
|
|
217
248
|
parentBlockHash,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
feeRecipient: "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
249
|
+
feeRecipient: feeRecipient ?? "0x0000000000000000000000000000000000000000",
|
|
250
|
+
parentExecutionRequests,
|
|
221
251
|
});
|
|
222
252
|
this.chain.emitter.emit(routes.events.EventType.payloadAttributes, {data, version: fork});
|
|
223
253
|
}
|
|
@@ -214,9 +214,13 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
214
214
|
});
|
|
215
215
|
|
|
216
216
|
// Get execution payload from EL
|
|
217
|
-
const
|
|
217
|
+
const isExtendingPayload = this.forkChoice.shouldExtendPayload(toRootHex(parentBlockRoot));
|
|
218
|
+
const parentBlockHash = isExtendingPayload
|
|
218
219
|
? currentState.latestExecutionPayloadBid.blockHash
|
|
219
220
|
: currentState.latestExecutionPayloadBid.parentBlockHash;
|
|
221
|
+
const parentExecutionRequests = isExtendingPayload
|
|
222
|
+
? await this.getParentExecutionRequests(parentBlock.slot, parentBlock.blockRoot)
|
|
223
|
+
: ssz.electra.ExecutionRequests.defaultValue();
|
|
220
224
|
const prepareRes = await prepareExecutionPayload(
|
|
221
225
|
this,
|
|
222
226
|
this.logger,
|
|
@@ -226,7 +230,8 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
226
230
|
safeBlockHash,
|
|
227
231
|
finalizedBlockHash ?? ZERO_HASH_HEX,
|
|
228
232
|
currentState,
|
|
229
|
-
feeRecipient
|
|
233
|
+
feeRecipient,
|
|
234
|
+
parentExecutionRequests
|
|
230
235
|
);
|
|
231
236
|
|
|
232
237
|
const {prepType, payloadId} = prepareRes;
|
|
@@ -282,7 +287,7 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
282
287
|
gloasBody.signedExecutionPayloadBid = signedBid;
|
|
283
288
|
// TODO GLOAS: Get payload attestations from pool for previous slot
|
|
284
289
|
gloasBody.payloadAttestations = [];
|
|
285
|
-
|
|
290
|
+
gloasBody.parentExecutionRequests = parentExecutionRequests;
|
|
286
291
|
blockBody = gloasBody as AssembledBodyType<T>;
|
|
287
292
|
|
|
288
293
|
// Store execution payload data required to construct execution payload envelope later
|
|
@@ -619,7 +624,8 @@ export async function prepareExecutionPayload(
|
|
|
619
624
|
safeBlockHash: RootHex,
|
|
620
625
|
finalizedBlockHash: RootHex,
|
|
621
626
|
state: IBeaconStateViewBellatrix,
|
|
622
|
-
suggestedFeeRecipient: string
|
|
627
|
+
suggestedFeeRecipient: string,
|
|
628
|
+
parentExecutionRequests?: electra.ExecutionRequests
|
|
623
629
|
): Promise<{prepType: PayloadPreparationType; payloadId: PayloadId}> {
|
|
624
630
|
const timestamp = computeTimeAtSlot(chain.config, state.slot, state.genesisTime);
|
|
625
631
|
const prevRandao = state.getRandaoMix(state.epoch);
|
|
@@ -656,6 +662,7 @@ export async function prepareExecutionPayload(
|
|
|
656
662
|
parentBlockRoot,
|
|
657
663
|
parentBlockHash,
|
|
658
664
|
feeRecipient: suggestedFeeRecipient,
|
|
665
|
+
parentExecutionRequests,
|
|
659
666
|
});
|
|
660
667
|
|
|
661
668
|
payloadId = await chain.executionEngine.notifyForkchoiceUpdate(
|
|
@@ -714,12 +721,14 @@ export function getPayloadAttributesForSSE(
|
|
|
714
721
|
parentBlockRoot,
|
|
715
722
|
parentBlockHash,
|
|
716
723
|
feeRecipient,
|
|
724
|
+
parentExecutionRequests,
|
|
717
725
|
}: {
|
|
718
726
|
prepareState: IBeaconStateViewBellatrix;
|
|
719
727
|
prepareSlot: Slot;
|
|
720
728
|
parentBlockRoot: Root;
|
|
721
729
|
parentBlockHash: Bytes32;
|
|
722
730
|
feeRecipient: string;
|
|
731
|
+
parentExecutionRequests?: electra.ExecutionRequests;
|
|
723
732
|
}
|
|
724
733
|
): SSEPayloadAttributes {
|
|
725
734
|
const payloadAttributes = preparePayloadAttributes(fork, chain, {
|
|
@@ -728,6 +737,7 @@ export function getPayloadAttributesForSSE(
|
|
|
728
737
|
parentBlockRoot,
|
|
729
738
|
parentBlockHash,
|
|
730
739
|
feeRecipient,
|
|
740
|
+
parentExecutionRequests,
|
|
731
741
|
});
|
|
732
742
|
|
|
733
743
|
let parentBlockNumber: number;
|
|
@@ -766,12 +776,14 @@ function preparePayloadAttributes(
|
|
|
766
776
|
parentBlockRoot,
|
|
767
777
|
parentBlockHash,
|
|
768
778
|
feeRecipient,
|
|
779
|
+
parentExecutionRequests,
|
|
769
780
|
}: {
|
|
770
781
|
prepareState: IBeaconStateViewBellatrix;
|
|
771
782
|
prepareSlot: Slot;
|
|
772
783
|
parentBlockRoot: Root;
|
|
773
784
|
parentBlockHash: Bytes32;
|
|
774
785
|
feeRecipient: string;
|
|
786
|
+
parentExecutionRequests?: electra.ExecutionRequests;
|
|
775
787
|
}
|
|
776
788
|
): SSEPayloadAttributes["payloadAttributes"] {
|
|
777
789
|
const timestamp = computeTimeAtSlot(chain.config, prepareSlot, prepareState.genesisTime);
|
|
@@ -789,13 +801,20 @@ function preparePayloadAttributes(
|
|
|
789
801
|
|
|
790
802
|
if (isStatePostGloas(prepareState)) {
|
|
791
803
|
const isExtendingPayload = byteArrayEquals(parentBlockHash, prepareState.latestExecutionPayloadBid.blockHash);
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
804
|
+
if (isExtendingPayload) {
|
|
805
|
+
if (parentExecutionRequests === undefined) {
|
|
806
|
+
throw new Error("parentExecutionRequests required when extending full parent");
|
|
807
|
+
}
|
|
808
|
+
(payloadAttributes as capella.SSEPayloadAttributes["payloadAttributes"]).withdrawals =
|
|
809
|
+
prepareState.getExpectedWithdrawalsForFullParent(parentExecutionRequests);
|
|
810
|
+
} else {
|
|
811
|
+
// When the parent block is empty, state.payloadExpectedWithdrawals holds a batch
|
|
812
|
+
// already deducted from CL balances but never credited on the EL (the envelope
|
|
813
|
+
// was not delivered). The next payload must carry those same withdrawals to
|
|
814
|
+
// restore CL/EL consistency, otherwise validators permanently lose that balance.
|
|
815
|
+
(payloadAttributes as capella.SSEPayloadAttributes["payloadAttributes"]).withdrawals =
|
|
816
|
+
prepareState.payloadExpectedWithdrawals;
|
|
817
|
+
}
|
|
799
818
|
} else {
|
|
800
819
|
// withdrawals logic is now fork aware as it changes on electra fork post capella
|
|
801
820
|
(payloadAttributes as capella.SSEPayloadAttributes["payloadAttributes"]).withdrawals =
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {CheckpointWithHex} from "@lodestar/fork-choice";
|
|
2
2
|
import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
3
|
-
import {RootHex} from "@lodestar/types";
|
|
3
|
+
import {RootHex, Slot} from "@lodestar/types";
|
|
4
4
|
import {Logger} from "@lodestar/utils";
|
|
5
5
|
import {Metrics} from "../../metrics/metrics.js";
|
|
6
6
|
import {SerializedCache} from "../../util/serializedCache.js";
|
|
@@ -21,8 +21,15 @@ export type SeenPayloadEnvelopeInputModules = {
|
|
|
21
21
|
/**
|
|
22
22
|
* Cache for tracking PayloadEnvelopeInput instances, keyed by beacon block root.
|
|
23
23
|
*
|
|
24
|
-
* Created during block import when a block is processed.
|
|
25
|
-
*
|
|
24
|
+
* Created during block import when a block is processed. Two pruning paths:
|
|
25
|
+
* - `prepareNextSlot` calls `pruneBelow(headParentSlot)` every slot once the head we'll build
|
|
26
|
+
* on is known.
|
|
27
|
+
* - `onFinalized` calls `pruneBelow(finalizedSlot)` on every finalization for bulk cleanup.
|
|
28
|
+
*
|
|
29
|
+
* Steady state (linear chain, healthy progression): the cache holds ~2 entries — the head
|
|
30
|
+
* (parent for next-slot production) and its parent (proposer-boost-reorg fallback). It can
|
|
31
|
+
* transiently hold more during forks, range-sync bursts, or when `prepareNextSlot` skips
|
|
32
|
+
* ticks; subsequent ticks settle it back.
|
|
26
33
|
*/
|
|
27
34
|
export class SeenPayloadEnvelopeInput {
|
|
28
35
|
private readonly chainEvents: ChainEventEmitter;
|
|
@@ -58,16 +65,7 @@ export class SeenPayloadEnvelopeInput {
|
|
|
58
65
|
}
|
|
59
66
|
|
|
60
67
|
private onFinalized = (checkpoint: CheckpointWithHex): void => {
|
|
61
|
-
|
|
62
|
-
const finalizedSlot = computeStartSlotAtEpoch(checkpoint.epoch);
|
|
63
|
-
let deletedCount = 0;
|
|
64
|
-
for (const [, input] of this.payloadInputs) {
|
|
65
|
-
if (input.slot < finalizedSlot) {
|
|
66
|
-
this.evictPayloadInput(input);
|
|
67
|
-
deletedCount++;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
this.logger?.debug("SeenPayloadEnvelopeInput.onFinalized deleted cached entries", {deletedCount});
|
|
68
|
+
this.pruneBelow(computeStartSlotAtEpoch(checkpoint.epoch));
|
|
71
69
|
};
|
|
72
70
|
|
|
73
71
|
add(props: CreateFromBlockProps): PayloadEnvelopeInput {
|
|
@@ -88,17 +86,21 @@ export class SeenPayloadEnvelopeInput {
|
|
|
88
86
|
return this.payloadInputs.get(blockRootHex)?.hasPayloadEnvelope() ?? false;
|
|
89
87
|
}
|
|
90
88
|
|
|
91
|
-
prune(blockRootHex: RootHex): void {
|
|
92
|
-
const payloadInput = this.payloadInputs.get(blockRootHex);
|
|
93
|
-
if (payloadInput) {
|
|
94
|
-
this.evictPayloadInput(payloadInput);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
89
|
size(): number {
|
|
99
90
|
return this.payloadInputs.size;
|
|
100
91
|
}
|
|
101
92
|
|
|
93
|
+
pruneBelow(slot: Slot): void {
|
|
94
|
+
let deletedCount = 0;
|
|
95
|
+
for (const [, input] of this.payloadInputs) {
|
|
96
|
+
if (input.slot < slot) {
|
|
97
|
+
this.evictPayloadInput(input);
|
|
98
|
+
deletedCount++;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
this.logger?.debug("SeenPayloadEnvelopeInput.pruneBelow deleted entries", {slot, deletedCount});
|
|
102
|
+
}
|
|
103
|
+
|
|
102
104
|
private evictPayloadInput(payloadInput: PayloadEnvelopeInput): void {
|
|
103
105
|
this.serializedCache.delete(payloadInput.getSerializedCacheKeys());
|
|
104
106
|
this.payloadInputs.delete(payloadInput.blockRootHex);
|