@lodestar/state-transition 1.39.1 → 1.40.0-dev.193b2e2047
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/block/index.d.ts +1 -0
- package/lib/block/index.d.ts.map +1 -1
- package/lib/block/index.js +1 -0
- package/lib/block/index.js.map +1 -1
- package/lib/block/isValidIndexedAttestation.d.ts +4 -5
- package/lib/block/isValidIndexedAttestation.d.ts.map +1 -1
- package/lib/block/isValidIndexedAttestation.js +9 -10
- package/lib/block/isValidIndexedAttestation.js.map +1 -1
- package/lib/block/isValidIndexedPayloadAttestation.d.ts.map +1 -1
- package/lib/block/isValidIndexedPayloadAttestation.js +1 -1
- package/lib/block/isValidIndexedPayloadAttestation.js.map +1 -1
- package/lib/block/processAttestationPhase0.d.ts.map +1 -1
- package/lib/block/processAttestationPhase0.js +1 -1
- package/lib/block/processAttestationPhase0.js.map +1 -1
- package/lib/block/processAttestationsAltair.d.ts.map +1 -1
- package/lib/block/processAttestationsAltair.js +2 -2
- package/lib/block/processAttestationsAltair.js.map +1 -1
- package/lib/block/processAttesterSlashing.d.ts +3 -2
- package/lib/block/processAttesterSlashing.d.ts.map +1 -1
- package/lib/block/processAttesterSlashing.js +3 -3
- package/lib/block/processAttesterSlashing.js.map +1 -1
- package/lib/block/processBlsToExecutionChange.d.ts +3 -1
- package/lib/block/processBlsToExecutionChange.d.ts.map +1 -1
- package/lib/block/processBlsToExecutionChange.js +7 -11
- package/lib/block/processBlsToExecutionChange.js.map +1 -1
- package/lib/block/processConsolidationRequest.d.ts +1 -2
- package/lib/block/processConsolidationRequest.d.ts.map +1 -1
- package/lib/block/processConsolidationRequest.js +2 -2
- package/lib/block/processConsolidationRequest.js.map +1 -1
- package/lib/block/processDepositRequest.d.ts +8 -2
- package/lib/block/processDepositRequest.d.ts.map +1 -1
- package/lib/block/processDepositRequest.js +81 -8
- package/lib/block/processDepositRequest.js.map +1 -1
- package/lib/block/processExecutionPayloadBid.d.ts.map +1 -1
- package/lib/block/processExecutionPayloadBid.js +16 -29
- package/lib/block/processExecutionPayloadBid.js.map +1 -1
- package/lib/block/processExecutionPayloadEnvelope.d.ts.map +1 -1
- package/lib/block/processExecutionPayloadEnvelope.js +26 -25
- package/lib/block/processExecutionPayloadEnvelope.js.map +1 -1
- package/lib/block/processOperations.js +2 -2
- package/lib/block/processOperations.js.map +1 -1
- package/lib/block/processProposerSlashing.d.ts +5 -2
- package/lib/block/processProposerSlashing.d.ts.map +1 -1
- package/lib/block/processProposerSlashing.js +8 -6
- package/lib/block/processProposerSlashing.js.map +1 -1
- package/lib/block/processSyncCommittee.d.ts +1 -2
- package/lib/block/processSyncCommittee.d.ts.map +1 -1
- package/lib/block/processSyncCommittee.js +5 -5
- package/lib/block/processSyncCommittee.js.map +1 -1
- package/lib/block/processVoluntaryExit.d.ts +1 -1
- package/lib/block/processVoluntaryExit.d.ts.map +1 -1
- package/lib/block/processVoluntaryExit.js +45 -3
- package/lib/block/processVoluntaryExit.js.map +1 -1
- package/lib/block/processWithdrawalRequest.js +1 -1
- package/lib/block/processWithdrawalRequest.js.map +1 -1
- package/lib/block/processWithdrawals.d.ts +1 -0
- package/lib/block/processWithdrawals.d.ts.map +1 -1
- package/lib/block/processWithdrawals.js +121 -66
- package/lib/block/processWithdrawals.js.map +1 -1
- package/lib/cache/epochCache.d.ts +8 -28
- package/lib/cache/epochCache.d.ts.map +1 -1
- package/lib/cache/epochCache.js +40 -180
- package/lib/cache/epochCache.js.map +1 -1
- package/lib/cache/epochTransitionCache.d.ts +5 -12
- package/lib/cache/epochTransitionCache.d.ts.map +1 -1
- package/lib/cache/epochTransitionCache.js +4 -14
- package/lib/cache/epochTransitionCache.js.map +1 -1
- package/lib/cache/stateCache.d.ts.map +1 -1
- package/lib/cache/stateCache.js +1 -2
- package/lib/cache/stateCache.js.map +1 -1
- package/lib/epoch/processBuilderPendingPayments.d.ts.map +1 -1
- package/lib/epoch/processBuilderPendingPayments.js +1 -4
- package/lib/epoch/processBuilderPendingPayments.js.map +1 -1
- package/lib/epoch/processProposerLookahead.d.ts.map +1 -1
- package/lib/epoch/processProposerLookahead.js +3 -6
- package/lib/epoch/processProposerLookahead.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/rewards/blockRewards.d.ts +2 -1
- package/lib/rewards/blockRewards.d.ts.map +1 -1
- package/lib/rewards/blockRewards.js +3 -2
- package/lib/rewards/blockRewards.js.map +1 -1
- package/lib/rewards/syncCommitteeRewards.d.ts.map +1 -1
- package/lib/rewards/syncCommitteeRewards.js +10 -11
- package/lib/rewards/syncCommitteeRewards.js.map +1 -1
- package/lib/signatureSets/attesterSlashings.d.ts +3 -4
- package/lib/signatureSets/attesterSlashings.d.ts.map +1 -1
- package/lib/signatureSets/attesterSlashings.js +6 -6
- package/lib/signatureSets/attesterSlashings.js.map +1 -1
- package/lib/signatureSets/blsToExecutionChange.d.ts +4 -5
- package/lib/signatureSets/blsToExecutionChange.d.ts.map +1 -1
- package/lib/signatureSets/blsToExecutionChange.js +2 -2
- package/lib/signatureSets/blsToExecutionChange.js.map +1 -1
- package/lib/signatureSets/executionPayloadBid.d.ts +4 -0
- package/lib/signatureSets/executionPayloadBid.d.ts.map +1 -0
- package/lib/signatureSets/executionPayloadBid.js +8 -0
- package/lib/signatureSets/executionPayloadBid.js.map +1 -0
- package/lib/signatureSets/executionPayloadEnvelope.d.ts +4 -0
- package/lib/signatureSets/executionPayloadEnvelope.d.ts.map +1 -0
- package/lib/signatureSets/executionPayloadEnvelope.js +8 -0
- package/lib/signatureSets/executionPayloadEnvelope.js.map +1 -0
- package/lib/signatureSets/index.d.ts +3 -2
- package/lib/signatureSets/index.d.ts.map +1 -1
- package/lib/signatureSets/index.js +10 -8
- package/lib/signatureSets/index.js.map +1 -1
- package/lib/signatureSets/indexedAttestation.d.ts +3 -4
- package/lib/signatureSets/indexedAttestation.d.ts.map +1 -1
- package/lib/signatureSets/indexedAttestation.js +6 -6
- package/lib/signatureSets/indexedAttestation.js.map +1 -1
- package/lib/signatureSets/indexedPayloadAttestation.d.ts +5 -4
- package/lib/signatureSets/indexedPayloadAttestation.d.ts.map +1 -1
- package/lib/signatureSets/indexedPayloadAttestation.js +3 -3
- package/lib/signatureSets/indexedPayloadAttestation.js.map +1 -1
- package/lib/signatureSets/proposer.d.ts +3 -3
- package/lib/signatureSets/proposer.d.ts.map +1 -1
- package/lib/signatureSets/proposer.js +12 -12
- package/lib/signatureSets/proposer.js.map +1 -1
- package/lib/signatureSets/proposerSlashings.d.ts +2 -3
- package/lib/signatureSets/proposerSlashings.d.ts.map +1 -1
- package/lib/signatureSets/proposerSlashings.js +6 -6
- package/lib/signatureSets/proposerSlashings.js.map +1 -1
- package/lib/signatureSets/randao.d.ts +1 -1
- package/lib/signatureSets/randao.d.ts.map +1 -1
- package/lib/signatureSets/randao.js +4 -4
- package/lib/signatureSets/randao.js.map +1 -1
- package/lib/signatureSets/voluntaryExits.d.ts +2 -2
- package/lib/signatureSets/voluntaryExits.d.ts.map +1 -1
- package/lib/signatureSets/voluntaryExits.js +6 -6
- package/lib/signatureSets/voluntaryExits.js.map +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/util/electra.d.ts.map +1 -1
- package/lib/util/electra.js +1 -2
- package/lib/util/electra.js.map +1 -1
- package/lib/util/epochShuffling.d.ts +1 -34
- package/lib/util/epochShuffling.d.ts.map +1 -1
- package/lib/util/epochShuffling.js +1 -1
- package/lib/util/epochShuffling.js.map +1 -1
- package/lib/util/gloas.d.ts +46 -5
- package/lib/util/gloas.d.ts.map +1 -1
- package/lib/util/gloas.js +91 -5
- package/lib/util/gloas.js.map +1 -1
- package/lib/util/index.d.ts +2 -2
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/shuffling.d.ts +58 -0
- package/lib/util/shuffling.d.ts.map +1 -0
- package/lib/util/shuffling.js +175 -0
- package/lib/util/shuffling.js.map +1 -0
- package/lib/util/signatureSets.d.ts +38 -5
- package/lib/util/signatureSets.d.ts.map +1 -1
- package/lib/util/signatureSets.js +48 -6
- package/lib/util/signatureSets.js.map +1 -1
- package/lib/util/validator.d.ts +6 -1
- package/lib/util/validator.d.ts.map +1 -1
- package/lib/util/validator.js +26 -16
- package/lib/util/validator.js.map +1 -1
- package/package.json +7 -7
- package/src/block/index.ts +1 -0
- package/src/block/isValidIndexedAttestation.ts +18 -12
- package/src/block/isValidIndexedPayloadAttestation.ts +4 -1
- package/src/block/processAttestationPhase0.ts +2 -1
- package/src/block/processAttestationsAltair.ts +2 -8
- package/src/block/processAttesterSlashing.ts +16 -4
- package/src/block/processBlsToExecutionChange.ts +13 -14
- package/src/block/processConsolidationRequest.ts +2 -3
- package/src/block/processDepositRequest.ts +101 -8
- package/src/block/processExecutionPayloadBid.ts +20 -42
- package/src/block/processExecutionPayloadEnvelope.ts +34 -30
- package/src/block/processOperations.ts +2 -2
- package/src/block/processProposerSlashing.ts +22 -12
- package/src/block/processSyncCommittee.ts +3 -6
- package/src/block/processVoluntaryExit.ts +60 -5
- package/src/block/processWithdrawalRequest.ts +1 -1
- package/src/block/processWithdrawals.ts +168 -70
- package/src/cache/epochCache.ts +52 -214
- package/src/cache/epochTransitionCache.ts +9 -34
- package/src/cache/stateCache.ts +1 -2
- package/src/epoch/processBuilderPendingPayments.ts +1 -5
- package/src/epoch/processProposerLookahead.ts +3 -7
- package/src/index.ts +0 -2
- package/src/rewards/blockRewards.ts +6 -3
- package/src/rewards/syncCommitteeRewards.ts +10 -13
- package/src/signatureSets/attesterSlashings.ts +3 -7
- package/src/signatureSets/blsToExecutionChange.ts +5 -6
- package/src/signatureSets/executionPayloadBid.ts +14 -0
- package/src/signatureSets/executionPayloadEnvelope.ts +13 -0
- package/src/signatureSets/index.ts +8 -9
- package/src/signatureSets/indexedAttestation.ts +2 -7
- package/src/signatureSets/indexedPayloadAttestation.ts +9 -7
- package/src/signatureSets/proposer.ts +8 -12
- package/src/signatureSets/proposerSlashings.ts +4 -7
- package/src/signatureSets/randao.ts +4 -8
- package/src/signatureSets/voluntaryExits.ts +5 -10
- package/src/types.ts +1 -0
- package/src/util/electra.ts +1 -4
- package/src/util/epochShuffling.ts +2 -43
- package/src/util/gloas.ts +116 -10
- package/src/util/index.ts +2 -2
- package/src/util/shuffling.ts +234 -0
- package/src/util/signatureSets.ts +84 -8
- package/src/util/validator.ts +31 -16
- package/lib/util/calculateCommitteeAssignments.d.ts +0 -12
- package/lib/util/calculateCommitteeAssignments.d.ts.map +0 -1
- package/lib/util/calculateCommitteeAssignments.js +0 -26
- package/lib/util/calculateCommitteeAssignments.js.map +0 -1
- package/lib/util/shufflingDecisionRoot.d.ts +0 -20
- package/lib/util/shufflingDecisionRoot.d.ts.map +0 -1
- package/lib/util/shufflingDecisionRoot.js +0 -76
- package/lib/util/shufflingDecisionRoot.js.map +0 -1
- package/src/util/calculateCommitteeAssignments.ts +0 -43
- package/src/util/shufflingDecisionRoot.ts +0 -81
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stateCache.js","sourceRoot":"","sources":["../../src/cache/stateCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAC,SAAS,EAAC,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAC,UAAU,EAA0C,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAAc,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AA0IrE;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CACrC,KAAQ,EACR,aAAsC,EACtC,IAAqB;IAErB,MAAM,UAAU,GAAG,UAAU,CAAC,eAAe,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;IAC1E,MAAM,WAAW,GAAG,oBAAoB,CAAC,KAAK,EAAE;QAC9C,MA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gBAAgB,CAAC,KAAK,IAAI,CAAC;AACnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processBuilderPendingPayments.d.ts","sourceRoot":"","sources":["../../src/epoch/processBuilderPendingPayments.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,sBAAsB,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"processBuilderPendingPayments.d.ts","sourceRoot":"","sources":["../../src/epoch/processBuilderPendingPayments.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,sBAAsB,EAAC,MAAM,aAAa,CAAC;AAGnD;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAkBjF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SLOTS_PER_EPOCH } from "@lodestar/params";
|
|
2
2
|
import { ssz } from "@lodestar/types";
|
|
3
|
-
import { computeExitEpochAndUpdateChurn } from "../util/epoch.js";
|
|
4
3
|
import { getBuilderPaymentQuorumThreshold } from "../util/gloas.js";
|
|
5
4
|
/**
|
|
6
5
|
* Processes the builder pending payments from the previous epoch.
|
|
@@ -9,9 +8,7 @@ export function processBuilderPendingPayments(state) {
|
|
|
9
8
|
const quorum = getBuilderPaymentQuorumThreshold(state);
|
|
10
9
|
for (let i = 0; i < SLOTS_PER_EPOCH; i++) {
|
|
11
10
|
const payment = state.builderPendingPayments.get(i);
|
|
12
|
-
if (payment.weight
|
|
13
|
-
const exitQueueEpoch = computeExitEpochAndUpdateChurn(state, BigInt(payment.withdrawal.amount));
|
|
14
|
-
payment.withdrawal.withdrawableEpoch = exitQueueEpoch + state.config.MIN_VALIDATOR_WITHDRAWABILITY_DELAY;
|
|
11
|
+
if (payment.weight >= quorum) {
|
|
15
12
|
state.builderPendingWithdrawals.push(payment.withdrawal);
|
|
16
13
|
}
|
|
17
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processBuilderPendingPayments.js","sourceRoot":"","sources":["../../src/epoch/processBuilderPendingPayments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAEpC,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"processBuilderPendingPayments.js","sourceRoot":"","sources":["../../src/epoch/processBuilderPendingPayments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAEpC,OAAO,EAAC,gCAAgC,EAAC,MAAM,kBAAkB,CAAC;AAElE;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAAC,KAA6B;IACzE,MAAM,MAAM,GAAG,gCAAgC,CAAC,KAAK,CAAC,CAAC;IAEvD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,EAAE,CAAC,EAAE,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACpD,IAAI,OAAO,CAAC,MAAM,IAAI,MAAM,EAAE,CAAC;YAC7B,KAAK,CAAC,yBAAyB,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAED,4BAA4B;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,sBAAsB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7D,IAAI,CAAC,GAAG,eAAe,EAAE,CAAC;YACxB,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;QACrG,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,qBAAqB,CAAC,aAAa,EAAE,CAAC,CAAC;QACvF,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processProposerLookahead.d.ts","sourceRoot":"","sources":["../../src/epoch/processProposerLookahead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAsC,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAC,qBAAqB,EAAE,oBAAoB,EAAC,MAAM,aAAa,CAAC;AAIxE;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,qBAAqB,EAC5B,KAAK,EAAE,oBAAoB,GAC1B,IAAI,
|
|
1
|
+
{"version":3,"file":"processProposerLookahead.d.ts","sourceRoot":"","sources":["../../src/epoch/processProposerLookahead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAsC,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAC,qBAAqB,EAAE,oBAAoB,EAAC,MAAM,aAAa,CAAC;AAIxE;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,qBAAqB,EAC5B,KAAK,EAAE,oBAAoB,GAC1B,IAAI,CAiBN"}
|
|
@@ -14,12 +14,9 @@ export function processProposerLookahead(fork, state, cache) {
|
|
|
14
14
|
const remainingProposerLookahead = state.proposerLookahead.getAll().slice(SLOTS_PER_EPOCH);
|
|
15
15
|
// Fill in the last epoch with new proposer indices
|
|
16
16
|
const epoch = state.epochCtx.epoch + MIN_SEED_LOOKAHEAD + 1;
|
|
17
|
-
const shuffling = state
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}) ??
|
|
21
|
-
// Only for testing. shufflingCache should always be available in prod
|
|
22
|
-
computeEpochShuffling(state, cache.nextShufflingActiveIndices, epoch);
|
|
17
|
+
const shuffling = computeEpochShuffling(state, cache.nextShufflingActiveIndices, epoch);
|
|
18
|
+
// Save shuffling to cache so afterProcessEpoch can reuse it instead of recomputing
|
|
19
|
+
cache.nextShuffling = shuffling;
|
|
23
20
|
const lastEpochProposerLookahead = computeProposerIndices(fork, state, shuffling, epoch);
|
|
24
21
|
state.proposerLookahead = ssz.fulu.ProposerLookahead.toViewDU([
|
|
25
22
|
...remainingProposerLookahead,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processProposerLookahead.js","sourceRoot":"","sources":["../../src/epoch/processProposerLookahead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,kBAAkB,EAAE,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAEpC,OAAO,EAAC,qBAAqB,EAAC,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAC,sBAAsB,EAAC,MAAM,iBAAiB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACtC,IAAa,EACb,KAA4B,EAC5B,KAA2B;IAE3B,yCAAyC;IACzC,MAAM,0BAA0B,GAAG,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAE3F,mDAAmD;IACnD,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,GAAG,kBAAkB,GAAG,CAAC,CAAC;IAE5D,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"processProposerLookahead.js","sourceRoot":"","sources":["../../src/epoch/processProposerLookahead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,kBAAkB,EAAE,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAEpC,OAAO,EAAC,qBAAqB,EAAC,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAC,sBAAsB,EAAC,MAAM,iBAAiB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACtC,IAAa,EACb,KAA4B,EAC5B,KAA2B;IAE3B,yCAAyC;IACzC,MAAM,0BAA0B,GAAG,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAE3F,mDAAmD;IACnD,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,GAAG,kBAAkB,GAAG,CAAC,CAAC;IAE5D,MAAM,SAAS,GAAG,qBAAqB,CAAC,KAAK,EAAE,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;IACxF,mFAAmF;IACnF,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;IAEhC,MAAM,0BAA0B,GAAG,sBAAsB,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAEzF,KAAK,CAAC,iBAAiB,GAAG,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC;QAC5D,GAAG,0BAA0B;QAC7B,GAAG,0BAA0B;KAC9B,CAAC,CAAC;AACL,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { VoluntaryExitValidity, getVoluntaryExitValidity, isValidVoluntaryExit }
|
|
|
8
8
|
export { getExpectedWithdrawals } from "./block/processWithdrawals.js";
|
|
9
9
|
export { ProposerRewardType } from "./block/types.js";
|
|
10
10
|
export { type EffectiveBalanceIncrements, getEffectiveBalanceIncrementsWithLen, getEffectiveBalanceIncrementsZeroed, } from "./cache/effectiveBalanceIncrements.js";
|
|
11
|
-
export { EpochCache,
|
|
11
|
+
export { EpochCache, type EpochCacheImmutableData, createEmptyEpochCacheImmutableData, } from "./cache/epochCache.js";
|
|
12
12
|
export { type EpochTransitionCache, beforeProcessEpoch } from "./cache/epochTransitionCache.js";
|
|
13
13
|
export { type Index2PubkeyCache, syncPubkeys } from "./cache/pubkeyCache.js";
|
|
14
14
|
export { type BeaconStateCache, createCachedBeaconState, isCachedBeaconState, isStateBalancesNodesPopulated, isStateValidatorsNodesPopulated, loadCachedBeaconState, } from "./cache/stateCache.js";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,iCAAiC,EAAE,yBAAyB,EAAC,MAAM,sCAAsC,CAAC;AAClH,OAAO,EAAC,2BAA2B,EAAC,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAC,2BAA2B,EAAC,MAAM,wCAAwC,CAAC;AAEnF,OAAO,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAC,2BAA2B,EAAC,MAAM,oCAAoC,CAAC;AAE/E,OAAO,EAAC,qBAAqB,EAAE,wBAAwB,EAAE,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AAEtH,OAAO,EAAC,sBAAsB,EAAC,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACL,KAAK,0BAA0B,EAC/B,oCAAoC,EACpC,mCAAmC,GACpC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,iCAAiC,EAAE,yBAAyB,EAAC,MAAM,sCAAsC,CAAC;AAClH,OAAO,EAAC,2BAA2B,EAAC,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAC,2BAA2B,E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B,EACtB,wBAAwB,EACxB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AACpB,cAAc,iBAAiB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { VoluntaryExitValidity, getVoluntaryExitValidity, isValidVoluntaryExit }
|
|
|
11
11
|
export { getExpectedWithdrawals } from "./block/processWithdrawals.js";
|
|
12
12
|
export { ProposerRewardType } from "./block/types.js";
|
|
13
13
|
export { getEffectiveBalanceIncrementsWithLen, getEffectiveBalanceIncrementsZeroed, } from "./cache/effectiveBalanceIncrements.js";
|
|
14
|
-
export { EpochCache,
|
|
14
|
+
export { EpochCache, createEmptyEpochCacheImmutableData, } from "./cache/epochCache.js";
|
|
15
15
|
export { beforeProcessEpoch } from "./cache/epochTransitionCache.js";
|
|
16
16
|
export { syncPubkeys } from "./cache/pubkeyCache.js";
|
|
17
17
|
// Main state caches
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,iCAAiC,EAAE,yBAAyB,EAAC,MAAM,sCAAsC,CAAC;AAClH,OAAO,EAAC,2BAA2B,EAAC,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAC,2BAA2B,EAAC,MAAM,wCAAwC,CAAC;AACnF,qCAAqC;AACrC,OAAO,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAC,2BAA2B,EAAC,MAAM,oCAAoC,CAAC;AAC/E,yBAAyB;AACzB,OAAO,EAAC,qBAAqB,EAAE,wBAAwB,EAAE,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACtH,6BAA6B;AAC7B,OAAO,EAAC,sBAAsB,EAAC,MAAM,+BAA+B,CAA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,cAAc,CAAC;AAC3E,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AAwBrC,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BeaconConfig } from "@lodestar/config";
|
|
2
2
|
import { BeaconBlock, rewards } from "@lodestar/types";
|
|
3
|
+
import { RewardCache } from "../cache/rewardCache.js";
|
|
3
4
|
import { CachedBeaconStateAllForks } from "../cache/stateCache.js";
|
|
4
5
|
/**
|
|
5
6
|
* Calculate total proposer block rewards given block and the beacon state of the same slot before the block is applied (preState)
|
|
@@ -9,5 +10,5 @@ import { CachedBeaconStateAllForks } from "../cache/stateCache.js";
|
|
|
9
10
|
* 2) Including attestations from sync committee
|
|
10
11
|
* 3) Reporting slashable behaviours from proposer and attester
|
|
11
12
|
*/
|
|
12
|
-
export declare function computeBlockRewards(config: BeaconConfig, block: BeaconBlock,
|
|
13
|
+
export declare function computeBlockRewards(config: BeaconConfig, block: BeaconBlock, preStateIn: CachedBeaconStateAllForks, proposerRewards?: RewardCache): Promise<rewards.BlockRewards>;
|
|
13
14
|
//# sourceMappingURL=blockRewards.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockRewards.d.ts","sourceRoot":"","sources":["../../src/rewards/blockRewards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAO9C,OAAO,EAAC,WAAW,EAAkB,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAC,yBAAyB,EAAmD,MAAM,wBAAwB,CAAC;AAKnH;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,WAAW,EAClB,
|
|
1
|
+
{"version":3,"file":"blockRewards.d.ts","sourceRoot":"","sources":["../../src/rewards/blockRewards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAO9C,OAAO,EAAC,WAAW,EAAkB,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,yBAAyB,EAAmD,MAAM,wBAAwB,CAAC;AAKnH;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,WAAW,EAClB,UAAU,EAAE,yBAAyB,EACrC,eAAe,CAAC,EAAE,WAAW,GAC5B,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAkC/B"}
|
|
@@ -9,9 +9,10 @@ import { getAttesterSlashableIndices } from "../util/attestation.js";
|
|
|
9
9
|
* 2) Including attestations from sync committee
|
|
10
10
|
* 3) Reporting slashable behaviours from proposer and attester
|
|
11
11
|
*/
|
|
12
|
-
export async function computeBlockRewards(config, block,
|
|
12
|
+
export async function computeBlockRewards(config, block, preStateIn, proposerRewards) {
|
|
13
|
+
const preState = preStateIn.clone();
|
|
13
14
|
const fork = config.getForkName(block.slot);
|
|
14
|
-
const { attestations: cachedAttestationsReward = 0, syncAggregate: cachedSyncAggregateReward = 0 } =
|
|
15
|
+
const { attestations: cachedAttestationsReward = 0, syncAggregate: cachedSyncAggregateReward = 0 } = proposerRewards ?? {};
|
|
15
16
|
let blockAttestationReward = cachedAttestationsReward;
|
|
16
17
|
let syncAggregateReward = cachedSyncAggregateReward;
|
|
17
18
|
if (blockAttestationReward === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockRewards.js","sourceRoot":"","sources":["../../src/rewards/blockRewards.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,6BAA6B,EAC7B,qCAAqC,EACrC,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAC,yBAAyB,EAAC,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"blockRewards.js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"version":3,"file":"syncCommitteeRewards.d.ts","sourceRoot":"","sources":["../../src/rewards/syncCommitteeRewards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,WAAW,EAAE,cAAc,EAAU,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAC,yBAAyB,EAA0B,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"syncCommitteeRewards.d.ts","sourceRoot":"","sources":["../../src/rewards/syncCommitteeRewards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,WAAW,EAAE,cAAc,EAAU,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAC,yBAAyB,EAA0B,MAAM,wBAAwB,CAAC;AAE1F,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,yBAAyB,EACnC,YAAY,GAAE,CAAC,cAAc,GAAG,MAAM,CAAC,EAAO,GAC7C,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CA2CvC"}
|
|
@@ -5,28 +5,27 @@ export async function computeSyncCommitteeRewards(config, index2pubkey, block, p
|
|
|
5
5
|
throw Error("Cannot get sync rewards as phase0 block does not have sync committee");
|
|
6
6
|
}
|
|
7
7
|
const altairBlock = block;
|
|
8
|
-
const preStateAltair = preState;
|
|
8
|
+
const preStateAltair = preState.clone();
|
|
9
9
|
// Bound syncCommitteeValidatorIndices in case it goes beyond SYNC_COMMITTEE_SIZE just to be safe
|
|
10
10
|
const syncCommitteeValidatorIndices = preStateAltair.epochCtx.currentSyncCommitteeIndexed.validatorIndices.slice(0, SYNC_COMMITTEE_SIZE);
|
|
11
11
|
const { syncParticipantReward } = preStateAltair.epochCtx;
|
|
12
12
|
const { syncCommitteeBits } = altairBlock.body.syncAggregate;
|
|
13
|
-
//
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const balanceRecord = balances.get(i);
|
|
13
|
+
// Track reward deltas per validator (can appear multiple times in sync committee)
|
|
14
|
+
const rewardDeltas = new Map();
|
|
15
|
+
// Iterate by position index to correctly access syncCommitteeBits
|
|
16
|
+
for (let i = 0; i < syncCommitteeValidatorIndices.length; i++) {
|
|
17
|
+
const validatorIndex = syncCommitteeValidatorIndices[i];
|
|
18
|
+
const currentDelta = rewardDeltas.get(validatorIndex) ?? 0;
|
|
20
19
|
if (syncCommitteeBits.get(i)) {
|
|
21
20
|
// Positive rewards for participants
|
|
22
|
-
|
|
21
|
+
rewardDeltas.set(validatorIndex, currentDelta + syncParticipantReward);
|
|
23
22
|
}
|
|
24
23
|
else {
|
|
25
24
|
// Negative rewards for non participants
|
|
26
|
-
|
|
25
|
+
rewardDeltas.set(validatorIndex, currentDelta - syncParticipantReward);
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
|
-
const rewards = Array.from(
|
|
28
|
+
const rewards = Array.from(rewardDeltas, ([validatorIndex, reward]) => ({ validatorIndex, reward }));
|
|
30
29
|
if (validatorIds.length) {
|
|
31
30
|
const filtersSet = new Set(validatorIds);
|
|
32
31
|
return rewards.filter((reward) => filtersSet.has(reward.validatorIndex) || filtersSet.has(index2pubkey[reward.validatorIndex].toHex()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syncCommitteeRewards.js","sourceRoot":"","sources":["../../src/rewards/syncCommitteeRewards.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"syncCommitteeRew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AC,cAAc,EAAE,YAAY,GAAG,qBAAqB,CAAC,CAAC;QACzE,CAAC;aAAM,CAAC;YACN,wCAAwC;YACxC,YAAY,CAAC,GAAG,CAAC,cAAc,EAAE,YAAY,GAAG,qBAAqB,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,cAAc,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,EAAC,cAAc,EAAE,MAAM,EAAC,CAAC,CAAC,CAAC;IAEnG,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;QACxB,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC;QACzC,OAAO,OAAO,CAAC,MAAM,CACnB,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,CAAC,CACjH,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { BeaconConfig } from "@lodestar/config";
|
|
2
2
|
import { AttesterSlashing, IndexedAttestationBigint, SignedBeaconBlock, Slot } from "@lodestar/types";
|
|
3
|
-
import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
|
|
4
3
|
import { ISignatureSet } from "../util/index.js";
|
|
5
4
|
/** Get signature sets from all AttesterSlashing objects in a block */
|
|
6
|
-
export declare function getAttesterSlashingsSignatureSets(config: BeaconConfig,
|
|
5
|
+
export declare function getAttesterSlashingsSignatureSets(config: BeaconConfig, signedBlock: SignedBeaconBlock): ISignatureSet[];
|
|
7
6
|
/** Get signature sets from a single AttesterSlashing object */
|
|
8
|
-
export declare function getAttesterSlashingSignatureSets(config: BeaconConfig,
|
|
9
|
-
export declare function getIndexedAttestationBigintSignatureSet(config: BeaconConfig,
|
|
7
|
+
export declare function getAttesterSlashingSignatureSets(config: BeaconConfig, stateSlot: Slot, attesterSlashing: AttesterSlashing): ISignatureSet[];
|
|
8
|
+
export declare function getIndexedAttestationBigintSignatureSet(config: BeaconConfig, stateSlot: Slot, indexedAttestation: IndexedAttestationBigint): ISignatureSet;
|
|
10
9
|
//# sourceMappingURL=attesterSlashings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attesterSlashings.d.ts","sourceRoot":"","sources":["../../src/signatureSets/attesterSlashings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,gBAAgB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,IAAI,EAAM,MAAM,iBAAiB,CAAC;AACzG,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"attesterSlashings.d.ts","sourceRoot":"","sources":["../../src/signatureSets/attesterSlashings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,gBAAgB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,IAAI,EAAM,MAAM,iBAAiB,CAAC;AACzG,OAAO,EAAC,aAAa,EAAgE,MAAM,kBAAkB,CAAC;AAE9G,sEAAsE;AACtE,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,iBAAiB,GAC7B,aAAa,EAAE,CAOjB;AAED,+DAA+D;AAC/D,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,IAAI,EACf,gBAAgB,EAAE,gBAAgB,GACjC,aAAa,EAAE,CAIjB;AAED,wBAAgB,uCAAuC,CACrD,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,IAAI,EACf,kBAAkB,EAAE,wBAAwB,GAC3C,aAAa,CAUf"}
|
|
@@ -2,22 +2,22 @@ import { DOMAIN_BEACON_ATTESTER } from "@lodestar/params";
|
|
|
2
2
|
import { ssz } from "@lodestar/types";
|
|
3
3
|
import { SignatureSetType, computeSigningRoot, computeStartSlotAtEpoch } from "../util/index.js";
|
|
4
4
|
/** Get signature sets from all AttesterSlashing objects in a block */
|
|
5
|
-
export function getAttesterSlashingsSignatureSets(config,
|
|
5
|
+
export function getAttesterSlashingsSignatureSets(config, signedBlock) {
|
|
6
6
|
// the getDomain() api requires the state slot as 1st param, however it's the same to block.slot in state-transition
|
|
7
7
|
// and the same epoch when we verify blocks in batch in beacon-node. So we can safely use block.slot here.
|
|
8
8
|
const blockSlot = signedBlock.message.slot;
|
|
9
|
-
return signedBlock.message.body.attesterSlashings.flatMap((attesterSlashing) => getAttesterSlashingSignatureSets(config,
|
|
9
|
+
return signedBlock.message.body.attesterSlashings.flatMap((attesterSlashing) => getAttesterSlashingSignatureSets(config, blockSlot, attesterSlashing));
|
|
10
10
|
}
|
|
11
11
|
/** Get signature sets from a single AttesterSlashing object */
|
|
12
|
-
export function getAttesterSlashingSignatureSets(config,
|
|
13
|
-
return [attesterSlashing.attestation1, attesterSlashing.attestation2].map((attestation) => getIndexedAttestationBigintSignatureSet(config,
|
|
12
|
+
export function getAttesterSlashingSignatureSets(config, stateSlot, attesterSlashing) {
|
|
13
|
+
return [attesterSlashing.attestation1, attesterSlashing.attestation2].map((attestation) => getIndexedAttestationBigintSignatureSet(config, stateSlot, attestation));
|
|
14
14
|
}
|
|
15
|
-
export function getIndexedAttestationBigintSignatureSet(config,
|
|
15
|
+
export function getIndexedAttestationBigintSignatureSet(config, stateSlot, indexedAttestation) {
|
|
16
16
|
const messageSlot = computeStartSlotAtEpoch(Number(indexedAttestation.data.target.epoch));
|
|
17
17
|
const domain = config.getDomain(stateSlot, DOMAIN_BEACON_ATTESTER, messageSlot);
|
|
18
18
|
return {
|
|
19
19
|
type: SignatureSetType.aggregate,
|
|
20
|
-
|
|
20
|
+
indices: indexedAttestation.attestingIndices.map((i) => Number(i)),
|
|
21
21
|
signingRoot: computeSigningRoot(ssz.phase0.AttestationDataBigint, indexedAttestation.data, domain),
|
|
22
22
|
signature: indexedAttestation.signature,
|
|
23
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attesterSlashings.js","sourceRoot":"","sources":["../../src/signatureSets/attesterSlashings.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAsE,GAAG,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"attesterSlashings.js","sourceRoot":"","sources":["../../src/signatureSets/attesterSlashings.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAsE,GAAG,EAAC,MAAM,iBAAiB,CAAC;AACzG,OAAO,EAAgB,gBAAgB,EAAE,kBAAkB,EAAE,uBAAuB,EAAC,MAAM,kBAAkB,CAAC;AAE9G,sEAAsE;AACtE,MAAM,UAAU,iCAAiC,CAC/C,MAAoB,EACpB,WAA8B;IAE9B,oHAAoH;IACpH,0GAA0G;IAC1G,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3C,OAAO,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAC7E,gCAAgC,CAAC,MAAM,EAAE,SAAS,EAAE,gBAAgB,CAAC,CACtE,CAAC;AACJ,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,gCAAgC,CAC9C,MAAoB,EACpB,SAAe,EACf,gBAAkC;IAElC,OAAO,CAAC,gBAAgB,CAAC,YAAY,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CACxF,uCAAuC,CAAC,MAAM,EAAE,SAAS,EAAE,WAAW,CAAC,CACxE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uCAAuC,CACrD,MAAoB,EACpB,SAAe,EACf,kBAA4C;IAE5C,MAAM,WAAW,GAAG,uBAAuB,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAe,CAAC,CAAC,CAAC;IACpG,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,sBAAsB,EAAE,WAAW,CAAC,CAAC;IAEhF,OAAO;QACL,IAAI,EAAE,gBAAgB,CAAC,SAAS;QAChC,OAAO,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAClE,WAAW,EAAE,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC;QAClG,SAAS,EAAE,kBAAkB,CAAC,SAAS;KACxC,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { BeaconConfig } from "@lodestar/config";
|
|
2
2
|
import { capella } from "@lodestar/types";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export declare function verifyBlsToExecutionChangeSignature(state: CachedBeaconStateAllForks, signedBLSToExecutionChange: capella.SignedBLSToExecutionChange): boolean;
|
|
3
|
+
import { SingleSignatureSet } from "../util/index.js";
|
|
4
|
+
export declare function verifyBlsToExecutionChangeSignature(config: BeaconConfig, signedBLSToExecutionChange: capella.SignedBLSToExecutionChange): boolean;
|
|
6
5
|
/**
|
|
7
6
|
* Extract signatures to allow validating all block signatures at once
|
|
8
7
|
*/
|
|
9
|
-
export declare function getBlsToExecutionChangeSignatureSet(config: BeaconConfig, signedBLSToExecutionChange: capella.SignedBLSToExecutionChange):
|
|
10
|
-
export declare function getBlsToExecutionChangeSignatureSets(config: BeaconConfig, signedBlock: capella.SignedBeaconBlock):
|
|
8
|
+
export declare function getBlsToExecutionChangeSignatureSet(config: BeaconConfig, signedBLSToExecutionChange: capella.SignedBLSToExecutionChange): SingleSignatureSet;
|
|
9
|
+
export declare function getBlsToExecutionChangeSignatureSets(config: BeaconConfig, signedBlock: capella.SignedBeaconBlock): SingleSignatureSet[];
|
|
11
10
|
//# sourceMappingURL=blsToExecutionChange.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blsToExecutionChange.d.ts","sourceRoot":"","sources":["../../src/signatureSets/blsToExecutionChange.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,OAAO,EAAM,MAAM,iBAAiB,CAAC;AAC7C,OAAO,
|
|
1
|
+
{"version":3,"file":"blsToExecutionChange.d.ts","sourceRoot":"","sources":["../../src/signatureSets/blsToExecutionChange.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,OAAO,EAAM,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAmB,kBAAkB,EAAyC,MAAM,kBAAkB,CAAC;AAE9G,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,YAAY,EACpB,0BAA0B,EAAE,OAAO,CAAC,0BAA0B,GAC7D,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,YAAY,EACpB,0BAA0B,EAAE,OAAO,CAAC,0BAA0B,GAC7D,kBAAkB,CAapB;AAED,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,OAAO,CAAC,iBAAiB,GACrC,kBAAkB,EAAE,CAItB"}
|
|
@@ -2,8 +2,8 @@ import { PublicKey } from "@chainsafe/blst";
|
|
|
2
2
|
import { DOMAIN_BLS_TO_EXECUTION_CHANGE, ForkName } from "@lodestar/params";
|
|
3
3
|
import { ssz } from "@lodestar/types";
|
|
4
4
|
import { SignatureSetType, computeSigningRoot, verifySignatureSet } from "../util/index.js";
|
|
5
|
-
export function verifyBlsToExecutionChangeSignature(
|
|
6
|
-
return verifySignatureSet(getBlsToExecutionChangeSignatureSet(
|
|
5
|
+
export function verifyBlsToExecutionChangeSignature(config, signedBLSToExecutionChange) {
|
|
6
|
+
return verifySignatureSet(getBlsToExecutionChangeSignatureSet(config, signedBLSToExecutionChange));
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Extract signatures to allow validating all block signatures at once
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blsToExecutionChange.js","sourceRoot":"","sources":["../../src/signatureSets/blsToExecutionChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAC,8BAA8B,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAU,GAAG,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"blsToExecutionChange.js","sourceRoot":"","sources":["../../src/signatureSets/blsToExecutionChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAC,8BAA8B,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAU,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,gBAAgB,EAAsB,kBAAkB,EAAE,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAE9G,MAAM,UAAU,mCAAmC,CACjD,MAAoB,EACpB,0BAA8D;IAE9D,OAAO,kBAAkB,CAAC,mCAAmC,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC,CAAC;AACrG,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mCAAmC,CACjD,MAAoB,EACpB,0BAA8D;IAE9D,4CAA4C;IAC5C,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC,aAAa,EAAE,8BAA8B,CAAC,CAAC;IAErF,OAAO;QACL,IAAI,EAAE,gBAAgB,CAAC,MAAM;QAC7B,+FAA+F;QAC/F,yDAAyD;QACzD,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,0BAA0B,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC;QACnF,WAAW,EAAE,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,oBAAoB,EAAE,0BAA0B,CAAC,OAAO,EAAE,MAAM,CAAC;QAC7G,SAAS,EAAE,0BAA0B,CAAC,SAAS;KAChD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oCAAoC,CAClD,MAAoB,EACpB,WAAsC;IAEtC,OAAO,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,oBAAoB,EAAE,EAAE,CACjF,mCAAmC,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAClE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BeaconConfig } from "@lodestar/config";
|
|
2
|
+
import { Slot, gloas } from "@lodestar/types";
|
|
3
|
+
export declare function getExecutionPayloadBidSigningRoot(config: BeaconConfig, stateSlot: Slot, bid: gloas.ExecutionPayloadBid): Uint8Array;
|
|
4
|
+
//# sourceMappingURL=executionPayloadBid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executionPayloadBid.d.ts","sourceRoot":"","sources":["../../src/signatureSets/executionPayloadBid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,IAAI,EAAE,KAAK,EAAM,MAAM,iBAAiB,CAAC;AAGjD,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,IAAI,EACf,GAAG,EAAE,KAAK,CAAC,mBAAmB,GAC7B,UAAU,CAIZ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DOMAIN_BEACON_BUILDER } from "@lodestar/params";
|
|
2
|
+
import { ssz } from "@lodestar/types";
|
|
3
|
+
import { computeSigningRoot } from "../util/index.js";
|
|
4
|
+
export function getExecutionPayloadBidSigningRoot(config, stateSlot, bid) {
|
|
5
|
+
const domain = config.getDomain(stateSlot, DOMAIN_BEACON_BUILDER);
|
|
6
|
+
return computeSigningRoot(ssz.gloas.ExecutionPayloadBid, bid, domain);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=executionPayloadBid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executionPayloadBid.js","sourceRoot":"","sources":["../../src/signatureSets/executionPayloadBid.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAc,GAAG,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAEpD,MAAM,UAAU,iCAAiC,CAC/C,MAAoB,EACpB,SAAe,EACf,GAA8B;IAE9B,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC;IAElE,OAAO,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BeaconConfig } from "@lodestar/config";
|
|
2
|
+
import { gloas } from "@lodestar/types";
|
|
3
|
+
export declare function getExecutionPayloadEnvelopeSigningRoot(config: BeaconConfig, envelope: gloas.ExecutionPayloadEnvelope): Uint8Array;
|
|
4
|
+
//# sourceMappingURL=executionPayloadEnvelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executionPayloadEnvelope.d.ts","sourceRoot":"","sources":["../../src/signatureSets/executionPayloadEnvelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,KAAK,EAAM,MAAM,iBAAiB,CAAC;AAG3C,wBAAgB,sCAAsC,CACpD,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,KAAK,CAAC,wBAAwB,GACvC,UAAU,CAIZ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DOMAIN_BEACON_BUILDER } from "@lodestar/params";
|
|
2
|
+
import { ssz } from "@lodestar/types";
|
|
3
|
+
import { computeSigningRoot } from "../util/index.js";
|
|
4
|
+
export function getExecutionPayloadEnvelopeSigningRoot(config, envelope) {
|
|
5
|
+
const domain = config.getDomain(envelope.slot, DOMAIN_BEACON_BUILDER);
|
|
6
|
+
return computeSigningRoot(ssz.gloas.ExecutionPayloadEnvelope, envelope, domain);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=executionPayloadEnvelope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executionPayloadEnvelope.js","sourceRoot":"","sources":["../../src/signatureSets/executionPayloadEnvelope.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAQ,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAEpD,MAAM,UAAU,sCAAsC,CACpD,MAAoB,EACpB,QAAwC;IAExC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;IAEtE,OAAO,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,wBAAwB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { BeaconConfig } from "@lodestar/config";
|
|
2
2
|
import { IndexedAttestation, SignedBeaconBlock } from "@lodestar/types";
|
|
3
|
-
import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
|
|
4
3
|
import { SyncCommitteeCache } from "../cache/syncCommitteeCache.js";
|
|
5
4
|
import { ISignatureSet } from "../util/index.js";
|
|
6
5
|
export * from "./attesterSlashings.js";
|
|
7
6
|
export * from "./blsToExecutionChange.js";
|
|
7
|
+
export * from "./executionPayloadBid.js";
|
|
8
|
+
export * from "./executionPayloadEnvelope.js";
|
|
8
9
|
export * from "./indexedAttestation.js";
|
|
9
10
|
export * from "./indexedPayloadAttestation.js";
|
|
10
11
|
export * from "./proposer.js";
|
|
@@ -15,7 +16,7 @@ export * from "./voluntaryExits.js";
|
|
|
15
16
|
* Includes all signatures on the block (except the deposit signatures) for verification.
|
|
16
17
|
* Deposits are not included because they can legally have invalid signatures.
|
|
17
18
|
*/
|
|
18
|
-
export declare function getBlockSignatureSets(config: BeaconConfig,
|
|
19
|
+
export declare function getBlockSignatureSets(config: BeaconConfig, currentSyncCommitteeIndexed: SyncCommitteeCache, signedBlock: SignedBeaconBlock, indexedAttestations: IndexedAttestation[], opts?: {
|
|
19
20
|
/** Useful since block proposer signature is verified beforehand on gossip validation */
|
|
20
21
|
skipProposerSignature?: boolean;
|
|
21
22
|
}): ISignatureSet[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signatureSets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAkB,MAAM,iBAAiB,CAAC;AAEvF,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signatureSets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAkB,MAAM,iBAAiB,CAAC;AAEvF,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAS/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AAEpC;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,2BAA2B,EAAE,kBAAkB,EAC/C,WAAW,EAAE,iBAAiB,EAC9B,mBAAmB,EAAE,kBAAkB,EAAE,EACzC,IAAI,CAAC,EAAE;IACL,wFAAwF;IACxF,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,GACA,aAAa,EAAE,CAyCjB"}
|
|
@@ -9,6 +9,8 @@ import { getRandaoRevealSignatureSet } from "./randao.js";
|
|
|
9
9
|
import { getVoluntaryExitsSignatureSets } from "./voluntaryExits.js";
|
|
10
10
|
export * from "./attesterSlashings.js";
|
|
11
11
|
export * from "./blsToExecutionChange.js";
|
|
12
|
+
export * from "./executionPayloadBid.js";
|
|
13
|
+
export * from "./executionPayloadEnvelope.js";
|
|
12
14
|
export * from "./indexedAttestation.js";
|
|
13
15
|
export * from "./indexedPayloadAttestation.js";
|
|
14
16
|
export * from "./proposer.js";
|
|
@@ -19,22 +21,22 @@ export * from "./voluntaryExits.js";
|
|
|
19
21
|
* Includes all signatures on the block (except the deposit signatures) for verification.
|
|
20
22
|
* Deposits are not included because they can legally have invalid signatures.
|
|
21
23
|
*/
|
|
22
|
-
export function getBlockSignatureSets(config,
|
|
24
|
+
export function getBlockSignatureSets(config, currentSyncCommitteeIndexed, signedBlock, indexedAttestations, opts) {
|
|
23
25
|
// fork based validations
|
|
24
26
|
const fork = config.getForkSeq(signedBlock.message.slot);
|
|
25
27
|
const signatureSets = [
|
|
26
|
-
getRandaoRevealSignatureSet(config,
|
|
27
|
-
...getProposerSlashingsSignatureSets(config,
|
|
28
|
-
...getAttesterSlashingsSignatureSets(config,
|
|
29
|
-
...getAttestationsSignatureSets(config,
|
|
30
|
-
...getVoluntaryExitsSignatureSets(config,
|
|
28
|
+
getRandaoRevealSignatureSet(config, signedBlock.message),
|
|
29
|
+
...getProposerSlashingsSignatureSets(config, signedBlock),
|
|
30
|
+
...getAttesterSlashingsSignatureSets(config, signedBlock),
|
|
31
|
+
...getAttestationsSignatureSets(config, signedBlock, indexedAttestations),
|
|
32
|
+
...getVoluntaryExitsSignatureSets(config, signedBlock),
|
|
31
33
|
];
|
|
32
34
|
if (!opts?.skipProposerSignature) {
|
|
33
|
-
signatureSets.push(getBlockProposerSignatureSet(config,
|
|
35
|
+
signatureSets.push(getBlockProposerSignatureSet(config, signedBlock));
|
|
34
36
|
}
|
|
35
37
|
// Only after altair fork, validate tSyncCommitteeSignature
|
|
36
38
|
if (fork >= ForkSeq.altair) {
|
|
37
|
-
const syncCommitteeSignatureSet = getSyncCommitteeSignatureSet(config,
|
|
39
|
+
const syncCommitteeSignatureSet = getSyncCommitteeSignatureSet(config, currentSyncCommitteeIndexed, signedBlock.message);
|
|
38
40
|
// There may be no participants in this syncCommitteeSignature, so it must not be validated
|
|
39
41
|
if (syncCommitteeSignatureSet) {
|
|
40
42
|
signatureSets.push(syncCommitteeSignatureSet);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/signatureSets/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAC,4BAA4B,EAAC,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","source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mBAAmB,CAAC;QACzE,GAAG,8BAA8B,CAAC,MAAM,EAAE,WAAW,CAAC;KACvD,CAAC;IAEF,IAAI,CAAC,IAAI,EAAE,qBAAqB,EAAE,CAAC;QACjC,aAAa,CAAC,IAAI,CAAC,4BAA4B,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IACxE,CAAC;IAED,2DAA2D;IAC3D,IAAI,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QAC3B,MAAM,yBAAyB,GAAG,4BAA4B,CAC5D,MAAM,EACN,2BAA2B,EAC1B,WAAwC,CAAC,OAAO,CAClD,CAAC;QACF,2FAA2F;QAC3F,IAAI,yBAAyB,EAAE,CAAC;YAC9B,aAAa,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAED,0BAA0B;IAC1B,IAAI,IAAI,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QAC5B,MAAM,iCAAiC,GAAG,oCAAoC,CAC5E,MAAM,EACN,WAAwC,CACzC,CAAC;QACF,IAAI,iCAAiC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjD,aAAa,CAAC,IAAI,CAAC,GAAG,iCAAiC,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { BeaconConfig } from "@lodestar/config";
|
|
2
2
|
import { IndexedAttestation, SignedBeaconBlock, Slot, phase0 } from "@lodestar/types";
|
|
3
|
-
import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
|
|
4
3
|
import { ISignatureSet } from "../util/index.js";
|
|
5
4
|
export declare function getAttestationDataSigningRoot(config: BeaconConfig, stateSlot: Slot, data: phase0.AttestationData): Uint8Array;
|
|
6
|
-
export declare function getAttestationWithIndicesSignatureSet(config: BeaconConfig,
|
|
7
|
-
export declare function getIndexedAttestationSignatureSet(config: BeaconConfig,
|
|
8
|
-
export declare function getAttestationsSignatureSets(config: BeaconConfig,
|
|
5
|
+
export declare function getAttestationWithIndicesSignatureSet(config: BeaconConfig, stateSlot: Slot, attestation: Pick<phase0.Attestation, "data" | "signature">, attestingIndices: number[]): ISignatureSet;
|
|
6
|
+
export declare function getIndexedAttestationSignatureSet(config: BeaconConfig, stateSlot: Slot, indexedAttestation: IndexedAttestation): ISignatureSet;
|
|
7
|
+
export declare function getAttestationsSignatureSets(config: BeaconConfig, signedBlock: SignedBeaconBlock, indexedAttestations: IndexedAttestation[]): ISignatureSet[];
|
|
9
8
|
//# sourceMappingURL=indexedAttestation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexedAttestation.d.ts","sourceRoot":"","sources":["../../src/signatureSets/indexedAttestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAM,MAAM,iBAAiB,CAAC;AACzF,OAAO,
|
|
1
|
+
{"version":3,"file":"indexedAttestation.d.ts","sourceRoot":"","sources":["../../src/signatureSets/indexedAttestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAM,MAAM,iBAAiB,CAAC;AACzF,OAAO,EACL,aAAa,EAId,MAAM,kBAAkB,CAAC;AAE1B,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,IAAI,EACf,IAAI,EAAE,MAAM,CAAC,eAAe,GAC3B,UAAU,CAKZ;AAED,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CAAC,EAC3D,gBAAgB,EAAE,MAAM,EAAE,GACzB,aAAa,CAMf;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,IAAI,EACf,kBAAkB,EAAE,kBAAkB,GACrC,aAAa,CAOf;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,iBAAiB,EAC9B,mBAAmB,EAAE,kBAAkB,EAAE,GACxC,aAAa,EAAE,CAYjB"}
|
|
@@ -6,19 +6,19 @@ export function getAttestationDataSigningRoot(config, stateSlot, data) {
|
|
|
6
6
|
const domain = config.getDomain(stateSlot, DOMAIN_BEACON_ATTESTER, messageSlot);
|
|
7
7
|
return computeSigningRoot(ssz.phase0.AttestationData, data, domain);
|
|
8
8
|
}
|
|
9
|
-
export function getAttestationWithIndicesSignatureSet(config,
|
|
10
|
-
return createAggregateSignatureSetFromComponents(attestingIndices
|
|
9
|
+
export function getAttestationWithIndicesSignatureSet(config, stateSlot, attestation, attestingIndices) {
|
|
10
|
+
return createAggregateSignatureSetFromComponents(attestingIndices, getAttestationDataSigningRoot(config, stateSlot, attestation.data), attestation.signature);
|
|
11
11
|
}
|
|
12
|
-
export function getIndexedAttestationSignatureSet(config,
|
|
13
|
-
return getAttestationWithIndicesSignatureSet(config,
|
|
12
|
+
export function getIndexedAttestationSignatureSet(config, stateSlot, indexedAttestation) {
|
|
13
|
+
return getAttestationWithIndicesSignatureSet(config, stateSlot, indexedAttestation, indexedAttestation.attestingIndices);
|
|
14
14
|
}
|
|
15
|
-
export function getAttestationsSignatureSets(config,
|
|
15
|
+
export function getAttestationsSignatureSets(config, signedBlock, indexedAttestations) {
|
|
16
16
|
if (indexedAttestations.length !== signedBlock.message.body.attestations.length) {
|
|
17
17
|
throw Error(`Indexed attestations length mismatch: got ${indexedAttestations.length}, expected ${signedBlock.message.body.attestations.length}`);
|
|
18
18
|
}
|
|
19
19
|
// the getDomain() api requires the state slot as 1st param, however it's the same to block.slot in state-transition
|
|
20
20
|
// and the same epoch when we verify blocks in batch in beacon-node. So we can safely use block.slot here.
|
|
21
21
|
const blockSlot = signedBlock.message.slot;
|
|
22
|
-
return indexedAttestations.map((indexedAttestation) => getIndexedAttestationSignatureSet(config,
|
|
22
|
+
return indexedAttestations.map((indexedAttestation) => getIndexedAttestationSignatureSet(config, blockSlot, indexedAttestation));
|
|
23
23
|
}
|
|
24
24
|
//# sourceMappingURL=indexedAttestation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexedAttestation.js","sourceRoot":"","sources":["../../src/signatureSets/indexedAttestation.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAsD,GAAG,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"indexedAttestation.js","sourceRoot":"","sources":["../../src/signatureSets/indexedAttestation.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAsD,GAAG,EAAC,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAEL,kBAAkB,EAClB,uBAAuB,EACvB,yCAAyC,GAC1C,MAAM,kBAAkB,CAAC;AAE1B,MAAM,UAAU,6BAA6B,CAC3C,MAAoB,EACpB,SAAe,EACf,IAA4B;IAE5B,MAAM,WAAW,GAAG,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/D,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,sBAAsB,EAAE,WAAW,CAAC,CAAC;IAEhF,OAAO,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,qCAAqC,CACnD,MAAoB,EACpB,SAAe,EACf,WAA2D,EAC3D,gBAA0B;IAE1B,OAAO,yCAAyC,CAC9C,gBAAgB,EAChB,6BAA6B,CAAC,MAAM,EAAE,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,EAClE,WAAW,CAAC,SAAS,CACtB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,MAAoB,EACpB,SAAe,EACf,kBAAsC;IAEtC,OAAO,qCAAqC,CAC1C,MAAM,EACN,SAAS,EACT,kBAAkB,EAClB,kBAAkB,CAAC,gBAAgB,CACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,MAAoB,EACpB,WAA8B,EAC9B,mBAAyC;IAEzC,IAAI,mBAAmB,CAAC,MAAM,KAAK,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;QAChF,MAAM,KAAK,CACT,6CAA6C,mBAAmB,CAAC,MAAM,cAAc,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CACpI,CAAC;IACJ,CAAC;IACD,oHAAoH;IACpH,0GAA0G;IAC1G,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3C,OAAO,mBAAmB,CAAC,GAAG,CAAC,CAAC,kBAAkB,EAAE,EAAE,CACpD,iCAAiC,CAAC,MAAM,EAAE,SAAS,EAAE,kBAAkB,CAAC,CACzE,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { BeaconConfig } from "@lodestar/config";
|
|
2
|
+
import { Slot, gloas } from "@lodestar/types";
|
|
3
|
+
import { CachedBeaconStateGloas } from "../types.js";
|
|
4
|
+
import { ISignatureSet } from "../util/index.js";
|
|
4
5
|
export declare function getIndexedPayloadAttestationSignatureSet(state: CachedBeaconStateGloas, indexedPayloadAttestation: gloas.IndexedPayloadAttestation): ISignatureSet;
|
|
5
|
-
export declare function getPayloadAttestationDataSigningRoot(
|
|
6
|
+
export declare function getPayloadAttestationDataSigningRoot(config: BeaconConfig, stateSlot: Slot, data: gloas.PayloadAttestationData): Uint8Array;
|
|
6
7
|
//# sourceMappingURL=indexedPayloadAttestation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexedPayloadAttestation.d.ts","sourceRoot":"","sources":["../../src/signatureSets/indexedPayloadAttestation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"indexedPayloadAttestation.d.ts","sourceRoot":"","sources":["../../src/signatureSets/indexedPayloadAttestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,IAAI,EAAE,KAAK,EAAM,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,sBAAsB,EAAC,MAAM,aAAa,CAAC;AACnD,OAAO,EAAC,aAAa,EAAgE,MAAM,kBAAkB,CAAC;AAE9G,wBAAgB,wCAAwC,CACtD,KAAK,EAAE,sBAAsB,EAC7B,yBAAyB,EAAE,KAAK,CAAC,yBAAyB,GACzD,aAAa,CAMf;AAED,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,IAAI,EACf,IAAI,EAAE,KAAK,CAAC,sBAAsB,GACjC,UAAU,CAIZ"}
|