@lodestar/beacon-node 1.48.0-dev.dd957b093d → 1.48.0-dev.e1303d42b0
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/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +0 -7
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +14 -0
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/config/index.d.ts.map +1 -1
- package/lib/api/impl/config/index.js +4 -1
- package/lib/api/impl/config/index.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts +5 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +9 -3
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/index.d.ts +8 -4
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +80 -15
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +8 -0
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/utils/chainSegment.d.ts.map +1 -1
- package/lib/chain/blocks/utils/chainSegment.js +16 -10
- package/lib/chain/blocks/utils/chainSegment.js.map +1 -1
- package/lib/chain/chain.d.ts +2 -2
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +2 -2
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +4 -0
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +1 -0
- package/lib/chain/errors/executionPayloadBid.js.map +1 -1
- package/lib/chain/interface.d.ts +2 -2
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +16 -0
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/execution/builder/validateBid.d.ts.map +1 -1
- package/lib/execution/builder/validateBid.js +3 -0
- package/lib/execution/builder/validateBid.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +0 -3
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +0 -5
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +378 -278
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +11 -16
- package/lib/network/processor/index.js.map +1 -1
- package/lib/sync/range/range.d.ts.map +1 -1
- package/lib/sync/range/range.js +22 -1
- package/lib/sync/range/range.js.map +1 -1
- package/package.json +14 -14
- package/src/api/impl/beacon/blocks/index.ts +0 -10
- package/src/api/impl/beacon/state/utils.ts +15 -0
- package/src/api/impl/config/index.ts +4 -1
- package/src/chain/blocks/importBlock.ts +21 -5
- package/src/chain/blocks/index.ts +107 -21
- package/src/chain/blocks/types.ts +9 -0
- package/src/chain/blocks/utils/chainSegment.ts +16 -11
- package/src/chain/chain.ts +4 -4
- package/src/chain/errors/executionPayloadBid.ts +2 -0
- package/src/chain/interface.ts +2 -2
- package/src/chain/opPools/aggregatedAttestationPool.ts +1 -1
- package/src/chain/validation/executionPayloadBid.ts +18 -0
- package/src/execution/builder/validateBid.ts +4 -0
- package/src/metrics/metrics/lodestar.ts +0 -5
- package/src/network/processor/gossipHandlers.ts +487 -348
- package/src/network/processor/index.ts +11 -17
- package/src/sync/range/range.ts +21 -1
|
@@ -11,7 +11,6 @@ import {IBeaconChain} from "../../chain/interface.js";
|
|
|
11
11
|
import {IBeaconDb} from "../../db/interface.js";
|
|
12
12
|
import {Metrics} from "../../metrics/metrics.js";
|
|
13
13
|
import {ClockEvent} from "../../util/clock.js";
|
|
14
|
-
import {callInNextEventLoop} from "../../util/eventLoop.js";
|
|
15
14
|
import {PeerIdStr} from "../../util/peerId.js";
|
|
16
15
|
import {
|
|
17
16
|
getBeaconBlockRootFromExecutionPayloadEnvelopeSerialized,
|
|
@@ -781,27 +780,22 @@ export class NetworkProcessor {
|
|
|
781
780
|
this.trackJobTime(messageOrArray, 1, acceptanceArr[0]);
|
|
782
781
|
}
|
|
783
782
|
|
|
784
|
-
//
|
|
785
|
-
//
|
|
786
|
-
//
|
|
787
|
-
|
|
783
|
+
// Report the validation verdict synchronously so it reaches the network worker before any deferred
|
|
784
|
+
// handler (e.g. block import) runs on the next event loop. At network thread side, gossipsub onValidationResult()
|
|
785
|
+
// has its own callInNextEventLoop
|
|
788
786
|
if (Array.isArray(messageOrArray)) {
|
|
789
787
|
for (const [i, msg] of messageOrArray.entries()) {
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
acceptance: acceptanceArr[i],
|
|
795
|
-
});
|
|
788
|
+
this.events.emit(NetworkEvent.gossipMessageValidationResult, {
|
|
789
|
+
msgId: msg.msgId,
|
|
790
|
+
propagationSource: msg.propagationSource,
|
|
791
|
+
acceptance: acceptanceArr[i],
|
|
796
792
|
});
|
|
797
793
|
}
|
|
798
794
|
} else {
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
acceptance: acceptanceArr[0],
|
|
804
|
-
});
|
|
795
|
+
this.events.emit(NetworkEvent.gossipMessageValidationResult, {
|
|
796
|
+
msgId: messageOrArray.msgId,
|
|
797
|
+
propagationSource: messageOrArray.propagationSource,
|
|
798
|
+
acceptance: acceptanceArr[0],
|
|
805
799
|
});
|
|
806
800
|
}
|
|
807
801
|
}
|
package/src/sync/range/range.ts
CHANGED
|
@@ -217,7 +217,27 @@ export class RangeSync extends (EventEmitter as {new (): RangeSyncEmitter}) {
|
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
} else {
|
|
220
|
-
await this.chain.processChainSegment(blocks, payloadEnvelopes, flags);
|
|
220
|
+
const {orphaned, skipped} = await this.chain.processChainSegment(blocks, payloadEnvelopes, flags);
|
|
221
|
+
// We log orphaned payloads to work with different clients
|
|
222
|
+
// in the future, consider applying penalties in certain conditions
|
|
223
|
+
for (const {slot, payloadEnvelopeInput} of orphaned) {
|
|
224
|
+
const peerIdStr = payloadEnvelopeInput.getPayloadEnvelopeSource().peerIdStr;
|
|
225
|
+
let client = "unknown";
|
|
226
|
+
if (peerIdStr !== undefined) {
|
|
227
|
+
try {
|
|
228
|
+
client = this.getConnectedPeerSyncMeta(peerIdStr).client;
|
|
229
|
+
} catch {
|
|
230
|
+
// peer disconnected since serving the envelope, keep "unknown"
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
this.logger.debug("Orphaned payload envelope in range sync batch", {
|
|
234
|
+
slot,
|
|
235
|
+
root: payloadEnvelopeInput.blockRootHex,
|
|
236
|
+
peer: peerIdStr ?? "unknown",
|
|
237
|
+
client,
|
|
238
|
+
skipped,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
221
241
|
}
|
|
222
242
|
};
|
|
223
243
|
|