@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.
- package/lib/chain/archiveStore/historicalState/metrics.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/metrics.js +12 -1
- package/lib/chain/archiveStore/historicalState/metrics.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +3 -5
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +2 -2
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +0 -11
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +0 -2
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/prepareNextSlot.js +13 -13
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +9 -50
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +0 -29
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/network/gossip/encoding.d.ts.map +1 -1
- package/lib/network/gossip/encoding.js +0 -6
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +2 -1
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +4 -20
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +6 -22
- package/lib/network/reqresp/protocols.js.map +1 -1
- package/package.json +15 -15
- package/src/chain/archiveStore/historicalState/metrics.ts +14 -1
- package/src/chain/errors/blockError.ts +3 -3
- package/src/chain/errors/executionPayloadEnvelope.ts +0 -9
- package/src/chain/prepareNextSlot.ts +16 -16
- package/src/chain/validation/block.ts +9 -66
- package/src/chain/validation/executionPayloadEnvelope.ts +0 -37
- package/src/network/gossip/encoding.ts +0 -6
- package/src/network/gossip/topic.ts +3 -25
- package/src/network/reqresp/protocols.ts +7 -24
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
|
-
import {ForkName
|
|
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,
|
|
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
|
-
*
|
|
163
|
-
*
|
|
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,
|
|
172
|
-
|
|
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 {
|