@lodestar/beacon-node 1.36.0-dev.793f92c091 → 1.36.0-dev.801b1f4f52

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 (294) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +41 -22
  3. package/lib/api/impl/beacon/blocks/index.js.map +1 -1
  4. package/lib/api/impl/config/constants.d.ts +4 -2
  5. package/lib/api/impl/config/constants.d.ts.map +1 -1
  6. package/lib/api/impl/config/constants.js +6 -3
  7. package/lib/api/impl/config/constants.js.map +1 -1
  8. package/lib/api/impl/lodestar/index.d.ts +5 -0
  9. package/lib/api/impl/lodestar/index.d.ts.map +1 -1
  10. package/lib/api/impl/lodestar/index.js +35 -10
  11. package/lib/api/impl/lodestar/index.js.map +1 -1
  12. package/lib/api/impl/node/utils.js +1 -1
  13. package/lib/api/impl/node/utils.js.map +1 -1
  14. package/lib/api/impl/validator/index.d.ts.map +1 -1
  15. package/lib/api/impl/validator/index.js +2 -2
  16. package/lib/api/impl/validator/index.js.map +1 -1
  17. package/lib/chain/archiveStore/archiveStore.d.ts +9 -0
  18. package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
  19. package/lib/chain/archiveStore/archiveStore.js +24 -0
  20. package/lib/chain/archiveStore/archiveStore.js.map +1 -1
  21. package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.d.ts +7 -0
  22. package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.d.ts.map +1 -1
  23. package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js +31 -5
  24. package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js.map +1 -1
  25. package/lib/chain/beaconProposerCache.d.ts +3 -0
  26. package/lib/chain/beaconProposerCache.d.ts.map +1 -1
  27. package/lib/chain/beaconProposerCache.js +4 -6
  28. package/lib/chain/beaconProposerCache.js.map +1 -1
  29. package/lib/chain/chain.d.ts +5 -2
  30. package/lib/chain/chain.d.ts.map +1 -1
  31. package/lib/chain/chain.js +34 -18
  32. package/lib/chain/chain.js.map +1 -1
  33. package/lib/chain/errors/blobSidecarError.d.ts +5 -0
  34. package/lib/chain/errors/blobSidecarError.d.ts.map +1 -1
  35. package/lib/chain/errors/blobSidecarError.js.map +1 -1
  36. package/lib/chain/errors/blockError.d.ts +1 -0
  37. package/lib/chain/errors/blockError.d.ts.map +1 -1
  38. package/lib/chain/errors/dataColumnSidecarError.d.ts +27 -13
  39. package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
  40. package/lib/chain/errors/dataColumnSidecarError.js +5 -0
  41. package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
  42. package/lib/chain/errors/voluntaryExitError.d.ts +16 -2
  43. package/lib/chain/errors/voluntaryExitError.d.ts.map +1 -1
  44. package/lib/chain/errors/voluntaryExitError.js +22 -1
  45. package/lib/chain/errors/voluntaryExitError.js.map +1 -1
  46. package/lib/chain/forkChoice/index.d.ts +9 -1
  47. package/lib/chain/forkChoice/index.d.ts.map +1 -1
  48. package/lib/chain/forkChoice/index.js +109 -4
  49. package/lib/chain/forkChoice/index.js.map +1 -1
  50. package/lib/chain/interface.d.ts +2 -0
  51. package/lib/chain/interface.d.ts.map +1 -1
  52. package/lib/chain/lightClient/index.d.ts +3 -0
  53. package/lib/chain/lightClient/index.d.ts.map +1 -1
  54. package/lib/chain/lightClient/index.js +24 -13
  55. package/lib/chain/lightClient/index.js.map +1 -1
  56. package/lib/chain/opPools/syncContributionAndProofPool.d.ts +3 -1
  57. package/lib/chain/opPools/syncContributionAndProofPool.d.ts.map +1 -1
  58. package/lib/chain/opPools/syncContributionAndProofPool.js +4 -3
  59. package/lib/chain/opPools/syncContributionAndProofPool.js.map +1 -1
  60. package/lib/chain/options.d.ts +0 -2
  61. package/lib/chain/options.d.ts.map +1 -1
  62. package/lib/chain/options.js +2 -2
  63. package/lib/chain/options.js.map +1 -1
  64. package/lib/chain/stateCache/datastore/db.d.ts +12 -0
  65. package/lib/chain/stateCache/datastore/db.d.ts.map +1 -1
  66. package/lib/chain/stateCache/datastore/db.js +70 -0
  67. package/lib/chain/stateCache/datastore/db.js.map +1 -1
  68. package/lib/chain/stateCache/datastore/file.d.ts +1 -0
  69. package/lib/chain/stateCache/datastore/file.d.ts.map +1 -1
  70. package/lib/chain/stateCache/datastore/file.js +7 -0
  71. package/lib/chain/stateCache/datastore/file.js.map +1 -1
  72. package/lib/chain/stateCache/datastore/types.d.ts +1 -0
  73. package/lib/chain/stateCache/datastore/types.d.ts.map +1 -1
  74. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +16 -1
  75. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
  76. package/lib/chain/stateCache/persistentCheckpointsCache.js +31 -1
  77. package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
  78. package/lib/chain/validation/attestation.d.ts.map +1 -1
  79. package/lib/chain/validation/attestation.js +6 -7
  80. package/lib/chain/validation/attestation.js.map +1 -1
  81. package/lib/chain/validation/blobSidecar.d.ts +4 -1
  82. package/lib/chain/validation/blobSidecar.d.ts.map +1 -1
  83. package/lib/chain/validation/blobSidecar.js +46 -11
  84. package/lib/chain/validation/blobSidecar.js.map +1 -1
  85. package/lib/chain/validation/block.d.ts.map +1 -1
  86. package/lib/chain/validation/block.js +2 -2
  87. package/lib/chain/validation/block.js.map +1 -1
  88. package/lib/chain/validation/dataColumnSidecar.d.ts +4 -1
  89. package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
  90. package/lib/chain/validation/dataColumnSidecar.js +76 -20
  91. package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
  92. package/lib/chain/validation/lightClientOptimisticUpdate.d.ts.map +1 -1
  93. package/lib/chain/validation/lightClientOptimisticUpdate.js +1 -2
  94. package/lib/chain/validation/lightClientOptimisticUpdate.js.map +1 -1
  95. package/lib/chain/validation/voluntaryExit.d.ts.map +1 -1
  96. package/lib/chain/validation/voluntaryExit.js +5 -4
  97. package/lib/chain/validation/voluntaryExit.js.map +1 -1
  98. package/lib/constants/constants.d.ts +0 -5
  99. package/lib/constants/constants.d.ts.map +1 -1
  100. package/lib/constants/constants.js +0 -5
  101. package/lib/constants/constants.js.map +1 -1
  102. package/lib/constants/network.d.ts +0 -14
  103. package/lib/constants/network.d.ts.map +1 -1
  104. package/lib/constants/network.js +0 -15
  105. package/lib/constants/network.js.map +1 -1
  106. package/lib/index.d.ts +2 -0
  107. package/lib/index.d.ts.map +1 -1
  108. package/lib/index.js +2 -0
  109. package/lib/index.js.map +1 -1
  110. package/lib/metrics/metrics/lodestar.d.ts +11 -0
  111. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  112. package/lib/metrics/metrics/lodestar.js +19 -1
  113. package/lib/metrics/metrics/lodestar.js.map +1 -1
  114. package/lib/network/core/networkCore.d.ts.map +1 -1
  115. package/lib/network/core/networkCore.js +5 -1
  116. package/lib/network/core/networkCore.js.map +1 -1
  117. package/lib/network/core/networkCoreWorker.js +8 -8
  118. package/lib/network/core/networkCoreWorker.js.map +1 -1
  119. package/lib/network/core/networkCoreWorkerHandler.js +1 -1
  120. package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
  121. package/lib/network/discv5/utils.d.ts.map +1 -1
  122. package/lib/network/discv5/utils.js +1 -2
  123. package/lib/network/discv5/utils.js.map +1 -1
  124. package/lib/network/discv5/worker.js +2 -7
  125. package/lib/network/discv5/worker.js.map +1 -1
  126. package/lib/network/events.d.ts +1 -0
  127. package/lib/network/events.d.ts.map +1 -1
  128. package/lib/network/gossip/encoding.js +1 -1
  129. package/lib/network/gossip/encoding.js.map +1 -1
  130. package/lib/network/gossip/gossipsub.d.ts.map +1 -1
  131. package/lib/network/gossip/gossipsub.js +7 -8
  132. package/lib/network/gossip/gossipsub.js.map +1 -1
  133. package/lib/network/gossip/interface.d.ts +2 -0
  134. package/lib/network/gossip/interface.d.ts.map +1 -1
  135. package/lib/network/gossip/snappy_bun.d.ts +3 -0
  136. package/lib/network/gossip/snappy_bun.d.ts.map +1 -0
  137. package/lib/network/gossip/snappy_bun.js +3 -0
  138. package/lib/network/gossip/snappy_bun.js.map +1 -0
  139. package/lib/network/metadata.d.ts +1 -1
  140. package/lib/network/metadata.d.ts.map +1 -1
  141. package/lib/network/metadata.js +1 -0
  142. package/lib/network/metadata.js.map +1 -1
  143. package/lib/network/network.d.ts.map +1 -1
  144. package/lib/network/network.js +1 -0
  145. package/lib/network/network.js.map +1 -1
  146. package/lib/network/options.d.ts +0 -1
  147. package/lib/network/options.d.ts.map +1 -1
  148. package/lib/network/options.js.map +1 -1
  149. package/lib/network/peers/discover.js +2 -2
  150. package/lib/network/peers/discover.js.map +1 -1
  151. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  152. package/lib/network/processor/gossipHandlers.js +28 -8
  153. package/lib/network/processor/gossipHandlers.js.map +1 -1
  154. package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
  155. package/lib/network/processor/gossipValidatorFn.js +8 -6
  156. package/lib/network/processor/gossipValidatorFn.js.map +1 -1
  157. package/lib/network/processor/types.d.ts +2 -0
  158. package/lib/network/processor/types.d.ts.map +1 -1
  159. package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
  160. package/lib/network/reqresp/ReqRespBeaconNode.js +3 -1
  161. package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
  162. package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts +2 -1
  163. package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts.map +1 -1
  164. package/lib/network/reqresp/handlers/beaconBlocksByRange.js +14 -3
  165. package/lib/network/reqresp/handlers/beaconBlocksByRange.js.map +1 -1
  166. package/lib/network/reqresp/handlers/blobSidecarsByRange.js +5 -5
  167. package/lib/network/reqresp/handlers/blobSidecarsByRange.js.map +1 -1
  168. package/lib/network/reqresp/handlers/blobSidecarsByRoot.js +4 -4
  169. package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +1 -1
  170. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts +2 -1
  171. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
  172. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +9 -1
  173. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
  174. package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.d.ts +2 -1
  175. package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.d.ts.map +1 -1
  176. package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js +9 -1
  177. package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js.map +1 -1
  178. package/lib/network/reqresp/handlers/index.js +6 -6
  179. package/lib/network/reqresp/handlers/index.js.map +1 -1
  180. package/lib/network/reqresp/types.d.ts +1 -0
  181. package/lib/network/reqresp/types.d.ts.map +1 -1
  182. package/lib/network/subnets/attnetsService.d.ts +1 -1
  183. package/lib/network/subnets/attnetsService.js +6 -6
  184. package/lib/network/subnets/attnetsService.js.map +1 -1
  185. package/lib/network/subnets/util.d.ts +3 -2
  186. package/lib/network/subnets/util.d.ts.map +1 -1
  187. package/lib/network/subnets/util.js +6 -6
  188. package/lib/network/subnets/util.js.map +1 -1
  189. package/lib/node/nodejs.d.ts +2 -1
  190. package/lib/node/nodejs.d.ts.map +1 -1
  191. package/lib/node/nodejs.js +2 -1
  192. package/lib/node/nodejs.js.map +1 -1
  193. package/lib/sync/range/range.d.ts.map +1 -1
  194. package/lib/sync/range/range.js +2 -1
  195. package/lib/sync/range/range.js.map +1 -1
  196. package/lib/sync/unknownBlock.js +1 -1
  197. package/lib/sync/unknownBlock.js.map +1 -1
  198. package/lib/sync/utils/downloadByRange.d.ts +59 -15
  199. package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
  200. package/lib/sync/utils/downloadByRange.js +204 -83
  201. package/lib/sync/utils/downloadByRange.js.map +1 -1
  202. package/lib/sync/utils/downloadByRoot.d.ts +8 -14
  203. package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
  204. package/lib/sync/utils/downloadByRoot.js +18 -33
  205. package/lib/sync/utils/downloadByRoot.js.map +1 -1
  206. package/lib/sync/utils/remoteSyncType.d.ts +2 -1
  207. package/lib/sync/utils/remoteSyncType.d.ts.map +1 -1
  208. package/lib/sync/utils/remoteSyncType.js +19 -4
  209. package/lib/sync/utils/remoteSyncType.js.map +1 -1
  210. package/lib/util/blobs.d.ts +1 -1
  211. package/lib/util/blobs.d.ts.map +1 -1
  212. package/lib/util/blobs.js +53 -20
  213. package/lib/util/blobs.js.map +1 -1
  214. package/lib/util/clock.d.ts.map +1 -1
  215. package/lib/util/clock.js +3 -4
  216. package/lib/util/clock.js.map +1 -1
  217. package/lib/util/profile.d.ts +6 -4
  218. package/lib/util/profile.d.ts.map +1 -1
  219. package/lib/util/profile.js +40 -3
  220. package/lib/util/profile.js.map +1 -1
  221. package/lib/util/sszBytes.d.ts +2 -0
  222. package/lib/util/sszBytes.d.ts.map +1 -1
  223. package/lib/util/sszBytes.js +25 -0
  224. package/lib/util/sszBytes.js.map +1 -1
  225. package/package.json +32 -25
  226. package/src/api/impl/beacon/blocks/index.ts +47 -25
  227. package/src/api/impl/config/constants.ts +10 -4
  228. package/src/api/impl/lodestar/index.ts +42 -10
  229. package/src/api/impl/node/utils.ts +1 -1
  230. package/src/api/impl/validator/index.ts +5 -2
  231. package/src/chain/archiveStore/archiveStore.ts +27 -0
  232. package/src/chain/archiveStore/strategies/frequencyStateArchiveStrategy.ts +32 -5
  233. package/src/chain/beaconProposerCache.ts +4 -8
  234. package/src/chain/chain.ts +50 -25
  235. package/src/chain/errors/blobSidecarError.ts +12 -2
  236. package/src/chain/errors/blockError.ts +1 -1
  237. package/src/chain/errors/dataColumnSidecarError.ts +38 -15
  238. package/src/chain/errors/voluntaryExitError.ts +30 -2
  239. package/src/chain/forkChoice/index.ts +178 -2
  240. package/src/chain/interface.ts +2 -0
  241. package/src/chain/lightClient/index.ts +26 -12
  242. package/src/chain/opPools/syncContributionAndProofPool.ts +3 -2
  243. package/src/chain/options.ts +2 -3
  244. package/src/chain/stateCache/datastore/db.ts +89 -1
  245. package/src/chain/stateCache/datastore/file.ts +8 -0
  246. package/src/chain/stateCache/datastore/types.ts +1 -0
  247. package/src/chain/stateCache/persistentCheckpointsCache.ts +45 -2
  248. package/src/chain/validation/attestation.ts +6 -7
  249. package/src/chain/validation/blobSidecar.ts +54 -10
  250. package/src/chain/validation/block.ts +2 -2
  251. package/src/chain/validation/dataColumnSidecar.ts +95 -21
  252. package/src/chain/validation/lightClientOptimisticUpdate.ts +3 -2
  253. package/src/chain/validation/voluntaryExit.ts +14 -4
  254. package/src/constants/constants.ts +0 -6
  255. package/src/constants/network.ts +0 -19
  256. package/src/index.ts +2 -0
  257. package/src/metrics/metrics/lodestar.ts +22 -1
  258. package/src/network/core/networkCore.ts +5 -1
  259. package/src/network/core/networkCoreWorker.ts +9 -9
  260. package/src/network/core/networkCoreWorkerHandler.ts +1 -1
  261. package/src/network/discv5/utils.ts +1 -2
  262. package/src/network/discv5/worker.ts +2 -7
  263. package/src/network/events.ts +1 -1
  264. package/src/network/gossip/encoding.ts +1 -1
  265. package/src/network/gossip/gossipsub.ts +8 -11
  266. package/src/network/gossip/interface.ts +2 -0
  267. package/src/network/gossip/snappy_bun.ts +2 -0
  268. package/src/network/metadata.ts +3 -1
  269. package/src/network/network.ts +1 -0
  270. package/src/network/options.ts +0 -1
  271. package/src/network/peers/discover.ts +2 -2
  272. package/src/network/processor/gossipHandlers.ts +31 -7
  273. package/src/network/processor/gossipValidatorFn.ts +33 -6
  274. package/src/network/processor/types.ts +2 -0
  275. package/src/network/reqresp/ReqRespBeaconNode.ts +3 -1
  276. package/src/network/reqresp/handlers/beaconBlocksByRange.ts +18 -3
  277. package/src/network/reqresp/handlers/blobSidecarsByRange.ts +6 -6
  278. package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +5 -5
  279. package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +13 -1
  280. package/src/network/reqresp/handlers/dataColumnSidecarsByRoot.ts +13 -1
  281. package/src/network/reqresp/handlers/index.ts +6 -6
  282. package/src/network/reqresp/types.ts +1 -0
  283. package/src/network/subnets/attnetsService.ts +6 -6
  284. package/src/network/subnets/util.ts +12 -12
  285. package/src/node/nodejs.ts +3 -0
  286. package/src/sync/range/range.ts +2 -1
  287. package/src/sync/unknownBlock.ts +1 -1
  288. package/src/sync/utils/downloadByRange.ts +273 -108
  289. package/src/sync/utils/downloadByRoot.ts +22 -56
  290. package/src/sync/utils/remoteSyncType.ts +23 -4
  291. package/src/util/blobs.ts +64 -20
  292. package/src/util/clock.ts +3 -4
  293. package/src/util/profile.ts +45 -3
  294. package/src/util/sszBytes.ts +30 -0
@@ -17,6 +17,15 @@ import {StateArchiveStrategy, StatesArchiveOpts} from "../interface.js";
17
17
  */
18
18
  export const PERSIST_TEMP_STATE_EVERY_EPOCHS = 32;
19
19
 
20
+ export enum FrequencyStateArchiveStep {
21
+ LoadLastStoredSlot = "load_last_stored_slot",
22
+ GetFinalizedState = "get_finalized_state",
23
+ // SerializeState is tracked via stateSerializeDuration metric
24
+ PersistState = "persist_state",
25
+ LoadStoredSlotsToDelete = "load_stored_slots_to_delete",
26
+ DeleteOldStates = "delete_old_states",
27
+ }
28
+
20
29
  /**
21
30
  * Archives finalized states from active bucket to archive bucket.
22
31
  *
@@ -47,11 +56,16 @@ export class FrequencyStateArchiveStrategy implements StateArchiveStrategy {
47
56
  * ```
48
57
  */
49
58
  async maybeArchiveState(finalized: CheckpointWithHex, metrics?: Metrics | null): Promise<void> {
59
+ let timer = metrics?.processFinalizedCheckpoint.frequencyStateArchive.startTimer();
50
60
  const lastStoredSlot = await this.db.stateArchive.lastKey();
61
+ timer?.({step: FrequencyStateArchiveStep.LoadLastStoredSlot});
62
+
51
63
  const lastStoredEpoch = computeEpochAtSlot(lastStoredSlot ?? 0);
52
64
  const {archiveStateEpochFrequency} = this.opts;
53
65
 
66
+ const logCtx = {finalizedEpoch: finalized.epoch, lastStoredEpoch, archiveStateEpochFrequency};
54
67
  if (finalized.epoch - lastStoredEpoch >= Math.min(PERSIST_TEMP_STATE_EVERY_EPOCHS, archiveStateEpochFrequency)) {
68
+ this.logger.verbose("Start archiving state", logCtx);
55
69
  await this.archiveState(finalized, metrics);
56
70
 
57
71
  // Only check the current and previous intervals
@@ -60,23 +74,29 @@ export class FrequencyStateArchiveStrategy implements StateArchiveStrategy {
60
74
  (Math.floor(finalized.epoch / archiveStateEpochFrequency) - 1) * archiveStateEpochFrequency
61
75
  );
62
76
 
77
+ timer = metrics?.processFinalizedCheckpoint.frequencyStateArchive.startTimer();
63
78
  const storedStateSlots = await this.db.stateArchive.keys({
64
79
  lt: computeStartSlotAtEpoch(finalized.epoch),
65
80
  gte: computeStartSlotAtEpoch(minEpoch),
66
81
  });
82
+ timer?.({step: FrequencyStateArchiveStep.LoadStoredSlotsToDelete});
67
83
 
68
84
  const statesSlotsToDelete = computeStateSlotsToDelete(storedStateSlots, archiveStateEpochFrequency);
85
+ timer = metrics?.processFinalizedCheckpoint.frequencyStateArchive.startTimer();
69
86
  if (statesSlotsToDelete.length > 0) {
70
87
  await this.db.stateArchive.batchDelete(statesSlotsToDelete);
71
88
  }
89
+ timer?.({step: FrequencyStateArchiveStep.DeleteOldStates});
72
90
 
73
91
  // More logs to investigate the rss spike issue https://github.com/ChainSafe/lodestar/issues/5591
74
92
  this.logger.verbose("Archived state completed", {
75
- finalizedEpoch: finalized.epoch,
93
+ ...logCtx,
76
94
  minEpoch,
77
95
  storedStateSlots: storedStateSlots.join(","),
78
96
  statesSlotsToDelete: statesSlotsToDelete.join(","),
79
97
  });
98
+ } else {
99
+ this.logger.verbose("Skip archiving state", logCtx);
80
100
  }
81
101
  }
82
102
 
@@ -86,24 +106,31 @@ export class FrequencyStateArchiveStrategy implements StateArchiveStrategy {
86
106
  */
87
107
  async archiveState(finalized: CheckpointWithHex, metrics?: Metrics | null): Promise<void> {
88
108
  // starting from Mar 2024, the finalized state could be from disk or in memory
109
+ let timer = metrics?.processFinalizedCheckpoint.frequencyStateArchive.startTimer();
89
110
  const finalizedStateOrBytes = await this.regen.getCheckpointStateOrBytes(finalized);
111
+ timer?.({step: FrequencyStateArchiveStep.GetFinalizedState});
112
+
90
113
  const {rootHex} = finalized;
91
114
  if (!finalizedStateOrBytes) {
92
115
  throw Error(`No state in cache for finalized checkpoint state epoch #${finalized.epoch} root ${rootHex}`);
93
116
  }
94
117
  if (finalizedStateOrBytes instanceof Uint8Array) {
95
118
  const slot = getStateSlotFromBytes(finalizedStateOrBytes);
119
+ timer = metrics?.processFinalizedCheckpoint.frequencyStateArchive.startTimer();
96
120
  await this.db.stateArchive.putBinary(slot, finalizedStateOrBytes);
121
+ timer?.({step: FrequencyStateArchiveStep.PersistState});
97
122
  this.logger.verbose("Archived finalized state bytes", {epoch: finalized.epoch, slot, root: rootHex});
98
123
  } else {
99
124
  // serialize state using BufferPool if provided
100
- const timer = metrics?.stateSerializeDuration.startTimer({source: AllocSource.ARCHIVE_STATE});
125
+ const sszTimer = metrics?.stateSerializeDuration.startTimer({source: AllocSource.ARCHIVE_STATE});
101
126
  await serializeState(
102
127
  finalizedStateOrBytes,
103
128
  AllocSource.ARCHIVE_STATE,
104
- (stateBytes) => {
105
- timer?.();
106
- return this.db.stateArchive.putBinary(finalizedStateOrBytes.slot, stateBytes);
129
+ async (stateBytes) => {
130
+ sszTimer?.();
131
+ timer = metrics?.processFinalizedCheckpoint.frequencyStateArchive.startTimer();
132
+ await this.db.stateArchive.putBinary(finalizedStateOrBytes.slot, stateBytes);
133
+ timer?.({step: FrequencyStateArchiveStep.PersistState});
107
134
  },
108
135
  this.bufferPool
109
136
  );
@@ -1,18 +1,14 @@
1
1
  import {routes} from "@lodestar/api";
2
2
  import {Epoch} from "@lodestar/types";
3
- import {MapDef} from "@lodestar/utils";
4
3
 
5
4
  const PROPOSER_PRESERVE_EPOCHS = 2;
6
5
 
7
6
  export type ProposerPreparationData = routes.validator.ProposerPreparationData;
8
7
 
9
8
  export class BeaconProposerCache {
10
- private readonly feeRecipientByValidatorIndex: MapDef<number, {epoch: Epoch; feeRecipient: string}>;
11
- constructor(opts: {suggestedFeeRecipient: string}) {
12
- this.feeRecipientByValidatorIndex = new MapDef(() => ({
13
- epoch: 0,
14
- feeRecipient: opts.suggestedFeeRecipient,
15
- }));
9
+ private readonly feeRecipientByValidatorIndex: Map<number, {epoch: Epoch; feeRecipient: string}>;
10
+ constructor(readonly opts: {suggestedFeeRecipient: string}) {
11
+ this.feeRecipientByValidatorIndex = new Map();
16
12
  }
17
13
 
18
14
  add(epoch: Epoch, {validatorIndex, feeRecipient}: ProposerPreparationData): void {
@@ -30,7 +26,7 @@ export class BeaconProposerCache {
30
26
  }
31
27
 
32
28
  getOrDefault(proposerIndex: number): string {
33
- return this.feeRecipientByValidatorIndex.getOrDefault(proposerIndex).feeRecipient;
29
+ return this.feeRecipientByValidatorIndex.get(proposerIndex)?.feeRecipient ?? this.opts.suggestedFeeRecipient;
34
30
  }
35
31
 
36
32
  get(proposerIndex: number): string | undefined {
@@ -37,6 +37,7 @@ import {
37
37
  ValidatorIndex,
38
38
  Wei,
39
39
  isBlindedBeaconBlock,
40
+ phase0,
40
41
  } from "@lodestar/types";
41
42
  import {Logger, fromHex, gweiToWei, isErrorAborted, pruneSetToMax, sleep, toRootHex} from "@lodestar/utils";
42
43
  import {ProcessShutdownCallback} from "@lodestar/validator";
@@ -95,11 +96,13 @@ import {SeenBlockAttesters} from "./seenCache/seenBlockAttesters.js";
95
96
  import {SeenBlockInput} from "./seenCache/seenGossipBlockInput.js";
96
97
  import {ShufflingCache} from "./shufflingCache.js";
97
98
  import {BlockStateCacheImpl} from "./stateCache/blockStateCacheImpl.js";
98
- import {DbCPStateDatastore} from "./stateCache/datastore/db.js";
99
+ import {DbCPStateDatastore, checkpointToDatastoreKey} from "./stateCache/datastore/db.js";
99
100
  import {FileCPStateDatastore} from "./stateCache/datastore/file.js";
101
+ import {CPStateDatastore} from "./stateCache/datastore/types.js";
100
102
  import {FIFOBlockStateCache} from "./stateCache/fifoBlockStateCache.js";
101
103
  import {InMemoryCheckpointStateCache} from "./stateCache/inMemoryCheckpointsCache.js";
102
104
  import {PersistentCheckpointStateCache} from "./stateCache/persistentCheckpointsCache.js";
105
+ import {CheckpointStateCache} from "./stateCache/types.js";
103
106
  import {ValidatorMonitor} from "./validatorMonitor.js";
104
107
 
105
108
  /**
@@ -181,6 +184,8 @@ export class BeaconChain implements IBeaconChain {
181
184
 
182
185
  protected readonly blockProcessor: BlockProcessor;
183
186
  protected readonly db: IBeaconDb;
187
+ // this is only available if nHistoricalStates is enabled
188
+ private readonly cpStateDatastore?: CPStateDatastore;
184
189
  private abortController = new AbortController();
185
190
  private processShutdownCallback: ProcessShutdownCallback;
186
191
  private _earliestAvailableSlot: Slot;
@@ -210,6 +215,7 @@ export class BeaconChain implements IBeaconChain {
210
215
  metrics,
211
216
  validatorMonitor,
212
217
  anchorState,
218
+ isAnchorStateFinalized,
213
219
  eth1,
214
220
  executionEngine,
215
221
  executionBuilder,
@@ -226,6 +232,7 @@ export class BeaconChain implements IBeaconChain {
226
232
  metrics: Metrics | null;
227
233
  validatorMonitor: ValidatorMonitor | null;
228
234
  anchorState: BeaconStateAllForks;
235
+ isAnchorStateFinalized: boolean;
229
236
  eth1: IEth1ForBlockProduction;
230
237
  executionEngine: IExecutionEngine;
231
238
  executionBuilder?: IExecutionBuilder;
@@ -257,15 +264,14 @@ export class BeaconChain implements IBeaconChain {
257
264
  this.attestationPool = new AttestationPool(config, clock, this.opts?.preaggregateSlotDistance, metrics);
258
265
  this.aggregatedAttestationPool = new AggregatedAttestationPool(this.config, metrics);
259
266
  this.syncCommitteeMessagePool = new SyncCommitteeMessagePool(config, clock, this.opts?.preaggregateSlotDistance);
260
- this.syncContributionAndProofPool = new SyncContributionAndProofPool(clock, metrics, logger);
267
+ this.syncContributionAndProofPool = new SyncContributionAndProofPool(config, clock, metrics, logger);
261
268
 
262
269
  this.seenAggregatedAttestations = new SeenAggregatedAttestations(metrics);
263
270
  this.seenContributionAndProof = new SeenContributionAndProof(metrics);
264
271
  this.seenAttestationDatas = new SeenAttestationDatas(metrics, this.opts?.attDataCacheSlotDistance);
265
272
 
266
273
  const nodeId = computeNodeIdFromPrivateKey(privateKey);
267
- const initialCustodyGroupCount =
268
- opts.initialCustodyGroupCount ?? (opts.supernode ? config.NUMBER_OF_CUSTODY_GROUPS : config.CUSTODY_REQUIREMENT);
274
+ const initialCustodyGroupCount = opts.initialCustodyGroupCount ?? config.CUSTODY_REQUIREMENT;
269
275
  this.metrics?.peerDas.targetCustodyGroupCount.set(initialCustodyGroupCount);
270
276
  this.custodyConfig = new CustodyConfig({
271
277
  nodeId,
@@ -326,23 +332,26 @@ export class BeaconChain implements IBeaconChain {
326
332
  this.bufferPool = this.opts.nHistoricalStates
327
333
  ? new BufferPool(anchorState.type.tree_serializedSize(anchorState.node), metrics)
328
334
  : null;
329
- const checkpointStateCache = this.opts.nHistoricalStates
330
- ? new PersistentCheckpointStateCache(
331
- {
332
- metrics,
333
- logger,
334
- clock,
335
- blockStateCache,
336
- bufferPool: this.bufferPool,
337
- datastore: fileDataStore
338
- ? // debug option if we want to investigate any issues with the DB
339
- new FileCPStateDatastore(dataDir)
340
- : // production option
341
- new DbCPStateDatastore(this.db),
342
- },
343
- this.opts
344
- )
345
- : new InMemoryCheckpointStateCache({metrics});
335
+
336
+ let checkpointStateCache: CheckpointStateCache;
337
+ this.cpStateDatastore = undefined;
338
+ if (this.opts.nHistoricalStates) {
339
+ this.cpStateDatastore = fileDataStore ? new FileCPStateDatastore(dataDir) : new DbCPStateDatastore(this.db);
340
+ checkpointStateCache = new PersistentCheckpointStateCache(
341
+ {
342
+ metrics,
343
+ logger,
344
+ clock,
345
+ blockStateCache,
346
+ bufferPool: this.bufferPool,
347
+ datastore: this.cpStateDatastore,
348
+ },
349
+ this.opts
350
+ );
351
+ } else {
352
+ checkpointStateCache = new InMemoryCheckpointStateCache({metrics});
353
+ }
354
+
346
355
  const {checkpoint} = computeAnchorCheckpoint(config, anchorState);
347
356
  blockStateCache.add(cachedState);
348
357
  blockStateCache.setHeadState(cachedState);
@@ -353,6 +362,7 @@ export class BeaconChain implements IBeaconChain {
353
362
  emitter,
354
363
  clock.currentSlot,
355
364
  cachedState,
365
+ isAnchorStateFinalized,
356
366
  opts,
357
367
  this.justifiedBalancesGetter.bind(this),
358
368
  metrics,
@@ -372,7 +382,7 @@ export class BeaconChain implements IBeaconChain {
372
382
  });
373
383
 
374
384
  if (!opts.disableLightClientServer) {
375
- this.lightClientServer = new LightClientServer(opts, {config, db, metrics, emitter, logger});
385
+ this.lightClientServer = new LightClientServer(opts, {config, clock, db, metrics, emitter, logger});
376
386
  }
377
387
 
378
388
  this.reprocessController = new ReprocessController(this.metrics);
@@ -604,6 +614,20 @@ export class BeaconChain implements IBeaconChain {
604
614
  return data && {state: data, executionOptimistic: false, finalized: true};
605
615
  }
606
616
 
617
+ async getPersistedCheckpointState(checkpoint?: phase0.Checkpoint): Promise<Uint8Array | null> {
618
+ if (!this.cpStateDatastore) {
619
+ throw new Error("n-historical-state flag is not enabled");
620
+ }
621
+
622
+ if (checkpoint == null) {
623
+ // return the last safe checkpoint state by default
624
+ return this.cpStateDatastore.readLatestSafe();
625
+ }
626
+
627
+ const persistedKey = checkpointToDatastoreKey(checkpoint);
628
+ return this.cpStateDatastore.read(persistedKey);
629
+ }
630
+
607
631
  getStateByCheckpoint(
608
632
  checkpoint: CheckpointWithHex
609
633
  ): {state: BeaconStateAllForks; executionOptimistic: boolean; finalized: boolean} | null {
@@ -1216,9 +1240,10 @@ export class BeaconChain implements IBeaconChain {
1216
1240
  }
1217
1241
 
1218
1242
  private async updateValidatorsCustodyRequirement(finalizedCheckpoint: CheckpointWithHex): Promise<void> {
1219
- if (this.opts.supernode) {
1220
- // Disable dynamic custody updates for supernodes since they must maintain custody
1221
- // of all custody groups regardless of validator effective balances
1243
+ if (this.custodyConfig.targetCustodyGroupCount === this.config.NUMBER_OF_CUSTODY_GROUPS) {
1244
+ // Custody requirements can only be increased, we can disable dynamic custody updates
1245
+ // if the node already maintains custody of all custody groups in case it is configured
1246
+ // as a supernode or has validators attached with a total effective balance of at least 4096 ETH.
1222
1247
  return;
1223
1248
  }
1224
1249
 
@@ -50,9 +50,19 @@ export type BlobSidecarErrorType =
50
50
  | {code: BlobSidecarErrorCode.FUTURE_SLOT; blockSlot: Slot; currentSlot: Slot}
51
51
  | {code: BlobSidecarErrorCode.WOULD_REVERT_FINALIZED_SLOT; blockSlot: Slot; finalizedSlot: Slot}
52
52
  | {code: BlobSidecarErrorCode.ALREADY_KNOWN; root: RootHex}
53
- | {code: BlobSidecarErrorCode.PARENT_UNKNOWN; parentRoot: RootHex}
53
+ | {
54
+ code: BlobSidecarErrorCode.PARENT_UNKNOWN;
55
+ parentRoot: RootHex;
56
+ slot: Slot;
57
+ blockRoot: RootHex;
58
+ }
54
59
  | {code: BlobSidecarErrorCode.NOT_LATER_THAN_PARENT; parentSlot: Slot; slot: Slot}
55
- | {code: BlobSidecarErrorCode.PROPOSAL_SIGNATURE_INVALID}
60
+ | {
61
+ code: BlobSidecarErrorCode.PROPOSAL_SIGNATURE_INVALID;
62
+ blockRoot: RootHex;
63
+ slot: Slot;
64
+ index: number;
65
+ }
56
66
  | {code: BlobSidecarErrorCode.INCLUSION_PROOF_INVALID; slot: Slot; blobIdx: number}
57
67
  | {code: BlobSidecarErrorCode.INCORRECT_PROPOSER; proposerIndex: ValidatorIndex};
58
68
 
@@ -87,7 +87,7 @@ export type BlockErrorType =
87
87
  | {code: BlockErrorCode.REPEAT_PROPOSAL; proposerIndex: ValidatorIndex}
88
88
  | {code: BlockErrorCode.BLOCK_SLOT_LIMIT_REACHED}
89
89
  | {code: BlockErrorCode.INCORRECT_PROPOSER; proposerIndex: ValidatorIndex}
90
- | {code: BlockErrorCode.PROPOSAL_SIGNATURE_INVALID}
90
+ | {code: BlockErrorCode.PROPOSAL_SIGNATURE_INVALID; blockSlot: Slot}
91
91
  | {code: BlockErrorCode.UNKNOWN_PROPOSER; proposerIndex: ValidatorIndex}
92
92
  | {code: BlockErrorCode.INVALID_SIGNATURE; state: CachedBeaconStateAllForks}
93
93
  | {
@@ -8,13 +8,18 @@ export enum DataColumnSidecarErrorCode {
8
8
  MISMATCHED_LENGTHS = "DATA_COLUMN_SIDECAR_ERROR_MISMATCHED_LENGTHS",
9
9
  INVALID_SUBNET = "DATA_COLUMN_SIDECAR_ERROR_INVALID_SUBNET",
10
10
  INVALID_KZG_PROOF = "DATA_COLUMN_SIDECAR_ERROR_INVALID_KZG_PROOF",
11
+ TOO_MANY_KZG_COMMITMENTS = "DATA_COLUMN_SIDECAR_ERROR_TOO_MANY_KZG_COMMITMENTS",
11
12
 
12
13
  // Validation errors when validating against an existing block
13
14
 
15
+ /** Block and sidecars header root mismatch */
16
+ INCORRECT_HEADER_ROOT = "DATA_COLUMN_SIDECAR_ERROR_INCORRECT_HEADER_ROOT",
14
17
  /** Block and sidecars data column count mismatch */
15
18
  INCORRECT_SIDECAR_COUNT = "DATA_COLUMN_SIDECAR_ERROR_INCORRECT_SIDECAR_COUNT",
16
19
  /** Sidecar doesn't match block */
17
20
  INCORRECT_BLOCK = "DATA_COLUMN_SIDECAR_ERROR_INCORRECT_BLOCK",
21
+ /** Sidecar cell count not as expected */
22
+ INCORRECT_CELL_COUNT = "DATA_COLUMN_SIDECAR_ERROR_INCORRECT_CELL_COUNT",
18
23
  /** Sidecar kzg proof count not as expected */
19
24
  INCORRECT_KZG_COMMITMENTS_COUNT = "DATA_COLUMN_SIDECAR_ERROR_INCORRECT_KZG_COMMITMENTS_COUNT",
20
25
  /** Sidecar kzg proof count not as expected */
@@ -34,42 +39,60 @@ export enum DataColumnSidecarErrorCode {
34
39
  }
35
40
 
36
41
  export type DataColumnSidecarErrorType =
37
- | {code: DataColumnSidecarErrorCode.INVALID_INDEX; slot: Slot; columnIdx: number}
38
- | {code: DataColumnSidecarErrorCode.NO_COMMITMENTS; slot: Slot; columnIdx: number}
42
+ | {code: DataColumnSidecarErrorCode.INVALID_INDEX; slot: Slot; columnIndex: number}
43
+ | {code: DataColumnSidecarErrorCode.NO_COMMITMENTS; slot: Slot; columnIndex: number}
39
44
  | {
40
45
  code: DataColumnSidecarErrorCode.MISMATCHED_LENGTHS;
41
46
  columnLength: number;
42
47
  commitmentsLength: number;
43
48
  proofsLength: number;
44
49
  }
45
- | {code: DataColumnSidecarErrorCode.INVALID_SUBNET; columnIdx: number; gossipSubnet: SubnetID}
46
- | {code: DataColumnSidecarErrorCode.ALREADY_KNOWN; columnIdx: number; slot: Slot}
50
+ | {code: DataColumnSidecarErrorCode.INVALID_SUBNET; columnIndex: number; gossipSubnet: SubnetID}
51
+ | {
52
+ code: DataColumnSidecarErrorCode.TOO_MANY_KZG_COMMITMENTS;
53
+ slot: number;
54
+ columnIndex: number;
55
+ count: number;
56
+ limit: number;
57
+ }
58
+ | {code: DataColumnSidecarErrorCode.ALREADY_KNOWN; columnIndex: number; slot: Slot}
47
59
  | {code: DataColumnSidecarErrorCode.FUTURE_SLOT; blockSlot: Slot; currentSlot: Slot}
48
60
  | {code: DataColumnSidecarErrorCode.WOULD_REVERT_FINALIZED_SLOT; blockSlot: Slot; finalizedSlot: Slot}
49
- | {code: DataColumnSidecarErrorCode.PARENT_UNKNOWN; parentRoot: RootHex}
50
- | {code: DataColumnSidecarErrorCode.PROPOSAL_SIGNATURE_INVALID}
61
+ | {
62
+ code: DataColumnSidecarErrorCode.PARENT_UNKNOWN;
63
+ parentRoot: RootHex;
64
+ slot: Slot;
65
+ }
66
+ | {
67
+ code: DataColumnSidecarErrorCode.PROPOSAL_SIGNATURE_INVALID;
68
+ slot: Slot;
69
+ blockRoot: RootHex;
70
+ index: number;
71
+ }
51
72
  | {code: DataColumnSidecarErrorCode.NOT_LATER_THAN_PARENT; parentSlot: Slot; slot: Slot}
52
- | {code: DataColumnSidecarErrorCode.INCLUSION_PROOF_INVALID; slot: Slot; columnIdx: number}
53
- | {code: DataColumnSidecarErrorCode.INVALID_KZG_PROOF; slot: Slot; columnIdx: number}
73
+ | {code: DataColumnSidecarErrorCode.INCLUSION_PROOF_INVALID; slot: Slot; columnIndex: number}
74
+ | {code: DataColumnSidecarErrorCode.INVALID_KZG_PROOF; slot: Slot; columnIndex: number}
54
75
  | {code: DataColumnSidecarErrorCode.INCORRECT_SIDECAR_COUNT; slot: number; expected: number; actual: number}
55
76
  | {
56
77
  code: DataColumnSidecarErrorCode.INCORRECT_BLOCK;
57
78
  slot: number;
58
- columnIdx: number;
79
+ columnIndex: number;
59
80
  expected: string;
60
81
  actual: string;
61
82
  }
62
83
  | {
63
- code: DataColumnSidecarErrorCode.INCORRECT_KZG_COMMITMENTS_COUNT;
84
+ code: DataColumnSidecarErrorCode.INCORRECT_HEADER_ROOT;
64
85
  slot: number;
65
- columnIdx: number;
66
- expected: number;
67
- actual: number;
86
+ expected: string;
87
+ actual: string;
68
88
  }
69
89
  | {
70
- code: DataColumnSidecarErrorCode.INCORRECT_KZG_PROOF_COUNT;
90
+ code:
91
+ | DataColumnSidecarErrorCode.INCORRECT_CELL_COUNT
92
+ | DataColumnSidecarErrorCode.INCORRECT_KZG_COMMITMENTS_COUNT
93
+ | DataColumnSidecarErrorCode.INCORRECT_KZG_PROOF_COUNT;
71
94
  slot: number;
72
- columnIdx: number;
95
+ columnIndex: number;
73
96
  expected: number;
74
97
  actual: number;
75
98
  }
@@ -1,13 +1,41 @@
1
+ import {VoluntaryExitValidity} from "@lodestar/state-transition";
1
2
  import {GossipActionError} from "./gossipValidation.js";
2
3
 
3
4
  export enum VoluntaryExitErrorCode {
4
5
  ALREADY_EXISTS = "VOLUNTARY_EXIT_ERROR_ALREADY_EXISTS",
5
- INVALID = "VOLUNTARY_EXIT_ERROR_INVALID",
6
+ INACTIVE = "VOLUNTARY_EXIT_ERROR_INACTIVE",
7
+ ALREADY_EXITED = "VOLUNTARY_EXIT_ERROR_ALREADY_EXITED",
8
+ EARLY_EPOCH = "VOLUNTARY_EXIT_ERROR_EARLY_EPOCH",
9
+ SHORT_TIME_ACTIVE = "VOLUNTARY_EXIT_ERROR_SHORT_TIME_ACTIVE",
10
+ PENDING_WITHDRAWALS = "VOLUNTARY_EXIT_ERROR_PENDING_WITHDRAWALS",
6
11
  INVALID_SIGNATURE = "VOLUNTARY_EXIT_ERROR_INVALID_SIGNATURE",
7
12
  }
8
13
  export type VoluntaryExitErrorType =
9
14
  | {code: VoluntaryExitErrorCode.ALREADY_EXISTS}
10
- | {code: VoluntaryExitErrorCode.INVALID}
15
+ | {code: VoluntaryExitErrorCode.INACTIVE}
16
+ | {code: VoluntaryExitErrorCode.ALREADY_EXITED}
17
+ | {code: VoluntaryExitErrorCode.EARLY_EPOCH}
18
+ | {code: VoluntaryExitErrorCode.SHORT_TIME_ACTIVE}
19
+ | {code: VoluntaryExitErrorCode.PENDING_WITHDRAWALS}
11
20
  | {code: VoluntaryExitErrorCode.INVALID_SIGNATURE};
12
21
 
13
22
  export class VoluntaryExitError extends GossipActionError<VoluntaryExitErrorType> {}
23
+
24
+ export function voluntaryExitValidityToErrorCode(
25
+ validity: Exclude<VoluntaryExitValidity, VoluntaryExitValidity.valid>
26
+ ): VoluntaryExitErrorCode {
27
+ switch (validity) {
28
+ case VoluntaryExitValidity.inactive:
29
+ return VoluntaryExitErrorCode.INACTIVE;
30
+ case VoluntaryExitValidity.alreadyExited:
31
+ return VoluntaryExitErrorCode.ALREADY_EXITED;
32
+ case VoluntaryExitValidity.earlyEpoch:
33
+ return VoluntaryExitErrorCode.EARLY_EPOCH;
34
+ case VoluntaryExitValidity.shortTimeActive:
35
+ return VoluntaryExitErrorCode.SHORT_TIME_ACTIVE;
36
+ case VoluntaryExitValidity.pendingWithdrawals:
37
+ return VoluntaryExitErrorCode.PENDING_WITHDRAWALS;
38
+ case VoluntaryExitValidity.invalidSignature:
39
+ return VoluntaryExitErrorCode.INVALID_SIGNATURE;
40
+ }
41
+ }