@lodestar/beacon-node 1.43.0 → 1.44.0-dev.552cdce8d0
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/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +46 -5
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +18 -11
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/chain.d.ts +2 -1
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +3 -1
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +19 -1
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +3 -0
- package/lib/chain/errors/executionPayloadBid.js.map +1 -1
- package/lib/chain/interface.d.ts +2 -1
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +1 -1
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/opPools/index.d.ts +1 -0
- package/lib/chain/opPools/index.d.ts.map +1 -1
- package/lib/chain/opPools/index.js +1 -0
- package/lib/chain/opPools/index.js.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.d.ts +1 -1
- package/lib/chain/opPools/payloadAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.js +30 -10
- package/lib/chain/opPools/payloadAttestationPool.js.map +1 -1
- package/lib/chain/opPools/proposerPreferencesPool.d.ts +29 -0
- package/lib/chain/opPools/proposerPreferencesPool.d.ts.map +1 -0
- package/lib/chain/opPools/proposerPreferencesPool.js +56 -0
- package/lib/chain/opPools/proposerPreferencesPool.js.map +1 -0
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +64 -16
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.d.ts +1 -1
- package/lib/chain/validation/payloadAttestationMessage.d.ts.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +5 -3
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +19 -766
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/interface.d.ts +1 -0
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/network.d.ts +1 -0
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +5 -0
- package/lib/network/network.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +8 -3
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/util/dependentRoot.d.ts +6 -2
- package/lib/util/dependentRoot.d.ts.map +1 -1
- package/lib/util/dependentRoot.js +20 -16
- package/lib/util/dependentRoot.js.map +1 -1
- package/package.json +14 -15
- package/src/api/impl/beacon/pool/index.ts +56 -3
- package/src/api/impl/validator/index.ts +19 -11
- package/src/chain/chain.ts +3 -0
- package/src/chain/errors/executionPayloadBid.ts +22 -1
- package/src/chain/interface.ts +2 -0
- package/src/chain/lightClient/index.ts +6 -6
- package/src/chain/opPools/index.ts +1 -0
- package/src/chain/opPools/payloadAttestationPool.ts +34 -10
- package/src/chain/opPools/proposerPreferencesPool.ts +59 -0
- package/src/chain/validation/executionPayloadBid.ts +67 -17
- package/src/chain/validation/payloadAttestationMessage.ts +6 -4
- package/src/network/interface.ts +1 -0
- package/src/network/network.ts +11 -0
- package/src/network/processor/gossipHandlers.ts +8 -2
- package/src/util/dependentRoot.ts +22 -18
|
@@ -1197,7 +1197,7 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
1197
1197
|
const insertOutcome = chain.payloadAttestationPool.add(
|
|
1198
1198
|
payloadAttestationMessage,
|
|
1199
1199
|
validationResult.attDataRootHex,
|
|
1200
|
-
validationResult.
|
|
1200
|
+
validationResult.validatorCommitteeIndices
|
|
1201
1201
|
);
|
|
1202
1202
|
metrics?.opPool.payloadAttestationPool.gossipInsertOutcome.inc({insertOutcome});
|
|
1203
1203
|
} catch (e) {
|
|
@@ -1205,7 +1205,7 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
1205
1205
|
}
|
|
1206
1206
|
chain.forkChoice.notifyPtcMessages(
|
|
1207
1207
|
toRootHex(payloadAttestationMessage.data.beaconBlockRoot),
|
|
1208
|
-
|
|
1208
|
+
validationResult.validatorCommitteeIndices,
|
|
1209
1209
|
payloadAttestationMessage.data.payloadPresent
|
|
1210
1210
|
);
|
|
1211
1211
|
},
|
|
@@ -1237,6 +1237,12 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
1237
1237
|
const {serializedData} = gossipData;
|
|
1238
1238
|
const signedProposerPreferences = sszDeserialize(topic, serializedData);
|
|
1239
1239
|
await validateGossipProposerPreferences(chain, signedProposerPreferences);
|
|
1240
|
+
|
|
1241
|
+
chain.proposerPreferencesPool.add(signedProposerPreferences);
|
|
1242
|
+
chain.emitter.emit(routes.events.EventType.proposerPreferences, {
|
|
1243
|
+
version: ForkName.gloas,
|
|
1244
|
+
data: signedProposerPreferences,
|
|
1245
|
+
});
|
|
1240
1246
|
},
|
|
1241
1247
|
};
|
|
1242
1248
|
}
|
|
@@ -2,45 +2,49 @@ import {EpochDifference, IForkChoice, ProtoBlock} from "@lodestar/fork-choice";
|
|
|
2
2
|
import {Epoch, RootHex} from "@lodestar/types";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Get dependent root of a shuffling given
|
|
5
|
+
* Get dependent root of a shuffling given a message epoch and a proto block.
|
|
6
|
+
*
|
|
7
|
+
* Pre-gloas, this is used for attestation validation
|
|
8
|
+
* Post-gloas, this is also used for execution_payload_bid validation because post-fulu,
|
|
9
|
+
* a dependent root of a proposal duties is 1-epoch look ahead (instead of 0 as of pre-fulu)
|
|
6
10
|
*/
|
|
7
11
|
export function getShufflingDependentRoot(
|
|
8
12
|
forkChoice: IForkChoice,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
msgEpoch: Epoch,
|
|
14
|
+
protoBlockEpoch: Epoch,
|
|
15
|
+
protoBlock: ProtoBlock
|
|
12
16
|
): RootHex {
|
|
13
17
|
let shufflingDependentRoot: RootHex;
|
|
14
|
-
if (
|
|
18
|
+
if (protoBlockEpoch === msgEpoch) {
|
|
15
19
|
// current shuffling, this is equivalent to `headState.currentShuffling`
|
|
16
|
-
// given
|
|
20
|
+
// given protoBlockEpoch = msgEpoch = n
|
|
17
21
|
// epoch: (n-2) (n-1) n (n+1)
|
|
18
22
|
// |-------|-------|-------|-------|
|
|
19
|
-
//
|
|
23
|
+
// protoBlock ------------------------^
|
|
20
24
|
// shufflingDependentRoot ------^
|
|
21
|
-
shufflingDependentRoot = forkChoice.getDependentRoot(
|
|
22
|
-
} else if (
|
|
25
|
+
shufflingDependentRoot = forkChoice.getDependentRoot(protoBlock, EpochDifference.previous);
|
|
26
|
+
} else if (protoBlockEpoch === msgEpoch - 1) {
|
|
23
27
|
// next shuffling, this is equivalent to `headState.nextShuffling`
|
|
24
|
-
// given
|
|
28
|
+
// given protoBlockEpoch = n-1, msgEpoch = n
|
|
25
29
|
// epoch: (n-2) (n-1) n (n+1)
|
|
26
30
|
// |-------|-------|-------|-------|
|
|
27
|
-
//
|
|
31
|
+
// protoBlock -------------------^
|
|
28
32
|
// shufflingDependentRoot ------^
|
|
29
|
-
shufflingDependentRoot = forkChoice.getDependentRoot(
|
|
30
|
-
} else if (
|
|
33
|
+
shufflingDependentRoot = forkChoice.getDependentRoot(protoBlock, EpochDifference.current);
|
|
34
|
+
} else if (protoBlockEpoch < msgEpoch - 1) {
|
|
31
35
|
// this never happens with default chain option of maxSkipSlots = 32, however we still need to handle it
|
|
32
36
|
// check the verifyHeadBlockAndTargetRoot() function above
|
|
33
|
-
// given
|
|
37
|
+
// given protoBlockEpoch = n-2, msgEpoch = n
|
|
34
38
|
// epoch: (n-2) (n-1) n (n+1)
|
|
35
39
|
// |-------|-------|-------|-------|
|
|
36
|
-
//
|
|
40
|
+
// protoBlock -----------^
|
|
37
41
|
// shufflingDependentRoot -----^
|
|
38
|
-
shufflingDependentRoot =
|
|
42
|
+
shufflingDependentRoot = protoBlock.blockRoot;
|
|
39
43
|
// use lodestar_gossip_attestation_head_slot_to_attestation_slot metric to track this case
|
|
40
44
|
} else {
|
|
41
|
-
//
|
|
45
|
+
// protoBlockEpoch > msgEpoch
|
|
42
46
|
// should not happen, handled in verifyAttestationTargetRoot
|
|
43
|
-
throw Error(`
|
|
47
|
+
throw Error(`message epoch ${msgEpoch} is before proto block epoch ${protoBlockEpoch}`);
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
return shufflingDependentRoot;
|