@lodestar/beacon-node 1.48.0-dev.af8bc602aa → 1.48.0-dev.b0ddac0ac2

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 (39) hide show
  1. package/lib/chain/archiveStore/historicalState/metrics.d.ts.map +1 -1
  2. package/lib/chain/archiveStore/historicalState/metrics.js +12 -1
  3. package/lib/chain/archiveStore/historicalState/metrics.js.map +1 -1
  4. package/lib/chain/errors/blockError.d.ts +3 -5
  5. package/lib/chain/errors/blockError.d.ts.map +1 -1
  6. package/lib/chain/errors/blockError.js +2 -2
  7. package/lib/chain/errors/blockError.js.map +1 -1
  8. package/lib/chain/errors/executionPayloadEnvelope.d.ts +0 -11
  9. package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
  10. package/lib/chain/errors/executionPayloadEnvelope.js +0 -2
  11. package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
  12. package/lib/chain/prepareNextSlot.js +13 -13
  13. package/lib/chain/prepareNextSlot.js.map +1 -1
  14. package/lib/chain/validation/block.d.ts.map +1 -1
  15. package/lib/chain/validation/block.js +9 -50
  16. package/lib/chain/validation/block.js.map +1 -1
  17. package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
  18. package/lib/chain/validation/executionPayloadEnvelope.js +0 -29
  19. package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
  20. package/lib/network/gossip/encoding.d.ts.map +1 -1
  21. package/lib/network/gossip/encoding.js +0 -6
  22. package/lib/network/gossip/encoding.js.map +1 -1
  23. package/lib/network/gossip/topic.d.ts +2 -1
  24. package/lib/network/gossip/topic.d.ts.map +1 -1
  25. package/lib/network/gossip/topic.js +4 -20
  26. package/lib/network/gossip/topic.js.map +1 -1
  27. package/lib/network/reqresp/protocols.d.ts.map +1 -1
  28. package/lib/network/reqresp/protocols.js +6 -22
  29. package/lib/network/reqresp/protocols.js.map +1 -1
  30. package/package.json +15 -15
  31. package/src/chain/archiveStore/historicalState/metrics.ts +14 -1
  32. package/src/chain/errors/blockError.ts +3 -3
  33. package/src/chain/errors/executionPayloadEnvelope.ts +0 -9
  34. package/src/chain/prepareNextSlot.ts +16 -16
  35. package/src/chain/validation/block.ts +9 -66
  36. package/src/chain/validation/executionPayloadEnvelope.ts +0 -37
  37. package/src/network/gossip/encoding.ts +0 -6
  38. package/src/network/gossip/topic.ts +3 -25
  39. package/src/network/reqresp/protocols.ts +7 -24
@@ -1,5 +1,5 @@
1
1
  import {BeaconConfig} from "@lodestar/config";
2
- import {ForkName, MAX_DATA_COLUMN_SIDECAR_SIZE, isForkPostGloas} from "@lodestar/params";
2
+ import {ForkName} from "@lodestar/params";
3
3
  import {ContextBytesFactory, ContextBytesType, Encoding, TypeSizes} from "@lodestar/reqresp";
4
4
  import {rateLimitQuotas} from "./rateLimit.js";
5
5
  import {ProtocolNoHandler, ReqRespMethod, Version, requestSszTypeByMethod, responseSszTypeByMethod} from "./types.js";
@@ -151,35 +151,18 @@ function toProtocol(protocol: ProtocolSummary) {
151
151
  encoding: Encoding.SSZ_SNAPPY,
152
152
  contextBytes: toContextBytes(protocol.contextBytesType, config),
153
153
  inboundRateLimits: rateLimitQuotas(fork, config)[protocol.method],
154
- requestSizes: requestType === null ? null : clampTypeSizes(requestType, protocol.method, fork, config),
155
- responseSizes: (fork) =>
156
- clampTypeSizes(responseSszTypeByMethod[protocol.method](fork, protocol.version), protocol.method, fork, config),
154
+ requestSizes: requestType === null ? null : clampTypeSizes(requestType, config),
155
+ responseSizes: (fork) => clampTypeSizes(responseSszTypeByMethod[protocol.method](fork, protocol.version), config),
157
156
  };
158
157
  };
159
158
  }
160
159
 
161
160
  /**
162
- * Bound the sizes accepted from the ssz-snappy length-prefix. Gloas progressive containers have broad
163
- * theoretical SSZ max sizes so the preset p2p bounds must be used instead.
164
- *
165
- * The length-prefix must be within the size bounds derived from the payload SSZ type or `MAX_PAYLOAD_SIZE`,
166
- * whichever is smaller, see
167
- * https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.12/specs/phase0/p2p-interface.md#encoding-strategies.
168
- * Type-specific SSZ bounds supersede the bounds derived from the SSZ type, see
169
- * https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.12/specs/gloas/p2p-interface.md#type-specific-ssz-bounds.
161
+ * Length-prefix must be within the SSZ type bounds or MAX_PAYLOAD_SIZE, whichever is smaller
162
+ * https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.12/specs/phase0/p2p-interface.md#encoding-strategies
170
163
  */
171
- function clampTypeSizes(type: TypeSizes, method: ReqRespMethod, fork: ForkName, config: BeaconConfig): TypeSizes {
172
- let typeSpecificBound = config.MAX_PAYLOAD_SIZE;
173
- if (isForkPostGloas(fork)) {
174
- switch (method) {
175
- case ReqRespMethod.DataColumnSidecarsByRange:
176
- case ReqRespMethod.DataColumnSidecarsByRoot:
177
- typeSpecificBound = MAX_DATA_COLUMN_SIDECAR_SIZE;
178
- break;
179
- }
180
- }
181
-
182
- return {minSize: type.minSize, maxSize: Math.min(type.maxSize, typeSpecificBound)};
164
+ function clampTypeSizes(type: TypeSizes, config: BeaconConfig): TypeSizes {
165
+ return {minSize: type.minSize, maxSize: Math.min(type.maxSize, config.MAX_PAYLOAD_SIZE)};
183
166
  }
184
167
 
185
168
  function toContextBytes(type: ContextBytesType, config: BeaconConfig): ContextBytesFactory {