@lodestar/beacon-node 1.48.0-dev.858e7b16e9 → 1.48.0-dev.89d0f4da2d

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.
Files changed (218) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +4 -4
  3. package/lib/api/impl/beacon/blocks/index.js.map +1 -1
  4. package/lib/api/impl/validator/index.d.ts.map +1 -1
  5. package/lib/api/impl/validator/index.js +39 -39
  6. package/lib/api/impl/validator/index.js.map +1 -1
  7. package/lib/chain/archiveStore/archiveStore.d.ts +1 -0
  8. package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
  9. package/lib/chain/archiveStore/archiveStore.js +1 -0
  10. package/lib/chain/archiveStore/archiveStore.js.map +1 -1
  11. package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
  12. package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +1 -0
  13. package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
  14. package/lib/chain/archiveStore/historicalState/metrics.d.ts.map +1 -1
  15. package/lib/chain/archiveStore/historicalState/metrics.js +12 -1
  16. package/lib/chain/archiveStore/historicalState/metrics.js.map +1 -1
  17. package/lib/chain/archiveStore/historicalState/types.d.ts +2 -0
  18. package/lib/chain/archiveStore/historicalState/types.d.ts.map +1 -1
  19. package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
  20. package/lib/chain/archiveStore/historicalState/worker.js +4 -1
  21. package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
  22. package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
  23. package/lib/chain/archiveStore/utils/archiveBlocks.js +31 -34
  24. package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
  25. package/lib/chain/blocks/index.d.ts.map +1 -1
  26. package/lib/chain/blocks/index.js +3 -2
  27. package/lib/chain/blocks/index.js.map +1 -1
  28. package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -1
  29. package/lib/chain/blocks/writeBlockInputToDb.js +9 -16
  30. package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
  31. package/lib/chain/chain.d.ts +9 -3
  32. package/lib/chain/chain.d.ts.map +1 -1
  33. package/lib/chain/chain.js +108 -73
  34. package/lib/chain/chain.js.map +1 -1
  35. package/lib/chain/errors/blockError.d.ts +19 -7
  36. package/lib/chain/errors/blockError.d.ts.map +1 -1
  37. package/lib/chain/errors/blockError.js +2 -2
  38. package/lib/chain/errors/blockError.js.map +1 -1
  39. package/lib/chain/errors/dataColumnSidecarError.d.ts +15 -2
  40. package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
  41. package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
  42. package/lib/chain/errors/executionPayloadEnvelope.d.ts +10 -11
  43. package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
  44. package/lib/chain/errors/executionPayloadEnvelope.js +0 -2
  45. package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
  46. package/lib/chain/interface.d.ts +2 -2
  47. package/lib/chain/interface.d.ts.map +1 -1
  48. package/lib/chain/prepareNextSlot.d.ts.map +1 -1
  49. package/lib/chain/prepareNextSlot.js +16 -14
  50. package/lib/chain/prepareNextSlot.js.map +1 -1
  51. package/lib/chain/produceBlock/produceBlockBody.d.ts +4 -2
  52. package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
  53. package/lib/chain/produceBlock/produceBlockBody.js +57 -72
  54. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  55. package/lib/chain/validation/block.d.ts.map +1 -1
  56. package/lib/chain/validation/block.js +35 -54
  57. package/lib/chain/validation/block.js.map +1 -1
  58. package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
  59. package/lib/chain/validation/dataColumnSidecar.js +38 -13
  60. package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
  61. package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
  62. package/lib/chain/validation/executionPayloadEnvelope.js +10 -29
  63. package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
  64. package/lib/db/beacon.d.ts +14 -5
  65. package/lib/db/beacon.d.ts.map +1 -1
  66. package/lib/db/beacon.js +17 -3
  67. package/lib/db/beacon.js.map +1 -1
  68. package/lib/db/dataColumnStore.d.ts +39 -0
  69. package/lib/db/dataColumnStore.d.ts.map +1 -0
  70. package/lib/db/dataColumnStore.js +81 -0
  71. package/lib/db/dataColumnStore.js.map +1 -0
  72. package/lib/db/flatFileStore/atomicWrite.d.ts +8 -0
  73. package/lib/db/flatFileStore/atomicWrite.d.ts.map +1 -0
  74. package/lib/db/flatFileStore/atomicWrite.js +61 -0
  75. package/lib/db/flatFileStore/atomicWrite.js.map +1 -0
  76. package/lib/db/flatFileStore/dcolFormat.d.ts +90 -0
  77. package/lib/db/flatFileStore/dcolFormat.d.ts.map +1 -0
  78. package/lib/db/flatFileStore/dcolFormat.js +286 -0
  79. package/lib/db/flatFileStore/dcolFormat.js.map +1 -0
  80. package/lib/db/flatFileStore/errors.d.ts +82 -0
  81. package/lib/db/flatFileStore/errors.d.ts.map +1 -0
  82. package/lib/db/flatFileStore/errors.js +32 -0
  83. package/lib/db/flatFileStore/errors.js.map +1 -0
  84. package/lib/db/flatFileStore/flatFileStore.d.ts +41 -0
  85. package/lib/db/flatFileStore/flatFileStore.d.ts.map +1 -0
  86. package/lib/db/flatFileStore/flatFileStore.js +251 -0
  87. package/lib/db/flatFileStore/flatFileStore.js.map +1 -0
  88. package/lib/db/flatFileStore/index.d.ts +4 -0
  89. package/lib/db/flatFileStore/index.d.ts.map +1 -0
  90. package/lib/db/flatFileStore/index.js +2 -0
  91. package/lib/db/flatFileStore/index.js.map +1 -0
  92. package/lib/db/flatFileStore/interface.d.ts +25 -0
  93. package/lib/db/flatFileStore/interface.d.ts.map +1 -0
  94. package/lib/db/flatFileStore/interface.js +2 -0
  95. package/lib/db/flatFileStore/interface.js.map +1 -0
  96. package/lib/db/flatFileStore/metrics.d.ts +24 -0
  97. package/lib/db/flatFileStore/metrics.d.ts.map +1 -0
  98. package/lib/db/flatFileStore/metrics.js +25 -0
  99. package/lib/db/flatFileStore/metrics.js.map +1 -0
  100. package/lib/db/flatFileStore/path.d.ts +9 -0
  101. package/lib/db/flatFileStore/path.d.ts.map +1 -0
  102. package/lib/db/flatFileStore/path.js +21 -0
  103. package/lib/db/flatFileStore/path.js.map +1 -0
  104. package/lib/db/flatFileStore/slotIndex.d.ts +14 -0
  105. package/lib/db/flatFileStore/slotIndex.d.ts.map +1 -0
  106. package/lib/db/flatFileStore/slotIndex.js +46 -0
  107. package/lib/db/flatFileStore/slotIndex.js.map +1 -0
  108. package/lib/db/flatFileStore/snappy.d.ts +3 -0
  109. package/lib/db/flatFileStore/snappy.d.ts.map +1 -0
  110. package/lib/db/flatFileStore/snappy.js +12 -0
  111. package/lib/db/flatFileStore/snappy.js.map +1 -0
  112. package/lib/db/index.d.ts +1 -0
  113. package/lib/db/index.d.ts.map +1 -1
  114. package/lib/db/interface.d.ts +8 -1
  115. package/lib/db/interface.d.ts.map +1 -1
  116. package/lib/db/repositories/blockArchive.d.ts +8 -1
  117. package/lib/db/repositories/blockArchive.d.ts.map +1 -1
  118. package/lib/db/repositories/blockArchive.js +65 -28
  119. package/lib/db/repositories/blockArchive.js.map +1 -1
  120. package/lib/db/repositories/blockArchiveIndex.d.ts +1 -2
  121. package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
  122. package/lib/db/repositories/blockArchiveIndex.js +3 -7
  123. package/lib/db/repositories/blockArchiveIndex.js.map +1 -1
  124. package/lib/metrics/metrics/lodestar.d.ts +18 -0
  125. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  126. package/lib/metrics/metrics/lodestar.js +55 -1
  127. package/lib/metrics/metrics/lodestar.js.map +1 -1
  128. package/lib/monitoring/clientStats.js +1 -1
  129. package/lib/monitoring/clientStats.js.map +1 -1
  130. package/lib/network/gossip/encoding.d.ts.map +1 -1
  131. package/lib/network/gossip/encoding.js +0 -7
  132. package/lib/network/gossip/encoding.js.map +1 -1
  133. package/lib/network/gossip/topic.d.ts +2 -1
  134. package/lib/network/gossip/topic.d.ts.map +1 -1
  135. package/lib/network/gossip/topic.js +4 -20
  136. package/lib/network/gossip/topic.js.map +1 -1
  137. package/lib/network/libp2p/index.d.ts +9 -1
  138. package/lib/network/libp2p/index.d.ts.map +1 -1
  139. package/lib/network/libp2p/index.js +23 -0
  140. package/lib/network/libp2p/index.js.map +1 -1
  141. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  142. package/lib/network/processor/gossipHandlers.js +6 -7
  143. package/lib/network/processor/gossipHandlers.js.map +1 -1
  144. package/lib/network/processor/index.d.ts +49 -3
  145. package/lib/network/processor/index.d.ts.map +1 -1
  146. package/lib/network/processor/index.js +232 -98
  147. package/lib/network/processor/index.js.map +1 -1
  148. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
  149. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +112 -91
  150. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
  151. package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.d.ts.map +1 -1
  152. package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js +2 -0
  153. package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js.map +1 -1
  154. package/lib/network/reqresp/protocols.d.ts.map +1 -1
  155. package/lib/network/reqresp/protocols.js +6 -22
  156. package/lib/network/reqresp/protocols.js.map +1 -1
  157. package/lib/network/reqresp/utils/dataColumnResponseValidation.d.ts +2 -1
  158. package/lib/network/reqresp/utils/dataColumnResponseValidation.d.ts.map +1 -1
  159. package/lib/network/reqresp/utils/dataColumnResponseValidation.js +14 -9
  160. package/lib/network/reqresp/utils/dataColumnResponseValidation.js.map +1 -1
  161. package/lib/node/nodejs.d.ts +2 -1
  162. package/lib/node/nodejs.d.ts.map +1 -1
  163. package/lib/node/nodejs.js +4 -2
  164. package/lib/node/nodejs.js.map +1 -1
  165. package/lib/util/sszBytes.d.ts +6 -0
  166. package/lib/util/sszBytes.d.ts.map +1 -1
  167. package/lib/util/sszBytes.js +1 -1
  168. package/lib/util/sszBytes.js.map +1 -1
  169. package/package.json +18 -19
  170. package/src/api/impl/beacon/blocks/index.ts +8 -4
  171. package/src/api/impl/validator/index.ts +44 -43
  172. package/src/chain/archiveStore/archiveStore.ts +6 -1
  173. package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +1 -0
  174. package/src/chain/archiveStore/historicalState/metrics.ts +14 -1
  175. package/src/chain/archiveStore/historicalState/types.ts +2 -0
  176. package/src/chain/archiveStore/historicalState/worker.ts +4 -1
  177. package/src/chain/archiveStore/utils/archiveBlocks.ts +34 -39
  178. package/src/chain/blocks/index.ts +13 -2
  179. package/src/chain/blocks/writeBlockInputToDb.ts +10 -17
  180. package/src/chain/chain.ts +130 -80
  181. package/src/chain/errors/blockError.ts +22 -10
  182. package/src/chain/errors/dataColumnSidecarError.ts +24 -8
  183. package/src/chain/errors/executionPayloadEnvelope.ts +14 -11
  184. package/src/chain/interface.ts +2 -2
  185. package/src/chain/prepareNextSlot.ts +21 -17
  186. package/src/chain/produceBlock/produceBlockBody.ts +62 -79
  187. package/src/chain/validation/block.ts +35 -70
  188. package/src/chain/validation/dataColumnSidecar.ts +47 -14
  189. package/src/chain/validation/executionPayloadEnvelope.ts +10 -37
  190. package/src/db/beacon.ts +33 -6
  191. package/src/db/dataColumnStore.ts +113 -0
  192. package/src/db/flatFileStore/atomicWrite.ts +65 -0
  193. package/src/db/flatFileStore/dcolFormat.ts +389 -0
  194. package/src/db/flatFileStore/errors.ts +53 -0
  195. package/src/db/flatFileStore/flatFileStore.ts +310 -0
  196. package/src/db/flatFileStore/index.ts +3 -0
  197. package/src/db/flatFileStore/interface.ts +21 -0
  198. package/src/db/flatFileStore/metrics.ts +48 -0
  199. package/src/db/flatFileStore/path.ts +32 -0
  200. package/src/db/flatFileStore/slotIndex.ts +56 -0
  201. package/src/db/flatFileStore/snappy.ts +14 -0
  202. package/src/db/index.ts +1 -0
  203. package/src/db/interface.ts +9 -1
  204. package/src/db/repositories/blockArchive.ts +89 -30
  205. package/src/db/repositories/blockArchiveIndex.ts +4 -9
  206. package/src/metrics/metrics/lodestar.ts +57 -1
  207. package/src/monitoring/clientStats.ts +1 -1
  208. package/src/network/gossip/encoding.ts +0 -7
  209. package/src/network/gossip/topic.ts +3 -25
  210. package/src/network/libp2p/index.ts +28 -1
  211. package/src/network/processor/gossipHandlers.ts +11 -11
  212. package/src/network/processor/index.ts +263 -148
  213. package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +139 -105
  214. package/src/network/reqresp/handlers/dataColumnSidecarsByRoot.ts +2 -0
  215. package/src/network/reqresp/protocols.ts +7 -24
  216. package/src/network/reqresp/utils/dataColumnResponseValidation.ts +15 -7
  217. package/src/node/nodejs.ts +6 -1
  218. package/src/util/sszBytes.ts +1 -1
@@ -47,10 +47,12 @@ export enum DataColumnSidecarErrorCode {
47
47
  }
48
48
 
49
49
  export type DataColumnSidecarErrorType =
50
- | {code: DataColumnSidecarErrorCode.INVALID_INDEX; slot: Slot; columnIndex: number}
51
- | {code: DataColumnSidecarErrorCode.NO_COMMITMENTS; slot: Slot; columnIndex: number}
50
+ | {code: DataColumnSidecarErrorCode.INVALID_INDEX; slot: Slot; root: RootHex; columnIndex: number}
51
+ | {code: DataColumnSidecarErrorCode.NO_COMMITMENTS; slot: Slot; root: RootHex; columnIndex: number}
52
52
  | {
53
53
  code: DataColumnSidecarErrorCode.MISMATCHED_LENGTHS;
54
+ slot: Slot;
55
+ root: RootHex;
54
56
  columnLength: number;
55
57
  commitmentsLength: number;
56
58
  proofsLength: number;
@@ -61,10 +63,17 @@ export type DataColumnSidecarErrorType =
61
63
  columnIndex: number;
62
64
  fork: ForkName;
63
65
  }
64
- | {code: DataColumnSidecarErrorCode.INVALID_SUBNET; columnIndex: number; gossipSubnet: SubnetID}
66
+ | {
67
+ code: DataColumnSidecarErrorCode.INVALID_SUBNET;
68
+ slot: Slot;
69
+ root: RootHex;
70
+ columnIndex: number;
71
+ gossipSubnet: SubnetID;
72
+ }
65
73
  | {
66
74
  code: DataColumnSidecarErrorCode.TOO_MANY_KZG_COMMITMENTS;
67
75
  slot: number;
76
+ root: RootHex;
68
77
  columnIndex: number;
69
78
  count: number;
70
79
  limit: number;
@@ -85,12 +94,12 @@ export type DataColumnSidecarErrorType =
85
94
  | {
86
95
  code: DataColumnSidecarErrorCode.PROPOSAL_SIGNATURE_INVALID;
87
96
  slot: Slot;
88
- blockRoot: RootHex;
97
+ root: RootHex;
89
98
  index: number;
90
99
  }
91
- | {code: DataColumnSidecarErrorCode.NOT_LATER_THAN_PARENT; parentSlot: Slot; slot: Slot}
92
- | {code: DataColumnSidecarErrorCode.INCLUSION_PROOF_INVALID; slot: Slot; columnIndex: number}
93
- | {code: DataColumnSidecarErrorCode.INVALID_KZG_PROOF; slot: Slot; columnIndex: number}
100
+ | {code: DataColumnSidecarErrorCode.NOT_LATER_THAN_PARENT; slot: Slot; root: RootHex; parentSlot: Slot}
101
+ | {code: DataColumnSidecarErrorCode.INCLUSION_PROOF_INVALID; slot: Slot; root: RootHex; columnIndex: number}
102
+ | {code: DataColumnSidecarErrorCode.INVALID_KZG_PROOF; slot: Slot; root: RootHex; columnIndex: number}
94
103
  | {code: DataColumnSidecarErrorCode.INCORRECT_SIDECAR_COUNT; slot: number; expected: number; actual: number}
95
104
  | {
96
105
  code: DataColumnSidecarErrorCode.INCORRECT_BLOCK;
@@ -106,6 +115,7 @@ export type DataColumnSidecarErrorType =
106
115
  }
107
116
  | {
108
117
  code: DataColumnSidecarErrorCode.INCORRECT_SIDECAR_SLOT;
118
+ root: RootHex;
109
119
  columnIndex: number;
110
120
  expected: Slot;
111
121
  actual: Slot;
@@ -127,7 +137,13 @@ export type DataColumnSidecarErrorType =
127
137
  actual: number;
128
138
  }
129
139
  | {code: DataColumnSidecarErrorCode.INVALID_KZG_PROOF_BATCH; slot: number; reason: string}
130
- | {code: DataColumnSidecarErrorCode.INCORRECT_PROPOSER; actualProposerIndex: number; expectedProposerIndex: number}
140
+ | {
141
+ code: DataColumnSidecarErrorCode.INCORRECT_PROPOSER;
142
+ slot: Slot;
143
+ root: RootHex;
144
+ actualProposerIndex: number;
145
+ expectedProposerIndex: number;
146
+ }
131
147
  | {code: DataColumnSidecarErrorCode.PAYLOAD_ENVELOPE_INPUT_MISSING; slot: Slot; blockRoot: RootHex};
132
148
 
133
149
  export class DataColumnSidecarGossipError extends GossipActionError<DataColumnSidecarErrorType> {}
@@ -12,8 +12,6 @@ export enum ExecutionPayloadEnvelopeErrorCode {
12
12
  BUILDER_INDEX_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_BUILDER_INDEX_MISMATCH",
13
13
  BLOCK_HASH_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_BLOCK_HASH_MISMATCH",
14
14
  EXECUTION_REQUESTS_ROOT_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_EXECUTION_REQUESTS_ROOT_MISMATCH",
15
- EXECUTION_REQUESTS_COUNT_EXCEEDED = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_EXECUTION_REQUESTS_COUNT_EXCEEDED",
16
- WITHDRAWALS_COUNT_EXCEEDED = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_WITHDRAWALS_COUNT_EXCEEDED",
17
15
  INVALID_SIGNATURE = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_INVALID_SIGNATURE",
18
16
  PAYLOAD_ENVELOPE_INPUT_MISSING = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_PAYLOAD_ENVELOPE_INPUT_MISSING",
19
17
  }
@@ -28,30 +26,35 @@ export type ExecutionPayloadEnvelopeErrorType =
28
26
  slot: Slot;
29
27
  }
30
28
  | {code: ExecutionPayloadEnvelopeErrorCode.INVALID_BLOCK; blockRoot: RootHex}
31
- | {code: ExecutionPayloadEnvelopeErrorCode.SLOT_MISMATCH; envelopeSlot: Slot; blockSlot: Slot}
29
+ | {
30
+ code: ExecutionPayloadEnvelopeErrorCode.SLOT_MISMATCH;
31
+ slot: Slot;
32
+ root: RootHex;
33
+ envelopeSlot: Slot;
34
+ blockSlot: Slot;
35
+ }
32
36
  | {
33
37
  code: ExecutionPayloadEnvelopeErrorCode.BUILDER_INDEX_MISMATCH;
38
+ slot: Slot;
39
+ root: RootHex;
34
40
  envelopeBuilderIndex: BuilderIndex;
35
41
  bidBuilderIndex: BuilderIndex | null;
36
42
  }
37
43
  | {
38
44
  code: ExecutionPayloadEnvelopeErrorCode.BLOCK_HASH_MISMATCH;
45
+ slot: Slot;
46
+ root: RootHex;
39
47
  envelopeBlockHash: RootHex;
40
48
  bidBlockHash: RootHex | null;
41
49
  }
42
50
  | {
43
51
  code: ExecutionPayloadEnvelopeErrorCode.EXECUTION_REQUESTS_ROOT_MISMATCH;
52
+ slot: Slot;
53
+ root: RootHex;
44
54
  envelopeRequestsRoot: RootHex;
45
55
  bidRequestsRoot: RootHex;
46
56
  }
47
- | {
48
- code: ExecutionPayloadEnvelopeErrorCode.EXECUTION_REQUESTS_COUNT_EXCEEDED;
49
- name: string;
50
- count: number;
51
- limit: number;
52
- }
53
- | {code: ExecutionPayloadEnvelopeErrorCode.WITHDRAWALS_COUNT_EXCEEDED; count: number; limit: number}
54
- | {code: ExecutionPayloadEnvelopeErrorCode.INVALID_SIGNATURE}
57
+ | {code: ExecutionPayloadEnvelopeErrorCode.INVALID_SIGNATURE; slot: Slot; root: RootHex}
55
58
  | {code: ExecutionPayloadEnvelopeErrorCode.PAYLOAD_ENVELOPE_INPUT_MISSING; blockRoot: RootHex};
56
59
 
57
60
  export class ExecutionPayloadEnvelopeError extends GossipActionError<ExecutionPayloadEnvelopeErrorType> {}
@@ -290,8 +290,8 @@ export interface IBeaconChain {
290
290
  postState: IBeaconStateView,
291
291
  block: SignedBeaconBlock
292
292
  ): Promise<void>;
293
- persistInvalidSszValue<T>(type: Type<T>, sszObject: T | Uint8Array, suffix?: string): void;
294
- persistInvalidSszBytes(type: string, sszBytes: Uint8Array, suffix?: string): void;
293
+ persistInvalidSszValue<T>(type: Type<T>, sszObject: T, suffix?: string, rootHex?: RootHex): void;
294
+ persistInvalidSszBytes(type: string, sszBytes: Uint8Array, rootHex: RootHex, suffix?: string): void;
295
295
  regenStateForAttestationVerification(
296
296
  attEpoch: Epoch,
297
297
  shufflingDependentRoot: RootHex,
@@ -25,6 +25,7 @@ import {Bytes32, Slot, ValidatorIndex} from "@lodestar/types";
25
25
  import {Logger, fromHex, isErrorAborted, sleep} from "@lodestar/utils";
26
26
  import {GENESIS_SLOT} from "../constants/constants.js";
27
27
  import {BuilderStatus} from "../execution/builder/http.js";
28
+ import {PayloadAttributes} from "../execution/index.js";
28
29
  import {Metrics} from "../metrics/index.js";
29
30
  import {ClockEvent} from "../util/clock.js";
30
31
  import {isQueueErrorAborted} from "../util/queue/index.js";
@@ -243,6 +244,24 @@ export class PrepareNextSlotScheduler {
243
244
  parentBlockHash = preparedState.latestExecutionPayloadHeader.blockHash;
244
245
  }
245
246
 
247
+ let payloadAttributes: PayloadAttributes | undefined;
248
+ // If emitPayloadAttributes is true emit a SSE payloadAttributes event for
249
+ // every slot. Without the flag, only emit the event if we are proposing in the next slot.
250
+ if (
251
+ (feeRecipient || this.chain.opts.emitPayloadAttributes === true) &&
252
+ this.chain.emitter.listenerCount(routes.events.EventType.payloadAttributes)
253
+ ) {
254
+ const data = getPayloadAttributesForSSE(fork as ForkPostBellatrix, this.chain, {
255
+ prepareState: stateAfterParentPayload,
256
+ prepareSlot,
257
+ parentBlockRoot: fromHex(updatedHead.blockRoot),
258
+ parentBlockHash,
259
+ feeRecipient: feeRecipient ?? "0x0000000000000000000000000000000000000000",
260
+ });
261
+ this.chain.emitter.emit(routes.events.EventType.payloadAttributes, {data, version: fork});
262
+ payloadAttributes = data.payloadAttributes;
263
+ }
264
+
246
265
  if (feeRecipient) {
247
266
  const preparationTime =
248
267
  computeTimeAtSlot(this.config, prepareSlot, this.chain.genesisTime) - Date.now() / 1000;
@@ -263,7 +282,8 @@ export class PrepareNextSlotScheduler {
263
282
  safeBlockHash,
264
283
  finalizedBlockHash,
265
284
  stateAfterParentPayload,
266
- feeRecipient
285
+ feeRecipient,
286
+ payloadAttributes
267
287
  );
268
288
  this.logger.verbose("PrepareNextSlotScheduler prepared new payload", {
269
289
  prepareSlot,
@@ -273,22 +293,6 @@ export class PrepareNextSlotScheduler {
273
293
  }
274
294
 
275
295
  this.computeStateHashTreeRoot(preparedState, isEpochTransition);
276
-
277
- // If emitPayloadAttributes is true emit a SSE payloadAttributes event for
278
- // every slot. Without the flag, only emit the event if we are proposing in the next slot.
279
- if (
280
- (feeRecipient || this.chain.opts.emitPayloadAttributes === true) &&
281
- this.chain.emitter.listenerCount(routes.events.EventType.payloadAttributes)
282
- ) {
283
- const data = getPayloadAttributesForSSE(fork as ForkPostBellatrix, this.chain, {
284
- prepareState: stateAfterParentPayload,
285
- prepareSlot,
286
- parentBlockRoot: fromHex(updatedHead.blockRoot),
287
- parentBlockHash,
288
- feeRecipient: feeRecipient ?? "0x0000000000000000000000000000000000000000",
289
- });
290
- this.chain.emitter.emit(routes.events.EventType.payloadAttributes, {data, version: fork});
291
- }
292
296
  } else {
293
297
  // Pre-bellatrix only reaches here at an epoch transition to precompute the next epoch state
294
298
  const preparedState = await this.chain.regen.getBlockSlotState(
@@ -528,23 +528,18 @@ export async function produceBlockBody<T extends BlockType>(
528
528
  }
529
529
  }
530
530
 
531
- if (ForkSeq[fork] >= ForkSeq.deneb) {
532
- const {blobKzgCommitments} = builderRes;
533
- if (blobKzgCommitments === undefined) {
534
- throw Error(`Invalid builder getHeader response for fork=${fork}, missing blobKzgCommitments`);
535
- }
536
-
537
- (blockBody as deneb.BlindedBeaconBlockBody).blobKzgCommitments = blobKzgCommitments;
538
- Object.assign(logMeta, {blobs: blobKzgCommitments.length});
531
+ const {blobKzgCommitments, executionRequests} = builderRes;
532
+ if (blobKzgCommitments === undefined) {
533
+ throw Error(`Invalid builder getHeader response for fork=${fork}, missing blobKzgCommitments`);
539
534
  }
540
535
 
541
- if (ForkSeq[fork] >= ForkSeq.electra) {
542
- const {executionRequests} = builderRes;
543
- if (executionRequests === undefined) {
544
- throw Error(`Invalid builder getHeader response for fork=${fork}, missing executionRequests`);
545
- }
546
- (blockBody as electra.BlindedBeaconBlockBody).executionRequests = executionRequests;
536
+ (blockBody as BlindedBeaconBlockBody<ForkName.fulu>).blobKzgCommitments = blobKzgCommitments;
537
+ Object.assign(logMeta, {blobs: blobKzgCommitments.length});
538
+
539
+ if (executionRequests === undefined) {
540
+ throw Error(`Invalid builder getHeader response for fork=${fork}, missing executionRequests`);
547
541
  }
542
+ (blockBody as BlindedBeaconBlockBody<ForkName.fulu>).executionRequests = executionRequests;
548
543
  }
549
544
 
550
545
  // blockType === BlockType.Full
@@ -740,7 +735,9 @@ export async function prepareExecutionPayload(
740
735
  * parent execution payload first (see `withParentPayloadApplied`).
741
736
  */
742
737
  state: IBeaconStateViewBellatrix,
743
- suggestedFeeRecipient: string
738
+ suggestedFeeRecipient: string,
739
+ /** Attributes already computed for the same state and fee recipient, e.g. for the SSE event */
740
+ payloadAttributes?: PayloadAttributes
744
741
  ): Promise<{prepType: PayloadPreparationType; payloadId: PayloadId}> {
745
742
  const timestamp = computeTimeAtSlot(chain.config, state.slot, state.genesisTime);
746
743
  const prevRandao = state.getRandaoMix(state.epoch);
@@ -771,13 +768,15 @@ export async function prepareExecutionPayload(
771
768
  prepType = PayloadPreparationType.Fresh;
772
769
  }
773
770
 
774
- const attributes: PayloadAttributes = preparePayloadAttributes(fork, chain, {
775
- prepareState: state,
776
- prepareSlot: state.slot,
777
- parentBlockRoot,
778
- parentBlockHash,
779
- feeRecipient: suggestedFeeRecipient,
780
- });
771
+ const attributes: PayloadAttributes =
772
+ payloadAttributes ??
773
+ preparePayloadAttributes(fork, chain, {
774
+ prepareState: state,
775
+ prepareSlot: state.slot,
776
+ parentBlockRoot,
777
+ parentBlockHash,
778
+ feeRecipient: suggestedFeeRecipient,
779
+ });
781
780
 
782
781
  payloadId = await chain.executionEngine.notifyForkchoiceUpdate(
783
782
  fork,
@@ -899,45 +898,38 @@ function preparePayloadAttributes(
899
898
  ): SSEPayloadAttributes["payloadAttributes"] {
900
899
  const timestamp = computeTimeAtSlot(chain.config, prepareSlot, prepareState.genesisTime);
901
900
  const prevRandao = prepareState.getRandaoMix(prepareState.epoch);
902
- const payloadAttributes = {
903
- timestamp,
904
- prevRandao,
905
- suggestedFeeRecipient: feeRecipient,
906
- };
907
-
908
- if (ForkSeq[fork] >= ForkSeq.capella) {
909
- if (!isStatePostCapella(prepareState)) {
910
- throw new Error("Expected Capella state for withdrawals");
911
- }
901
+ if (!isStatePostCapella(prepareState)) {
902
+ throw new Error("Expected Capella state for withdrawals");
903
+ }
912
904
 
913
- if (isStatePostGloas(prepareState)) {
914
- const isExtendingPayload = byteArrayEquals(parentBlockHash, prepareState.latestExecutionPayloadBid.blockHash);
915
- if (isExtendingPayload) {
916
- // applyParentExecutionPayload sets latestBlockHash = parentBid.blockHash, so a mismatch
917
- // here means the caller did not apply parent payload to prepareState
918
- if (!byteArrayEquals(prepareState.latestBlockHash, prepareState.latestExecutionPayloadBid.blockHash)) {
919
- throw new Error("Expected state with parent execution payload applied for withdrawals");
920
- }
921
- (payloadAttributes as capella.SSEPayloadAttributes["payloadAttributes"]).withdrawals =
922
- prepareState.getExpectedWithdrawals().expectedWithdrawals;
923
- } else {
924
- // When the parent block is empty, state.payloadExpectedWithdrawals holds a batch
925
- // already deducted from CL balances but never credited on the EL (the envelope
926
- // was not delivered). The next payload must carry those same withdrawals to
927
- // restore CL/EL consistency, otherwise validators permanently lose that balance.
928
- (payloadAttributes as capella.SSEPayloadAttributes["payloadAttributes"]).withdrawals =
929
- prepareState.payloadExpectedWithdrawals;
905
+ let withdrawals: capella.Withdrawal[];
906
+ if (isStatePostGloas(prepareState)) {
907
+ const isExtendingPayload = byteArrayEquals(parentBlockHash, prepareState.latestExecutionPayloadBid.blockHash);
908
+ if (isExtendingPayload) {
909
+ // applyParentExecutionPayload sets latestBlockHash = parentBid.blockHash, so a mismatch
910
+ // here means the caller did not apply parent payload to prepareState
911
+ if (!byteArrayEquals(prepareState.latestBlockHash, prepareState.latestExecutionPayloadBid.blockHash)) {
912
+ throw new Error("Expected state with parent execution payload applied for withdrawals");
930
913
  }
914
+ withdrawals = prepareState.getExpectedWithdrawals().expectedWithdrawals;
931
915
  } else {
932
- // withdrawals logic is now fork aware as it changes on electra fork post capella
933
- (payloadAttributes as capella.SSEPayloadAttributes["payloadAttributes"]).withdrawals =
934
- prepareState.getExpectedWithdrawals().expectedWithdrawals;
916
+ // When the parent block is empty, state.payloadExpectedWithdrawals holds a batch
917
+ // already deducted from CL balances but never credited on the EL (the envelope
918
+ // was not delivered). The next payload must carry those same withdrawals to
919
+ // restore CL/EL consistency, otherwise validators permanently lose that balance.
920
+ withdrawals = prepareState.payloadExpectedWithdrawals;
935
921
  }
922
+ } else {
923
+ withdrawals = prepareState.getExpectedWithdrawals().expectedWithdrawals;
936
924
  }
937
925
 
938
- if (ForkSeq[fork] >= ForkSeq.deneb) {
939
- (payloadAttributes as deneb.SSEPayloadAttributes["payloadAttributes"]).parentBeaconBlockRoot = parentBlockRoot;
940
- }
926
+ const payloadAttributes: deneb.SSEPayloadAttributes["payloadAttributes"] = {
927
+ timestamp,
928
+ prevRandao,
929
+ suggestedFeeRecipient: feeRecipient,
930
+ withdrawals,
931
+ parentBeaconBlockRoot: parentBlockRoot,
932
+ };
941
933
 
942
934
  if (ForkSeq[fork] >= ForkSeq.gloas) {
943
935
  if (!isStatePostGloas(prepareState)) {
@@ -1050,37 +1042,28 @@ export async function produceCommonBlockBody<T extends BlockType>(
1050
1042
  step: BlockProductionStep.attestations,
1051
1043
  });
1052
1044
 
1053
- const blockBody: Omit<CommonBlockBody, "blsToExecutionChanges" | "syncAggregate"> = {
1045
+ const endSyncAggregate = stepsMetrics?.startTimer();
1046
+ const parentBlockRoot = fromHex(parentBlock.blockRoot);
1047
+ const previousSlot = slot - 1;
1048
+ const syncAggregate = this.syncContributionAndProofPool.getAggregate(previousSlot, parentBlockRoot);
1049
+ this.metrics?.production.producedSyncAggregateParticipants.observe(
1050
+ syncAggregate.syncCommitteeBits.getTrueBitIndexes().length
1051
+ );
1052
+ endSyncAggregate?.({
1053
+ step: BlockProductionStep.syncAggregate,
1054
+ });
1055
+
1056
+ // Live proposal production is supported from Fulu onward.
1057
+ return {
1054
1058
  randaoReveal,
1055
1059
  graffiti,
1056
- // Eth1 data voting is no longer required since electra
1057
1060
  eth1Data: currentState.eth1Data,
1058
1061
  proposerSlashings: this.opts.disableProposerSlashings === true ? [] : proposerSlashings,
1059
1062
  attesterSlashings,
1060
1063
  attestations,
1061
- // Since electra, deposits are processed by the execution layer,
1062
- // we no longer support handling deposits from earlier forks.
1063
1064
  deposits: [],
1064
1065
  voluntaryExits,
1066
+ blsToExecutionChanges,
1067
+ syncAggregate,
1065
1068
  };
1066
-
1067
- if (ForkSeq[fork] >= ForkSeq.capella) {
1068
- (blockBody as CommonBlockBody).blsToExecutionChanges = blsToExecutionChanges;
1069
- }
1070
-
1071
- const endSyncAggregate = stepsMetrics?.startTimer();
1072
- if (ForkSeq[fork] >= ForkSeq.altair) {
1073
- const parentBlockRoot = fromHex(parentBlock.blockRoot);
1074
- const previousSlot = slot - 1;
1075
- const syncAggregate = this.syncContributionAndProofPool.getAggregate(previousSlot, parentBlockRoot);
1076
- this.metrics?.production.producedSyncAggregateParticipants.observe(
1077
- syncAggregate.syncCommitteeBits.getTrueBitIndexes().length
1078
- );
1079
- (blockBody as CommonBlockBody).syncAggregate = syncAggregate;
1080
- }
1081
- endSyncAggregate?.({
1082
- step: BlockProductionStep.syncAggregate,
1083
- });
1084
-
1085
- return blockBody as CommonBlockBody;
1086
1069
  }
@@ -1,22 +1,6 @@
1
1
  import {ChainForkConfig} from "@lodestar/config";
2
2
  import {ExecutionStatus} from "@lodestar/fork-choice";
3
- import {
4
- ForkName,
5
- MAX_ATTESTATIONS_ELECTRA,
6
- MAX_ATTESTER_SLASHINGS_ELECTRA,
7
- MAX_BLS_TO_EXECUTION_CHANGES,
8
- MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD,
9
- MAX_BUILDER_EXIT_REQUESTS_PER_PAYLOAD,
10
- MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD,
11
- MAX_PAYLOAD_ATTESTATIONS,
12
- MAX_PROPOSER_SLASHINGS,
13
- MAX_VOLUNTARY_EXITS,
14
- MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD,
15
- MIN_SEED_LOOKAHEAD,
16
- isForkPostBellatrix,
17
- isForkPostDeneb,
18
- isForkPostGloas,
19
- } from "@lodestar/params";
3
+ import {ForkName, MIN_SEED_LOOKAHEAD, isForkPostBellatrix, isForkPostDeneb, isForkPostGloas} from "@lodestar/params";
20
4
  import {
21
5
  computeEpochAtSlot,
22
6
  computeStartSlotAtEpoch,
@@ -150,8 +134,9 @@ export async function validateGossipBlock(
150
134
  if (parentBlock.slot >= blockSlot) {
151
135
  throw new BlockGossipError(GossipAction.REJECT, {
152
136
  code: BlockErrorCode.NOT_LATER_THAN_PARENT,
153
- parentSlot: parentBlock.slot,
154
137
  slot: blockSlot,
138
+ root: blockRoot,
139
+ parentSlot: parentBlock.slot,
155
140
  });
156
141
  }
157
142
 
@@ -166,6 +151,8 @@ export async function validateGossipBlock(
166
151
  if (blobKzgCommitmentsLen > maxBlobsPerBlock) {
167
152
  throw new BlockGossipError(GossipAction.REJECT, {
168
153
  code: BlockErrorCode.TOO_MANY_KZG_COMMITMENTS,
154
+ slot: blockSlot,
155
+ root: blockRoot,
169
156
  blobKzgCommitmentsLen,
170
157
  commitmentLimit: maxBlobsPerBlock,
171
158
  });
@@ -173,7 +160,8 @@ export async function validateGossipBlock(
173
160
  }
174
161
 
175
162
  if (isForkPostGloas(fork)) {
176
- const bid = (block as gloas.BeaconBlock).body.signedExecutionPayloadBid.message;
163
+ const body = (block as gloas.BeaconBlock).body;
164
+ const bid = body.signedExecutionPayloadBid.message;
177
165
 
178
166
  // [REJECT] The length of KZG commitments is less than or equal to the limitation defined in Consensus Layer
179
167
  // -- i.e. validate that len(bid.blob_kzg_commitments) <= max_blobs_per_block
@@ -182,6 +170,8 @@ export async function validateGossipBlock(
182
170
  if (blobKzgCommitmentsLen > maxBlobsPerBlock) {
183
171
  throw new BlockGossipError(GossipAction.REJECT, {
184
172
  code: BlockErrorCode.TOO_MANY_KZG_COMMITMENTS,
173
+ slot: blockSlot,
174
+ root: blockRoot,
185
175
  blobKzgCommitmentsLen,
186
176
  commitmentLimit: maxBlobsPerBlock,
187
177
  });
@@ -191,59 +181,21 @@ export async function validateGossipBlock(
191
181
  if (!byteArrayEquals(bid.parentBlockRoot, block.parentRoot)) {
192
182
  throw new BlockGossipError(GossipAction.REJECT, {
193
183
  code: BlockErrorCode.BID_PARENT_ROOT_MISMATCH,
184
+ slot: blockSlot,
185
+ root: blockRoot,
194
186
  bidParentRoot: toRootHex(bid.parentBlockRoot),
195
187
  blockParentRoot: parentRoot,
196
188
  });
197
189
  }
198
190
 
199
- // [REJECT] The counts of `block.body.parent_execution_requests` are within
200
- // their respective limits -- i.e. validate that
201
- // `len(block.body.parent_execution_requests.withdrawals) <= MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD`,
202
- // `len(block.body.parent_execution_requests.consolidations) <= MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD`,
203
- // `len(block.body.parent_execution_requests.builder_deposits) <= MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD`,
204
- // and
205
- // `len(block.body.parent_execution_requests.builder_exits) <= MAX_BUILDER_EXIT_REQUESTS_PER_PAYLOAD`.
206
- // [REJECT] The counts of the block body operations are within their respective
207
- // limits -- i.e. validate that
208
- // `len(block.body.proposer_slashings) <= MAX_PROPOSER_SLASHINGS`,
209
- // `len(block.body.attester_slashings) <= MAX_ATTESTER_SLASHINGS_ELECTRA`,
210
- // `len(block.body.attestations) <= MAX_ATTESTATIONS_ELECTRA`,
211
- // `len(block.body.deposits) == 0`,
212
- // `len(block.body.voluntary_exits) <= MAX_VOLUNTARY_EXITS`,
213
- // `len(block.body.bls_to_execution_changes) <= MAX_BLS_TO_EXECUTION_CHANGES`,
214
- // and `len(block.body.payload_attestations) <= MAX_PAYLOAD_ATTESTATIONS`.
215
- const body = (block as gloas.BeaconBlock).body;
216
- const requests = body.parentExecutionRequests;
217
- const countLimits: [string, number, number][] = [
218
- ["parentExecutionRequests.withdrawals", requests.withdrawals.length, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD],
219
- [
220
- "parentExecutionRequests.consolidations",
221
- requests.consolidations.length,
222
- MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD,
223
- ],
224
- [
225
- "parentExecutionRequests.builderDeposits",
226
- requests.builderDeposits.length,
227
- MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD,
228
- ],
229
- ["parentExecutionRequests.builderExits", requests.builderExits.length, MAX_BUILDER_EXIT_REQUESTS_PER_PAYLOAD],
230
- ["proposerSlashings", body.proposerSlashings.length, MAX_PROPOSER_SLASHINGS],
231
- ["attesterSlashings", body.attesterSlashings.length, MAX_ATTESTER_SLASHINGS_ELECTRA],
232
- ["attestations", body.attestations.length, MAX_ATTESTATIONS_ELECTRA],
233
- ["deposits", body.deposits.length, 0],
234
- ["voluntaryExits", body.voluntaryExits.length, MAX_VOLUNTARY_EXITS],
235
- ["blsToExecutionChanges", body.blsToExecutionChanges.length, MAX_BLS_TO_EXECUTION_CHANGES],
236
- ["payloadAttestations", body.payloadAttestations.length, MAX_PAYLOAD_ATTESTATIONS],
237
- ];
238
- for (const [name, count, limit] of countLimits) {
239
- if (count > limit) {
240
- throw new BlockGossipError(GossipAction.REJECT, {
241
- code: BlockErrorCode.TOO_MANY_BLOCK_OPERATIONS,
242
- name,
243
- count,
244
- limit,
245
- });
246
- }
191
+ // [REJECT] The block contains no deposits.
192
+ if (body.deposits.length !== 0) {
193
+ throw new BlockGossipError(GossipAction.REJECT, {
194
+ code: BlockErrorCode.NON_ZERO_DEPOSITS,
195
+ slot: blockSlot,
196
+ root: blockRoot,
197
+ count: body.deposits.length,
198
+ });
247
199
  }
248
200
 
249
201
  // TODO GLOAS: [REJECT] The block's execution payload parent (defined by bid.parent_block_hash) passes all validation
@@ -306,6 +258,8 @@ export async function validateGossipBlock(
306
258
  if (executionPayload.timestamp !== computeTimeAtSlot(config, blockSlot, chain.genesisTime)) {
307
259
  throw new BlockGossipError(GossipAction.REJECT, {
308
260
  code: BlockErrorCode.INCORRECT_TIMESTAMP,
261
+ slot: blockSlot,
262
+ root: blockRoot,
309
263
  timestamp: executionPayload.timestamp,
310
264
  expectedTimestamp,
311
265
  });
@@ -315,7 +269,12 @@ export async function validateGossipBlock(
315
269
 
316
270
  // [REJECT] The proposer index is a valid validator index
317
271
  if (proposerIndex >= state.validatorCount) {
318
- throw new BlockGossipError(GossipAction.REJECT, {code: BlockErrorCode.UNKNOWN_PROPOSER, proposerIndex});
272
+ throw new BlockGossipError(GossipAction.REJECT, {
273
+ code: BlockErrorCode.UNKNOWN_PROPOSER,
274
+ slot: blockSlot,
275
+ root: blockRoot,
276
+ proposerIndex,
277
+ });
319
278
  }
320
279
 
321
280
  // [REJECT] The proposer signature, signed_beacon_block.signature, is valid with respect to the proposer_index pubkey.
@@ -327,7 +286,12 @@ export async function validateGossipBlock(
327
286
  // shuffling, the block MAY be queued for later processing while proposers for the block's branch are calculated --
328
287
  // in such a case do not REJECT, instead IGNORE this message.
329
288
  if (state.getBeaconProposer(blockSlot) !== proposerIndex) {
330
- throw new BlockGossipError(GossipAction.REJECT, {code: BlockErrorCode.INCORRECT_PROPOSER, proposerIndex});
289
+ throw new BlockGossipError(GossipAction.REJECT, {
290
+ code: BlockErrorCode.INCORRECT_PROPOSER,
291
+ slot: blockSlot,
292
+ root: blockRoot,
293
+ proposerIndex,
294
+ });
331
295
  }
332
296
 
333
297
  // Simple implementation of a pending block queue. Keeping the block here recycles the queue logic, and keeps the
@@ -372,7 +336,8 @@ export async function verifyBlockProposerSignature(
372
336
  if (!(await chain.bls.verifySignatureSets([signatureSet], {verifyOnMainThread: opts.verifyOnMainThread ?? true}))) {
373
337
  throw new BlockGossipError(GossipAction.REJECT, {
374
338
  code: BlockErrorCode.PROPOSAL_SIGNATURE_INVALID,
375
- blockSlot,
339
+ slot: blockSlot,
340
+ root: blockRoot,
376
341
  });
377
342
  }
378
343