@lodestar/beacon-node 1.47.0-dev.0bcaaaebb5 → 1.47.0-dev.268215c3da
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/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +21 -11
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/impl/validator/utils.d.ts +0 -5
- package/lib/api/impl/validator/utils.d.ts.map +1 -1
- package/lib/api/impl/validator/utils.js +12 -18
- package/lib/api/impl/validator/utils.js.map +1 -1
- package/lib/chain/chain.d.ts +1 -1
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +1 -2
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +0 -2
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +1 -6
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/package.json +14 -14
- package/src/api/impl/validator/index.ts +26 -21
- package/src/api/impl/validator/utils.ts +15 -30
- package/src/chain/chain.ts +0 -2
- package/src/chain/produceBlock/produceBlockBody.ts +0 -13
|
@@ -59,39 +59,24 @@ export function selectBlockProductionSource({
|
|
|
59
59
|
return {source: ProducedBlockSource.engine, reason: EngineBlockSelectionReason.EnginePreferred};
|
|
60
60
|
|
|
61
61
|
case routes.validator.BuilderSelection.Default:
|
|
62
|
-
case routes.validator.BuilderSelection.MaxProfit:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
builderBoostFactor,
|
|
67
|
-
});
|
|
62
|
+
case routes.validator.BuilderSelection.MaxProfit: {
|
|
63
|
+
if (builderBoostFactor === BigInt(0)) {
|
|
64
|
+
return {source: ProducedBlockSource.engine, reason: EngineBlockSelectionReason.EnginePreferred};
|
|
65
|
+
}
|
|
68
66
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
}
|
|
67
|
+
if (builderBoostFactor === MAX_BUILDER_BOOST_FACTOR) {
|
|
68
|
+
return {source: ProducedBlockSource.builder, reason: BuilderBlockSelectionReason.BuilderPreferred};
|
|
69
|
+
}
|
|
74
70
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
builderBoostFactor,
|
|
79
|
-
}: {
|
|
80
|
-
engineExecutionPayloadValue: bigint;
|
|
81
|
-
builderExecutionPayloadValue: bigint;
|
|
82
|
-
builderBoostFactor: bigint;
|
|
83
|
-
}): BlockSelectionResult {
|
|
84
|
-
if (builderBoostFactor === BigInt(0)) {
|
|
85
|
-
return {source: ProducedBlockSource.engine, reason: EngineBlockSelectionReason.EnginePreferred};
|
|
86
|
-
}
|
|
71
|
+
if (engineExecutionPayloadValue >= (builderExecutionPayloadValue * builderBoostFactor) / BigInt(100)) {
|
|
72
|
+
return {source: ProducedBlockSource.engine, reason: EngineBlockSelectionReason.BlockValue};
|
|
73
|
+
}
|
|
87
74
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
75
|
+
return {source: ProducedBlockSource.builder, reason: BuilderBlockSelectionReason.BlockValue};
|
|
76
|
+
}
|
|
91
77
|
|
|
92
|
-
|
|
93
|
-
|
|
78
|
+
case routes.validator.BuilderSelection.BuilderAlways:
|
|
79
|
+
case routes.validator.BuilderSelection.BuilderOnly:
|
|
80
|
+
return {source: ProducedBlockSource.builder, reason: BuilderBlockSelectionReason.BuilderPreferred};
|
|
94
81
|
}
|
|
95
|
-
|
|
96
|
-
return {source: ProducedBlockSource.builder, reason: BuilderBlockSelectionReason.BlockValue};
|
|
97
82
|
}
|
package/src/chain/chain.ts
CHANGED
|
@@ -1072,7 +1072,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1072
1072
|
graffiti,
|
|
1073
1073
|
slot,
|
|
1074
1074
|
feeRecipient,
|
|
1075
|
-
strictFeeRecipientCheck,
|
|
1076
1075
|
commonBlockBodyPromise,
|
|
1077
1076
|
parentBlock,
|
|
1078
1077
|
builderBid,
|
|
@@ -1101,7 +1100,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1101
1100
|
graffiti,
|
|
1102
1101
|
slot,
|
|
1103
1102
|
feeRecipient,
|
|
1104
|
-
strictFeeRecipientCheck,
|
|
1105
1103
|
parentBlock,
|
|
1106
1104
|
proposerIndex,
|
|
1107
1105
|
proposerPubKey,
|
|
@@ -100,8 +100,6 @@ export type BlockAttributes = {
|
|
|
100
100
|
slot: Slot;
|
|
101
101
|
parentBlock: ProtoBlock;
|
|
102
102
|
feeRecipient?: string;
|
|
103
|
-
/** Verify that a locally produced execution payload uses `feeRecipient`. */
|
|
104
|
-
strictFeeRecipientCheck?: boolean;
|
|
105
103
|
/** When provided, build block with this builder bid instead of a self-build bid */
|
|
106
104
|
builderBid?: gloas.SignedExecutionPayloadBid;
|
|
107
105
|
};
|
|
@@ -203,7 +201,6 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
203
201
|
const {
|
|
204
202
|
slot: blockSlot,
|
|
205
203
|
feeRecipient: requestedFeeRecipient,
|
|
206
|
-
strictFeeRecipientCheck,
|
|
207
204
|
parentBlock,
|
|
208
205
|
proposerIndex,
|
|
209
206
|
proposerPubKey,
|
|
@@ -337,16 +334,6 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
337
334
|
executionPayloadValue = payloadRes.executionPayloadValue;
|
|
338
335
|
shouldOverrideBuilder = payloadRes.shouldOverrideBuilder;
|
|
339
336
|
|
|
340
|
-
if (
|
|
341
|
-
strictFeeRecipientCheck &&
|
|
342
|
-
requestedFeeRecipient &&
|
|
343
|
-
!byteArrayEquals(executionPayload.feeRecipient, fromHex(requestedFeeRecipient))
|
|
344
|
-
) {
|
|
345
|
-
throw Error(
|
|
346
|
-
`Invalid feeRecipient set in engine payload expected=${requestedFeeRecipient} actual=${toHex(executionPayload.feeRecipient)}`
|
|
347
|
-
);
|
|
348
|
-
}
|
|
349
|
-
|
|
350
337
|
if (blobsBundle === undefined) {
|
|
351
338
|
throw Error(`Missing blobsBundle response from getPayload at fork=${fork}`);
|
|
352
339
|
}
|