@lodestar/state-transition 1.38.0-dev.bc1fed4d3d → 1.38.0-dev.ebc352f211
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 +4 -1
- package/lib/block/index.d.ts.map +1 -1
- package/lib/block/index.js +18 -9
- package/lib/block/index.js.map +1 -1
- package/lib/block/isValidIndexedAttestation.d.ts +3 -2
- package/lib/block/isValidIndexedAttestation.d.ts.map +1 -1
- package/lib/block/isValidIndexedAttestation.js +4 -4
- package/lib/block/isValidIndexedAttestation.js.map +1 -1
- package/lib/block/isValidIndexedPayloadAttestation.d.ts +4 -0
- package/lib/block/isValidIndexedPayloadAttestation.d.ts.map +1 -0
- package/lib/block/isValidIndexedPayloadAttestation.js +14 -0
- package/lib/block/isValidIndexedPayloadAttestation.js.map +1 -0
- package/lib/block/processAttestationPhase0.d.ts.map +1 -1
- package/lib/block/processAttestationPhase0.js +7 -2
- package/lib/block/processAttestationPhase0.js.map +1 -1
- package/lib/block/processAttestationsAltair.d.ts +3 -3
- package/lib/block/processAttestationsAltair.d.ts.map +1 -1
- package/lib/block/processAttestationsAltair.js +47 -5
- package/lib/block/processAttestationsAltair.js.map +1 -1
- package/lib/block/processAttesterSlashing.d.ts +2 -1
- package/lib/block/processAttesterSlashing.d.ts.map +1 -1
- package/lib/block/processAttesterSlashing.js +5 -4
- package/lib/block/processAttesterSlashing.js.map +1 -1
- package/lib/block/processConsolidationRequest.d.ts +3 -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 +2 -2
- package/lib/block/processDepositRequest.d.ts.map +1 -1
- package/lib/block/processDepositRequest.js.map +1 -1
- package/lib/block/processExecutionPayload.d.ts.map +1 -1
- package/lib/block/processExecutionPayload.js +4 -6
- package/lib/block/processExecutionPayload.js.map +1 -1
- package/lib/block/processExecutionPayloadBid.d.ts +5 -0
- package/lib/block/processExecutionPayloadBid.d.ts.map +1 -0
- package/lib/block/processExecutionPayloadBid.js +89 -0
- package/lib/block/processExecutionPayloadBid.js.map +1 -0
- package/lib/block/processExecutionPayloadEnvelope.d.ts +4 -0
- package/lib/block/processExecutionPayloadEnvelope.d.ts.map +1 -0
- package/lib/block/processExecutionPayloadEnvelope.js +118 -0
- package/lib/block/processExecutionPayloadEnvelope.js.map +1 -0
- package/lib/block/processOperations.d.ts.map +1 -1
- package/lib/block/processOperations.js +8 -2
- package/lib/block/processOperations.js.map +1 -1
- package/lib/block/processPayloadAttestation.d.ts +4 -0
- package/lib/block/processPayloadAttestation.d.ts.map +1 -0
- package/lib/block/processPayloadAttestation.js +16 -0
- package/lib/block/processPayloadAttestation.js.map +1 -0
- package/lib/block/processProposerSlashing.d.ts.map +1 -1
- package/lib/block/processProposerSlashing.js +17 -2
- package/lib/block/processProposerSlashing.js.map +1 -1
- package/lib/block/processRandao.js +1 -1
- package/lib/block/processRandao.js.map +1 -1
- package/lib/block/processSyncCommittee.d.ts +2 -1
- package/lib/block/processSyncCommittee.d.ts.map +1 -1
- package/lib/block/processSyncCommittee.js +3 -4
- package/lib/block/processSyncCommittee.js.map +1 -1
- package/lib/block/processVoluntaryExit.js +2 -2
- package/lib/block/processVoluntaryExit.js.map +1 -1
- package/lib/block/processWithdrawalRequest.d.ts +2 -2
- package/lib/block/processWithdrawalRequest.d.ts.map +1 -1
- package/lib/block/processWithdrawalRequest.js +1 -1
- package/lib/block/processWithdrawalRequest.js.map +1 -1
- package/lib/block/processWithdrawals.d.ts +4 -3
- package/lib/block/processWithdrawals.d.ts.map +1 -1
- package/lib/block/processWithdrawals.js +89 -19
- package/lib/block/processWithdrawals.js.map +1 -1
- package/lib/cache/epochCache.d.ts +5 -1
- package/lib/cache/epochCache.d.ts.map +1 -1
- package/lib/cache/epochCache.js +34 -1
- package/lib/cache/epochCache.js.map +1 -1
- package/lib/epoch/index.d.ts +4 -2
- package/lib/epoch/index.d.ts.map +1 -1
- package/lib/epoch/index.js +10 -1
- package/lib/epoch/index.js.map +1 -1
- package/lib/epoch/processBuilderPendingPayments.d.ts +6 -0
- package/lib/epoch/processBuilderPendingPayments.d.ts.map +1 -0
- package/lib/epoch/processBuilderPendingPayments.js +28 -0
- package/lib/epoch/processBuilderPendingPayments.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/signatureSets/attesterSlashings.d.ts +4 -3
- 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/index.d.ts +3 -1
- package/lib/signatureSets/index.d.ts.map +1 -1
- package/lib/signatureSets/index.js +9 -8
- package/lib/signatureSets/index.js.map +1 -1
- package/lib/signatureSets/indexedAttestation.d.ts +4 -3
- 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 +6 -0
- package/lib/signatureSets/indexedPayloadAttestation.d.ts.map +1 -0
- package/lib/signatureSets/indexedPayloadAttestation.js +11 -0
- package/lib/signatureSets/indexedPayloadAttestation.js.map +1 -0
- package/lib/signatureSets/proposer.d.ts +5 -4
- 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 +3 -2
- package/lib/signatureSets/proposerSlashings.d.ts.map +1 -1
- package/lib/signatureSets/proposerSlashings.js +4 -5
- package/lib/signatureSets/proposerSlashings.js.map +1 -1
- package/lib/signatureSets/randao.d.ts +3 -2
- package/lib/signatureSets/randao.d.ts.map +1 -1
- package/lib/signatureSets/randao.js +4 -5
- package/lib/signatureSets/randao.js.map +1 -1
- package/lib/signatureSets/voluntaryExits.d.ts +4 -3
- package/lib/signatureSets/voluntaryExits.d.ts.map +1 -1
- package/lib/signatureSets/voluntaryExits.js +6 -7
- package/lib/signatureSets/voluntaryExits.js.map +1 -1
- package/lib/slot/index.d.ts +2 -1
- package/lib/slot/index.d.ts.map +1 -1
- package/lib/slot/index.js +6 -2
- package/lib/slot/index.js.map +1 -1
- package/lib/slot/upgradeStateToAltair.js +1 -1
- package/lib/slot/upgradeStateToAltair.js.map +1 -1
- package/lib/slot/upgradeStateToGloas.d.ts +0 -1
- package/lib/slot/upgradeStateToGloas.d.ts.map +1 -1
- package/lib/slot/upgradeStateToGloas.js +47 -5
- package/lib/slot/upgradeStateToGloas.js.map +1 -1
- package/lib/stateTransition.js +5 -4
- package/lib/stateTransition.js.map +1 -1
- package/lib/util/electra.d.ts +5 -5
- package/lib/util/electra.d.ts.map +1 -1
- package/lib/util/electra.js +2 -1
- package/lib/util/electra.js.map +1 -1
- package/lib/util/epoch.d.ts +3 -3
- package/lib/util/epoch.d.ts.map +1 -1
- package/lib/util/epoch.js.map +1 -1
- package/lib/util/execution.d.ts +1 -16
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +1 -44
- package/lib/util/execution.js.map +1 -1
- package/lib/util/gloas.d.ts +11 -0
- package/lib/util/gloas.d.ts.map +1 -0
- package/lib/util/gloas.js +35 -0
- package/lib/util/gloas.js.map +1 -0
- package/lib/util/seed.d.ts +5 -1
- package/lib/util/seed.d.ts.map +1 -1
- package/lib/util/seed.js +33 -1
- package/lib/util/seed.js.map +1 -1
- package/lib/util/validator.d.ts +2 -2
- package/lib/util/validator.d.ts.map +1 -1
- package/lib/util/validator.js +14 -1
- package/lib/util/validator.js.map +1 -1
- package/package.json +6 -6
- package/src/block/index.ts +32 -15
- package/src/block/isValidIndexedAttestation.ts +5 -2
- package/src/block/isValidIndexedPayloadAttestation.ts +23 -0
- package/src/block/processAttestationPhase0.ts +13 -2
- package/src/block/processAttestationsAltair.ts +63 -6
- package/src/block/processAttesterSlashing.ts +6 -3
- package/src/block/processConsolidationRequest.ts +6 -5
- package/src/block/processDepositRequest.ts +5 -2
- package/src/block/processExecutionPayload.ts +8 -14
- package/src/block/processExecutionPayloadBid.ts +120 -0
- package/src/block/processExecutionPayloadEnvelope.ts +181 -0
- package/src/block/processOperations.ts +16 -4
- package/src/block/processPayloadAttestation.ts +25 -0
- package/src/block/processProposerSlashing.ts +25 -4
- package/src/block/processRandao.ts +1 -1
- package/src/block/processSyncCommittee.ts +4 -3
- package/src/block/processVoluntaryExit.ts +2 -2
- package/src/block/processWithdrawalRequest.ts +4 -4
- package/src/block/processWithdrawals.ts +118 -27
- package/src/cache/epochCache.ts +58 -1
- package/src/epoch/index.ts +12 -0
- package/src/epoch/processBuilderPendingPayments.ts +31 -0
- package/src/index.ts +2 -0
- package/src/signatureSets/attesterSlashings.ts +7 -3
- package/src/signatureSets/index.ts +10 -6
- package/src/signatureSets/indexedAttestation.ts +14 -3
- package/src/signatureSets/indexedPayloadAttestation.ts +24 -0
- package/src/signatureSets/proposer.ts +13 -7
- package/src/signatureSets/proposerSlashings.ts +5 -3
- package/src/signatureSets/randao.ts +13 -5
- package/src/signatureSets/voluntaryExits.ts +7 -4
- package/src/slot/index.ts +11 -3
- package/src/slot/upgradeStateToAltair.ts +2 -1
- package/src/slot/upgradeStateToGloas.ts +49 -5
- package/src/stateTransition.ts +5 -5
- package/src/util/electra.ts +15 -6
- package/src/util/epoch.ts +6 -3
- package/src/util/execution.ts +0 -60
- package/src/util/gloas.ts +58 -0
- package/src/util/seed.ts +57 -1
- package/src/util/validator.ts +21 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SLOTS_PER_EPOCH } from "@lodestar/params";
|
|
2
|
+
import { ssz } from "@lodestar/types";
|
|
3
|
+
import { computeExitEpochAndUpdateChurn } from "../util/epoch.js";
|
|
4
|
+
import { getBuilderPaymentQuorumThreshold } from "../util/gloas.js";
|
|
5
|
+
/**
|
|
6
|
+
* Processes the builder pending payments from the previous epoch.
|
|
7
|
+
*/
|
|
8
|
+
export function processBuilderPendingPayments(state) {
|
|
9
|
+
const quorum = getBuilderPaymentQuorumThreshold(state);
|
|
10
|
+
for (let i = 0; i < SLOTS_PER_EPOCH; i++) {
|
|
11
|
+
const payment = state.builderPendingPayments.get(i);
|
|
12
|
+
if (payment.weight > quorum) {
|
|
13
|
+
const exitQueueEpoch = computeExitEpochAndUpdateChurn(state, BigInt(payment.withdrawal.amount));
|
|
14
|
+
payment.withdrawal.withdrawableEpoch = exitQueueEpoch + state.config.MIN_VALIDATOR_WITHDRAWABILITY_DELAY;
|
|
15
|
+
state.builderPendingWithdrawals.push(payment.withdrawal);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
// TODO GLOAS: Optimize this
|
|
19
|
+
for (let i = 0; i < state.builderPendingPayments.length; i++) {
|
|
20
|
+
if (i < SLOTS_PER_EPOCH) {
|
|
21
|
+
state.builderPendingPayments.set(i, state.builderPendingPayments.get(i + SLOTS_PER_EPOCH).clone());
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
state.builderPendingPayments.set(i, ssz.gloas.BuilderPendingPayment.defaultViewDU());
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=processBuilderPendingPayments.js.map
|
|
@@ -0,0 +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,8BAA8B,EAAC,MAAM,kBAAkB,CAAC;AAChE,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,GAAG,MAAM,EAAE,CAAC;YAC5B,MAAM,cAAc,GAAG,8BAA8B,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;YAChG,OAAO,CAAC,UAAU,CAAC,iBAAiB,GAAG,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,mCAAmC,CAAC;YAEzG,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"}
|
package/lib/index.d.ts
CHANGED
|
@@ -17,6 +17,6 @@ export type { EpochTransitionStep } from "./epoch/index.js";
|
|
|
17
17
|
export { type BeaconStateTransitionMetrics, getMetrics } from "./metrics.js";
|
|
18
18
|
export * from "./signatureSets/index.js";
|
|
19
19
|
export * from "./stateTransition.js";
|
|
20
|
-
export type { BeaconStateAllForks, BeaconStateAltair, BeaconStateBellatrix, BeaconStateCapella, BeaconStateDeneb, BeaconStateElectra, BeaconStateExecutions, BeaconStateFulu, BeaconStatePhase0, CachedBeaconStateAllForks, CachedBeaconStateAltair, CachedBeaconStateBellatrix, CachedBeaconStateCapella, CachedBeaconStateDeneb, CachedBeaconStateElectra, CachedBeaconStateExecutions, CachedBeaconStateFulu, CachedBeaconStatePhase0, } from "./types.js";
|
|
20
|
+
export type { BeaconStateAllForks, BeaconStateAltair, BeaconStateBellatrix, BeaconStateCapella, BeaconStateDeneb, BeaconStateElectra, BeaconStateExecutions, BeaconStateFulu, BeaconStateGloas, BeaconStatePhase0, CachedBeaconStateAllForks, CachedBeaconStateAltair, CachedBeaconStateBellatrix, CachedBeaconStateCapella, CachedBeaconStateDeneb, CachedBeaconStateElectra, CachedBeaconStateExecutions, CachedBeaconStateFulu, CachedBeaconStateGloas, CachedBeaconStatePhase0, } from "./types.js";
|
|
21
21
|
export * from "./util/index.js";
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
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,EAA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C"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { AttesterSlashing, IndexedAttestationBigint, SignedBeaconBlock } from "@lodestar/types";
|
|
2
|
+
import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
|
|
2
3
|
import { CachedBeaconStateAllForks } from "../types.js";
|
|
3
4
|
import { ISignatureSet } from "../util/index.js";
|
|
4
5
|
/** Get signature sets from all AttesterSlashing objects in a block */
|
|
5
|
-
export declare function getAttesterSlashingsSignatureSets(state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock): ISignatureSet[];
|
|
6
|
+
export declare function getAttesterSlashingsSignatureSets(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock): ISignatureSet[];
|
|
6
7
|
/** Get signature sets from a single AttesterSlashing object */
|
|
7
|
-
export declare function getAttesterSlashingSignatureSets(state: CachedBeaconStateAllForks, attesterSlashing: AttesterSlashing): ISignatureSet[];
|
|
8
|
-
export declare function getIndexedAttestationBigintSignatureSet(state: CachedBeaconStateAllForks, indexedAttestation: IndexedAttestationBigint): ISignatureSet;
|
|
8
|
+
export declare function getAttesterSlashingSignatureSets(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, attesterSlashing: AttesterSlashing): ISignatureSet[];
|
|
9
|
+
export declare function getIndexedAttestationBigintSignatureSet(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, indexedAttestation: IndexedAttestationBigint): ISignatureSet;
|
|
9
10
|
//# sourceMappingURL=attesterSlashings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attesterSlashings.d.ts","sourceRoot":"","sources":["../../src/signatureSets/attesterSlashings.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAE,wBAAwB,EAAE,iBAAiB,EAAM,MAAM,iBAAiB,CAAC;AACnG,OAAO,EAAC,yBAAyB,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EAAC,aAAa,EAAgE,MAAM,kBAAkB,CAAC;AAE9G,sEAAsE;AACtE,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,yBAAyB,EAChC,WAAW,EAAE,iBAAiB,GAC7B,aAAa,EAAE,CAIjB;AAED,+DAA+D;AAC/D,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,yBAAyB,EAChC,gBAAgB,EAAE,gBAAgB,GACjC,aAAa,EAAE,CAIjB;AAED,wBAAgB,uCAAuC,CACrD,KAAK,EAAE,yBAAyB,EAChC,kBAAkB,EAAE,wBAAwB,GAC3C,aAAa,CAUf"}
|
|
1
|
+
{"version":3,"file":"attesterSlashings.d.ts","sourceRoot":"","sources":["../../src/signatureSets/attesterSlashings.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAE,wBAAwB,EAAE,iBAAiB,EAAM,MAAM,iBAAiB,CAAC;AACnG,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAC,yBAAyB,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EAAC,aAAa,EAAgE,MAAM,kBAAkB,CAAC;AAE9G,sEAAsE;AACtE,wBAAgB,iCAAiC,CAC/C,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,WAAW,EAAE,iBAAiB,GAC7B,aAAa,EAAE,CAIjB;AAED,+DAA+D;AAC/D,wBAAgB,gCAAgC,CAC9C,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,gBAAgB,EAAE,gBAAgB,GACjC,aAAa,EAAE,CAIjB;AAED,wBAAgB,uCAAuC,CACrD,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,kBAAkB,EAAE,wBAAwB,GAC3C,aAAa,CAUf"}
|
|
@@ -2,19 +2,19 @@ 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(state, signedBlock) {
|
|
6
|
-
return signedBlock.message.body.attesterSlashings.flatMap((attesterSlashing) => getAttesterSlashingSignatureSets(state, attesterSlashing));
|
|
5
|
+
export function getAttesterSlashingsSignatureSets(index2pubkey, state, signedBlock) {
|
|
6
|
+
return signedBlock.message.body.attesterSlashings.flatMap((attesterSlashing) => getAttesterSlashingSignatureSets(index2pubkey, state, attesterSlashing));
|
|
7
7
|
}
|
|
8
8
|
/** Get signature sets from a single AttesterSlashing object */
|
|
9
|
-
export function getAttesterSlashingSignatureSets(state, attesterSlashing) {
|
|
10
|
-
return [attesterSlashing.attestation1, attesterSlashing.attestation2].map((attestation) => getIndexedAttestationBigintSignatureSet(state, attestation));
|
|
9
|
+
export function getAttesterSlashingSignatureSets(index2pubkey, state, attesterSlashing) {
|
|
10
|
+
return [attesterSlashing.attestation1, attesterSlashing.attestation2].map((attestation) => getIndexedAttestationBigintSignatureSet(index2pubkey, state, attestation));
|
|
11
11
|
}
|
|
12
|
-
export function getIndexedAttestationBigintSignatureSet(state, indexedAttestation) {
|
|
12
|
+
export function getIndexedAttestationBigintSignatureSet(index2pubkey, state, indexedAttestation) {
|
|
13
13
|
const slot = computeStartSlotAtEpoch(Number(indexedAttestation.data.target.epoch));
|
|
14
14
|
const domain = state.config.getDomain(state.slot, DOMAIN_BEACON_ATTESTER, slot);
|
|
15
15
|
return {
|
|
16
16
|
type: SignatureSetType.aggregate,
|
|
17
|
-
pubkeys: indexedAttestation.attestingIndices.map((i) =>
|
|
17
|
+
pubkeys: indexedAttestation.attestingIndices.map((i) => index2pubkey[i]),
|
|
18
18
|
signingRoot: computeSigningRoot(ssz.phase0.AttestationDataBigint, indexedAttestation.data, domain),
|
|
19
19
|
signature: indexedAttestation.signature,
|
|
20
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attesterSlashings.js","sourceRoot":"","sources":["../../src/signatureSets/attesterSlashings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAgE,GAAG,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"attesterSlashings.js","sourceRoot":"","sources":["../../src/signatureSets/attesterSlashings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAgE,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAGnG,OAAO,EAAgB,gBAAgB,EAAE,kBAAkB,EAAE,uBAAuB,EAAC,MAAM,kBAAkB,CAAC;AAE9G,sEAAsE;AACtE,MAAM,UAAU,iCAAiC,CAC/C,YAA+B,EAC/B,KAAgC,EAChC,WAA8B;IAE9B,OAAO,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAC7E,gCAAgC,CAAC,YAAY,EAAE,KAAK,EAAE,gBAAgB,CAAC,CACxE,CAAC;AACJ,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,gCAAgC,CAC9C,YAA+B,EAC/B,KAAgC,EAChC,gBAAkC;IAElC,OAAO,CAAC,gBAAgB,CAAC,YAAY,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CACxF,uCAAuC,CAAC,YAAY,EAAE,KAAK,EAAE,WAAW,CAAC,CAC1E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uCAAuC,CACrD,YAA+B,EAC/B,KAAgC,EAChC,kBAA4C;IAE5C,MAAM,IAAI,GAAG,uBAAuB,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAe,CAAC,CAAC,CAAC;IAC7F,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,sBAAsB,EAAE,IAAI,CAAC,CAAC;IAEhF,OAAO;QACL,IAAI,EAAE,gBAAgB,CAAC,SAAS;QAChC,OAAO,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACxE,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,9 +1,11 @@
|
|
|
1
1
|
import { IndexedAttestation, SignedBeaconBlock } from "@lodestar/types";
|
|
2
|
+
import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
|
|
2
3
|
import { CachedBeaconStateAllForks } from "../types.js";
|
|
3
4
|
import { ISignatureSet } from "../util/index.js";
|
|
4
5
|
export * from "./attesterSlashings.js";
|
|
5
6
|
export * from "./blsToExecutionChange.js";
|
|
6
7
|
export * from "./indexedAttestation.js";
|
|
8
|
+
export * from "./indexedPayloadAttestation.js";
|
|
7
9
|
export * from "./proposer.js";
|
|
8
10
|
export * from "./proposerSlashings.js";
|
|
9
11
|
export * from "./randao.js";
|
|
@@ -12,7 +14,7 @@ export * from "./voluntaryExits.js";
|
|
|
12
14
|
* Includes all signatures on the block (except the deposit signatures) for verification.
|
|
13
15
|
* Deposits are not included because they can legally have invalid signatures.
|
|
14
16
|
*/
|
|
15
|
-
export declare function getBlockSignatureSets(state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock, indexedAttestations: IndexedAttestation[], opts?: {
|
|
17
|
+
export declare function getBlockSignatureSets(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock, indexedAttestations: IndexedAttestation[], opts?: {
|
|
16
18
|
/** Useful since block proposer signature is verified beforehand on gossip validation */
|
|
17
19
|
skipProposerSignature?: boolean;
|
|
18
20
|
}): ISignatureSet[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signatureSets/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAkB,MAAM,iBAAiB,CAAC;AAEvF,OAAO,EAAC,yBAAyB,EAA0B,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAS/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AAEpC;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,yBAAyB,EAChC,WAAW,EAAE,iBAAiB,EAC9B,mBAAmB,EAAE,kBAAkB,EAAE,EACzC,IAAI,CAAC,EAAE;IACL,wFAAwF;IACxF,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,GACA,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signatureSets/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAkB,MAAM,iBAAiB,CAAC;AAEvF,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAC,yBAAyB,EAA0B,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAS/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,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,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,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"}
|
|
@@ -10,6 +10,7 @@ import { getVoluntaryExitsSignatureSets } from "./voluntaryExits.js";
|
|
|
10
10
|
export * from "./attesterSlashings.js";
|
|
11
11
|
export * from "./blsToExecutionChange.js";
|
|
12
12
|
export * from "./indexedAttestation.js";
|
|
13
|
+
export * from "./indexedPayloadAttestation.js";
|
|
13
14
|
export * from "./proposer.js";
|
|
14
15
|
export * from "./proposerSlashings.js";
|
|
15
16
|
export * from "./randao.js";
|
|
@@ -18,22 +19,22 @@ export * from "./voluntaryExits.js";
|
|
|
18
19
|
* Includes all signatures on the block (except the deposit signatures) for verification.
|
|
19
20
|
* Deposits are not included because they can legally have invalid signatures.
|
|
20
21
|
*/
|
|
21
|
-
export function getBlockSignatureSets(state, signedBlock, indexedAttestations, opts) {
|
|
22
|
+
export function getBlockSignatureSets(index2pubkey, state, signedBlock, indexedAttestations, opts) {
|
|
22
23
|
// fork based validations
|
|
23
24
|
const fork = state.config.getForkSeq(signedBlock.message.slot);
|
|
24
25
|
const signatureSets = [
|
|
25
|
-
getRandaoRevealSignatureSet(state, signedBlock.message),
|
|
26
|
-
...getProposerSlashingsSignatureSets(state, signedBlock),
|
|
27
|
-
...getAttesterSlashingsSignatureSets(state, signedBlock),
|
|
28
|
-
...getAttestationsSignatureSets(state, signedBlock, indexedAttestations),
|
|
29
|
-
...getVoluntaryExitsSignatureSets(state, signedBlock),
|
|
26
|
+
getRandaoRevealSignatureSet(index2pubkey, state, signedBlock.message),
|
|
27
|
+
...getProposerSlashingsSignatureSets(index2pubkey, state, signedBlock),
|
|
28
|
+
...getAttesterSlashingsSignatureSets(index2pubkey, state, signedBlock),
|
|
29
|
+
...getAttestationsSignatureSets(index2pubkey, state, signedBlock, indexedAttestations),
|
|
30
|
+
...getVoluntaryExitsSignatureSets(index2pubkey, state, signedBlock),
|
|
30
31
|
];
|
|
31
32
|
if (!opts?.skipProposerSignature) {
|
|
32
|
-
signatureSets.push(getBlockProposerSignatureSet(state, signedBlock));
|
|
33
|
+
signatureSets.push(getBlockProposerSignatureSet(index2pubkey, state, signedBlock));
|
|
33
34
|
}
|
|
34
35
|
// Only after altair fork, validate tSyncCommitteeSignature
|
|
35
36
|
if (fork >= ForkSeq.altair) {
|
|
36
|
-
const syncCommitteeSignatureSet = getSyncCommitteeSignatureSet(state, signedBlock.message);
|
|
37
|
+
const syncCommitteeSignatureSet = getSyncCommitteeSignatureSet(index2pubkey, state, signedBlock.message);
|
|
37
38
|
// There may be no participants in this syncCommitteeSignature, so it must not be validated
|
|
38
39
|
if (syncCommitteeSignatureSet) {
|
|
39
40
|
signatureSets.push(syncCommitteeSignatureSet);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/signatureSets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAC,4BAA4B,EAAC,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/signatureSets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAC,4BAA4B,EAAC,MAAM,kCAAkC,CAAC;AAI9E,OAAO,EAAC,iCAAiC,EAAC,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAC,oCAAoC,EAAC,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAC,4BAA4B,EAAC,M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AO,CAAC,MAAM,EAAE,CAAC;QAC3B,MAAM,yBAAyB,GAAG,4BAA4B,CAC5D,YAAY,EACZ,KAAgC,EAC/B,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,KAAK,CAAC,MAAM,EACZ,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,8 +1,9 @@
|
|
|
1
1
|
import { IndexedAttestation, SignedBeaconBlock, phase0 } from "@lodestar/types";
|
|
2
|
+
import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
|
|
2
3
|
import { CachedBeaconStateAllForks } from "../types.js";
|
|
3
4
|
import { ISignatureSet } from "../util/index.js";
|
|
4
5
|
export declare function getAttestationDataSigningRoot(state: CachedBeaconStateAllForks, data: phase0.AttestationData): Uint8Array;
|
|
5
|
-
export declare function getAttestationWithIndicesSignatureSet(state: CachedBeaconStateAllForks, attestation: Pick<phase0.Attestation, "data" | "signature">, attestingIndices: number[]): ISignatureSet;
|
|
6
|
-
export declare function getIndexedAttestationSignatureSet(state: CachedBeaconStateAllForks, indexedAttestation: IndexedAttestation): ISignatureSet;
|
|
7
|
-
export declare function getAttestationsSignatureSets(state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock, indexedAttestations: IndexedAttestation[]): ISignatureSet[];
|
|
6
|
+
export declare function getAttestationWithIndicesSignatureSet(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, attestation: Pick<phase0.Attestation, "data" | "signature">, attestingIndices: number[]): ISignatureSet;
|
|
7
|
+
export declare function getIndexedAttestationSignatureSet(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, indexedAttestation: IndexedAttestation): ISignatureSet;
|
|
8
|
+
export declare function getAttestationsSignatureSets(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock, indexedAttestations: IndexedAttestation[]): ISignatureSet[];
|
|
8
9
|
//# sourceMappingURL=indexedAttestation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexedAttestation.d.ts","sourceRoot":"","sources":["../../src/signatureSets/indexedAttestation.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,EAAM,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAC,yBAAyB,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,aAAa,EAId,MAAM,kBAAkB,CAAC;AAE1B,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,yBAAyB,EAChC,IAAI,EAAE,MAAM,CAAC,eAAe,GAC3B,UAAU,CAKZ;AAED,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,yBAAyB,EAChC,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,KAAK,EAAE,yBAAyB,EAChC,kBAAkB,EAAE,kBAAkB,GACrC,aAAa,
|
|
1
|
+
{"version":3,"file":"indexedAttestation.d.ts","sourceRoot":"","sources":["../../src/signatureSets/indexedAttestation.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,EAAM,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAC,yBAAyB,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,aAAa,EAId,MAAM,kBAAkB,CAAC;AAE1B,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,yBAAyB,EAChC,IAAI,EAAE,MAAM,CAAC,eAAe,GAC3B,UAAU,CAKZ;AAED,wBAAgB,qCAAqC,CACnD,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,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,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,kBAAkB,EAAE,kBAAkB,GACrC,aAAa,CAOf;AAED,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,WAAW,EAAE,iBAAiB,EAC9B,mBAAmB,EAAE,kBAAkB,EAAE,GACxC,aAAa,EAAE,CASjB"}
|
|
@@ -6,16 +6,16 @@ export function getAttestationDataSigningRoot(state, data) {
|
|
|
6
6
|
const domain = state.config.getDomain(state.slot, DOMAIN_BEACON_ATTESTER, slot);
|
|
7
7
|
return computeSigningRoot(ssz.phase0.AttestationData, data, domain);
|
|
8
8
|
}
|
|
9
|
-
export function getAttestationWithIndicesSignatureSet(state, attestation, attestingIndices) {
|
|
10
|
-
return createAggregateSignatureSetFromComponents(attestingIndices.map((i) =>
|
|
9
|
+
export function getAttestationWithIndicesSignatureSet(index2pubkey, state, attestation, attestingIndices) {
|
|
10
|
+
return createAggregateSignatureSetFromComponents(attestingIndices.map((i) => index2pubkey[i]), getAttestationDataSigningRoot(state, attestation.data), attestation.signature);
|
|
11
11
|
}
|
|
12
|
-
export function getIndexedAttestationSignatureSet(state, indexedAttestation) {
|
|
13
|
-
return getAttestationWithIndicesSignatureSet(state, indexedAttestation, indexedAttestation.attestingIndices);
|
|
12
|
+
export function getIndexedAttestationSignatureSet(index2pubkey, state, indexedAttestation) {
|
|
13
|
+
return getAttestationWithIndicesSignatureSet(index2pubkey, state, indexedAttestation, indexedAttestation.attestingIndices);
|
|
14
14
|
}
|
|
15
|
-
export function getAttestationsSignatureSets(state, signedBlock, indexedAttestations) {
|
|
15
|
+
export function getAttestationsSignatureSets(index2pubkey, state, 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
|
-
return indexedAttestations.map((indexedAttestation) => getIndexedAttestationSignatureSet(state, indexedAttestation));
|
|
19
|
+
return indexedAttestations.map((indexedAttestation) => getIndexedAttestationSignatureSet(index2pubkey, state, indexedAttestation));
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=indexedAttestation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexedAttestation.js","sourceRoot":"","sources":["../../src/signatureSets/indexedAttestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAgD,GAAG,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"indexedAttestation.js","sourceRoot":"","sources":["../../src/signatureSets/indexedAttestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAgD,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAGnF,OAAO,EAEL,kBAAkB,EAClB,uBAAuB,EACvB,yCAAyC,GAC1C,MAAM,kBAAkB,CAAC;AAE1B,MAAM,UAAU,6BAA6B,CAC3C,KAAgC,EAChC,IAA4B;IAE5B,MAAM,IA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E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { gloas } from "@lodestar/types";
|
|
2
|
+
import { CachedBeaconStateGloas } from "../types.ts";
|
|
3
|
+
import { ISignatureSet } from "../util/index.ts";
|
|
4
|
+
export declare function getIndexedPayloadAttestationSignatureSet(state: CachedBeaconStateGloas, indexedPayloadAttestation: gloas.IndexedPayloadAttestation): ISignatureSet;
|
|
5
|
+
export declare function getPayloadAttestationDataSigningRoot(state: CachedBeaconStateGloas, data: gloas.PayloadAttestationData): Uint8Array;
|
|
6
|
+
//# sourceMappingURL=indexedPayloadAttestation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexedPayloadAttestation.d.ts","sourceRoot":"","sources":["../../src/signatureSets/indexedPayloadAttestation.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,EAAM,MAAM,iBAAiB,CAAC;AAC3C,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,KAAK,EAAE,sBAAsB,EAC7B,IAAI,EAAE,KAAK,CAAC,sBAAsB,GACjC,UAAU,CAIZ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DOMAIN_PTC_ATTESTER } from "@lodestar/params";
|
|
2
|
+
import { ssz } from "@lodestar/types";
|
|
3
|
+
import { computeSigningRoot, createAggregateSignatureSetFromComponents } from "../util/index.js";
|
|
4
|
+
export function getIndexedPayloadAttestationSignatureSet(state, indexedPayloadAttestation) {
|
|
5
|
+
return createAggregateSignatureSetFromComponents(indexedPayloadAttestation.attestingIndices.map((i) => state.epochCtx.index2pubkey[i]), getPayloadAttestationDataSigningRoot(state, indexedPayloadAttestation.data), indexedPayloadAttestation.signature);
|
|
6
|
+
}
|
|
7
|
+
export function getPayloadAttestationDataSigningRoot(state, data) {
|
|
8
|
+
const domain = state.config.getDomain(state.slot, DOMAIN_PTC_ATTESTER);
|
|
9
|
+
return computeSigningRoot(ssz.gloas.PayloadAttestationData, data, domain);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=indexedPayloadAttestation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexedPayloadAttestation.js","sourceRoot":"","sources":["../../src/signatureSets/indexedPayloadAttestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAQ,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAgB,kBAAkB,EAAE,yCAAyC,EAAC,MAAM,kBAAkB,CAAC;AAE9G,MAAM,UAAU,wCAAwC,CACtD,KAA6B,EAC7B,yBAA0D;IAE1D,OAAO,yCAAyC,CAC9C,yBAAyB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EACrF,oCAAoC,CAAC,KAAK,EAAE,yBAAyB,CAAC,IAAI,CAAC,EAC3E,yBAAyB,CAAC,SAAS,CACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oCAAoC,CAClD,KAA6B,EAC7B,IAAkC;IAElC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAEvE,OAAO,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAsB,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { SignedBeaconBlock, SignedBlindedBeaconBlock, phase0 } from "@lodestar/types";
|
|
2
|
+
import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
|
|
2
3
|
import { CachedBeaconStateAllForks } from "../types.js";
|
|
3
4
|
import { ISignatureSet } from "../util/signatureSets.js";
|
|
4
|
-
export declare function verifyProposerSignature(state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock | SignedBlindedBeaconBlock): boolean;
|
|
5
|
-
export declare function getBlockProposerSignatureSet(state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock | SignedBlindedBeaconBlock): ISignatureSet;
|
|
6
|
-
export declare function getBlockHeaderProposerSignatureSetByParentStateSlot(parentState: CachedBeaconStateAllForks, signedBlockHeader: phase0.SignedBeaconBlockHeader): ISignatureSet;
|
|
7
|
-
export declare function getBlockHeaderProposerSignatureSetByHeaderSlot(headState: CachedBeaconStateAllForks, signedBlockHeader: phase0.SignedBeaconBlockHeader): ISignatureSet;
|
|
5
|
+
export declare function verifyProposerSignature(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock | SignedBlindedBeaconBlock): boolean;
|
|
6
|
+
export declare function getBlockProposerSignatureSet(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock | SignedBlindedBeaconBlock): ISignatureSet;
|
|
7
|
+
export declare function getBlockHeaderProposerSignatureSetByParentStateSlot(index2pubkey: Index2PubkeyCache, parentState: CachedBeaconStateAllForks, signedBlockHeader: phase0.SignedBeaconBlockHeader): ISignatureSet;
|
|
8
|
+
export declare function getBlockHeaderProposerSignatureSetByHeaderSlot(index2pubkey: Index2PubkeyCache, headState: CachedBeaconStateAllForks, signedBlockHeader: phase0.SignedBeaconBlockHeader): ISignatureSet;
|
|
8
9
|
//# sourceMappingURL=proposer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposer.d.ts","sourceRoot":"","sources":["../../src/signatureSets/proposer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,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,WAAW,EAAE,yBAAyB,EACtC,iBAAiB,EAAE,MAAM,CAAC,uBAAuB,iBAGlD;AAED,wBAAgB,8CAA8C,CAC5D,YAAY,EAAE,iBAAiB,EAC/B,SAAS,EAAE,yBAAyB,EACpC,iBAAiB,EAAE,MAAM,CAAC,uBAAuB,iBAGlD"}
|
|
@@ -2,35 +2,35 @@ import { DOMAIN_BEACON_PROPOSER } from "@lodestar/params";
|
|
|
2
2
|
import { isBlindedBeaconBlock, ssz } from "@lodestar/types";
|
|
3
3
|
import { computeSigningRoot } from "../util/index.js";
|
|
4
4
|
import { SignatureSetType, verifySignatureSet } from "../util/signatureSets.js";
|
|
5
|
-
export function verifyProposerSignature(state, signedBlock) {
|
|
6
|
-
const signatureSet = getBlockProposerSignatureSet(state, signedBlock);
|
|
5
|
+
export function verifyProposerSignature(index2pubkey, state, signedBlock) {
|
|
6
|
+
const signatureSet = getBlockProposerSignatureSet(index2pubkey, state, signedBlock);
|
|
7
7
|
return verifySignatureSet(signatureSet);
|
|
8
8
|
}
|
|
9
|
-
export function getBlockProposerSignatureSet(state, signedBlock) {
|
|
10
|
-
const { config
|
|
9
|
+
export function getBlockProposerSignatureSet(index2pubkey, state, signedBlock) {
|
|
10
|
+
const { config } = state;
|
|
11
11
|
const domain = config.getDomain(state.slot, DOMAIN_BEACON_PROPOSER, signedBlock.message.slot);
|
|
12
12
|
const blockType = isBlindedBeaconBlock(signedBlock.message)
|
|
13
13
|
? config.getPostBellatrixForkTypes(signedBlock.message.slot).BlindedBeaconBlock
|
|
14
14
|
: config.getForkTypes(signedBlock.message.slot).BeaconBlock;
|
|
15
15
|
return {
|
|
16
16
|
type: SignatureSetType.single,
|
|
17
|
-
pubkey:
|
|
17
|
+
pubkey: index2pubkey[signedBlock.message.proposerIndex],
|
|
18
18
|
signingRoot: computeSigningRoot(blockType, signedBlock.message, domain),
|
|
19
19
|
signature: signedBlock.signature,
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
export function getBlockHeaderProposerSignatureSetByParentStateSlot(parentState, signedBlockHeader) {
|
|
23
|
-
return getBlockHeaderProposerSignatureSet(parentState, signedBlockHeader, parentState.slot);
|
|
22
|
+
export function getBlockHeaderProposerSignatureSetByParentStateSlot(index2pubkey, parentState, signedBlockHeader) {
|
|
23
|
+
return getBlockHeaderProposerSignatureSet(index2pubkey, parentState, signedBlockHeader, parentState.slot);
|
|
24
24
|
}
|
|
25
|
-
export function getBlockHeaderProposerSignatureSetByHeaderSlot(headState, signedBlockHeader) {
|
|
26
|
-
return getBlockHeaderProposerSignatureSet(headState, signedBlockHeader, signedBlockHeader.message.slot);
|
|
25
|
+
export function getBlockHeaderProposerSignatureSetByHeaderSlot(index2pubkey, headState, signedBlockHeader) {
|
|
26
|
+
return getBlockHeaderProposerSignatureSet(index2pubkey, headState, signedBlockHeader, signedBlockHeader.message.slot);
|
|
27
27
|
}
|
|
28
|
-
function getBlockHeaderProposerSignatureSet(state, signedBlockHeader, domainSlot) {
|
|
29
|
-
const { config
|
|
28
|
+
function getBlockHeaderProposerSignatureSet(index2pubkey, state, signedBlockHeader, domainSlot) {
|
|
29
|
+
const { config } = state;
|
|
30
30
|
const domain = config.getDomain(domainSlot, DOMAIN_BEACON_PROPOSER, signedBlockHeader.message.slot);
|
|
31
31
|
return {
|
|
32
32
|
type: SignatureSetType.single,
|
|
33
|
-
pubkey:
|
|
33
|
+
pubkey: index2pubkey[signedBlockHeader.message.proposerIndex],
|
|
34
34
|
signingRoot: computeSigningRoot(ssz.phase0.BeaconBlockHeader, signedBlockHeader.message, domain),
|
|
35
35
|
signature: signedBlockHeader.signature,
|
|
36
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposer.js","sourceRoot":"","sources":["../../src/signatureSets/proposer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAoD,oBAAoB,EAAU,GAAG,EAAC,MAAM,iBAAiB,CAAC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C;QACvE,SAAS,EAAE,WAAW,CAAC,SAAS;KACjC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mDAAmD,CACjE,YAA+B,EAC/B,WAAsC,EACtC,iBAAiD;IAEjD,OAAO,kCAAkC,CAAC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;AAC5G,CAAC;AAED,MAAM,UAAU,8CAA8C,CAC5D,YAA+B,EAC/B,SAAoC,EACpC,iBAAiD;IAEjD,OAAO,kCAAkC,CAAC,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACxH,CAAC;AAED,SAAS,kCAAkC,CACzC,YAA+B,EAC/B,KAAgC,EAChC,iBAAiD,EACjD,UAAgB;IAEhB,MAAM,EAAC,MAAM,EAAC,GAAG,KAAK,CAAC;IACvB,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,sBAAsB,EAAE,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpG,OAAO;QACL,IAAI,EAAE,gBAAgB,CAAC,MAAM;QAC7B,MAAM,EAAE,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,aAAa,CAAC;QAC7D,WAAW,EAAE,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC;QAChG,SAAS,EAAE,iBAAiB,CAAC,SAAS;KACvC,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SignedBeaconBlock, phase0 } from "@lodestar/types";
|
|
2
|
+
import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
|
|
2
3
|
import { CachedBeaconStateAllForks } from "../types.js";
|
|
3
4
|
import { ISignatureSet } from "../util/index.js";
|
|
4
5
|
/**
|
|
5
6
|
* Extract signatures to allow validating all block signatures at once
|
|
6
7
|
*/
|
|
7
|
-
export declare function getProposerSlashingSignatureSets(state: CachedBeaconStateAllForks, proposerSlashing: phase0.ProposerSlashing): ISignatureSet[];
|
|
8
|
-
export declare function getProposerSlashingsSignatureSets(state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock): ISignatureSet[];
|
|
8
|
+
export declare function getProposerSlashingSignatureSets(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, proposerSlashing: phase0.ProposerSlashing): ISignatureSet[];
|
|
9
|
+
export declare function getProposerSlashingsSignatureSets(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock): ISignatureSet[];
|
|
9
10
|
//# sourceMappingURL=proposerSlashings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposerSlashings.d.ts","sourceRoot":"","sources":["../../src/signatureSets/proposerSlashings.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAE,MAAM,EAAM,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAC,yBAAyB,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EAAC,aAAa,EAAuC,MAAM,kBAAkB,CAAC;AAErF;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,yBAAyB,EAChC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,GACxC,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"proposerSlashings.d.ts","sourceRoot":"","sources":["../../src/signatureSets/proposerSlashings.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAE,MAAM,EAAM,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAC,yBAAyB,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EAAC,aAAa,EAAuC,MAAM,kBAAkB,CAAC;AAErF;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,GACxC,aAAa,EAAE,CAmBjB;AAED,wBAAgB,iCAAiC,CAC/C,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,WAAW,EAAE,iBAAiB,GAC7B,aAAa,EAAE,CAIjB"}
|
|
@@ -4,9 +4,8 @@ import { SignatureSetType, computeSigningRoot } from "../util/index.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* Extract signatures to allow validating all block signatures at once
|
|
6
6
|
*/
|
|
7
|
-
export function getProposerSlashingSignatureSets(state, proposerSlashing) {
|
|
8
|
-
const
|
|
9
|
-
const pubkey = epochCtx.index2pubkey[proposerSlashing.signedHeader1.message.proposerIndex];
|
|
7
|
+
export function getProposerSlashingSignatureSets(index2pubkey, state, proposerSlashing) {
|
|
8
|
+
const pubkey = index2pubkey[proposerSlashing.signedHeader1.message.proposerIndex];
|
|
10
9
|
// In state transition, ProposerSlashing headers are only partially validated. Their slot could be higher than the
|
|
11
10
|
// clock and the slashing would still be valid. Must use bigint variants to hash correctly to all possible values
|
|
12
11
|
return [proposerSlashing.signedHeader1, proposerSlashing.signedHeader2].map((signedHeader) => {
|
|
@@ -19,7 +18,7 @@ export function getProposerSlashingSignatureSets(state, proposerSlashing) {
|
|
|
19
18
|
};
|
|
20
19
|
});
|
|
21
20
|
}
|
|
22
|
-
export function getProposerSlashingsSignatureSets(state, signedBlock) {
|
|
23
|
-
return signedBlock.message.body.proposerSlashings.flatMap((proposerSlashing) => getProposerSlashingSignatureSets(state, proposerSlashing));
|
|
21
|
+
export function getProposerSlashingsSignatureSets(index2pubkey, state, signedBlock) {
|
|
22
|
+
return signedBlock.message.body.proposerSlashings.flatMap((proposerSlashing) => getProposerSlashingSignatureSets(index2pubkey, state, proposerSlashing));
|
|
24
23
|
}
|
|
25
24
|
//# sourceMappingURL=proposerSlashings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposerSlashings.js","sourceRoot":"","sources":["../../src/signatureSets/proposerSlashings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAA4B,GAAG,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"proposerSlashings.js","sourceRoot":"","sources":["../../src/signatureSets/proposerSlashings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAA4B,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAG/D,OAAO,EAAgB,gBAAgB,EAAE,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAErF;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAC9C,YAA+B,EAC/B,KAAgC,EAChC,gBAAyC;IAEzC,MAAM,MAAM,GAAG,YAAY,CAAC,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAElF,kHAAkH;IAClH,iHAAiH;IACjH,OAAO,CAAC,gBAAgB,CAAC,aAAa,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,YAAY,EAAiB,EAAE;QAC1G,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CACnC,KAAK,CAAC,IAAI,EACV,sBAAsB,EACtB,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,IAAc,CAAC,CAC5C,CAAC;QAEF,OAAO;YACL,IAAI,EAAE,gBAAgB,CAAC,MAAM;YAC7B,MAAM;YACN,WAAW,EAAE,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,uBAAuB,EAAE,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC;YACjG,SAAS,EAAE,YAAY,CAAC,SAAS;SAClC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,YAA+B,EAC/B,KAAgC,EAChC,WAA8B;IAE9B,OAAO,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAC7E,gCAAgC,CAAC,YAAY,EAAE,KAAK,EAAE,gBAAgB,CAAC,CACxE,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BeaconBlock } from "@lodestar/types";
|
|
2
|
+
import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
|
|
2
3
|
import { CachedBeaconStateAllForks } from "../types.js";
|
|
3
4
|
import { ISignatureSet } from "../util/index.js";
|
|
4
|
-
export declare function verifyRandaoSignature(state: CachedBeaconStateAllForks, block: BeaconBlock): boolean;
|
|
5
|
+
export declare function verifyRandaoSignature(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, block: BeaconBlock): boolean;
|
|
5
6
|
/**
|
|
6
7
|
* Extract signatures to allow validating all block signatures at once
|
|
7
8
|
*/
|
|
8
|
-
export declare function getRandaoRevealSignatureSet(state: CachedBeaconStateAllForks, block: BeaconBlock): ISignatureSet;
|
|
9
|
+
export declare function getRandaoRevealSignatureSet(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, block: BeaconBlock): ISignatureSet;
|
|
9
10
|
//# sourceMappingURL=randao.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"randao.d.ts","sourceRoot":"","sources":["../../src/signatureSets/randao.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAM,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,yBAAyB,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,aAAa,EAKd,MAAM,kBAAkB,CAAC;AAE1B,wBAAgB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"randao.d.ts","sourceRoot":"","sources":["../../src/signatureSets/randao.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAM,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAC,yBAAyB,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,aAAa,EAKd,MAAM,kBAAkB,CAAC;AAE1B,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,KAAK,EAAE,WAAW,GACjB,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,KAAK,EAAE,WAAW,GACjB,aAAa,CAWf"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { DOMAIN_RANDAO } from "@lodestar/params";
|
|
2
2
|
import { ssz } from "@lodestar/types";
|
|
3
3
|
import { SignatureSetType, computeEpochAtSlot, computeSigningRoot, verifySignatureSet, } from "../util/index.js";
|
|
4
|
-
export function verifyRandaoSignature(state, block) {
|
|
5
|
-
return verifySignatureSet(getRandaoRevealSignatureSet(state, block));
|
|
4
|
+
export function verifyRandaoSignature(index2pubkey, state, block) {
|
|
5
|
+
return verifySignatureSet(getRandaoRevealSignatureSet(index2pubkey, state, block));
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Extract signatures to allow validating all block signatures at once
|
|
9
9
|
*/
|
|
10
|
-
export function getRandaoRevealSignatureSet(state, block) {
|
|
11
|
-
const { epochCtx } = state;
|
|
10
|
+
export function getRandaoRevealSignatureSet(index2pubkey, state, block) {
|
|
12
11
|
// should not get epoch from epochCtx
|
|
13
12
|
const epoch = computeEpochAtSlot(block.slot);
|
|
14
13
|
const domain = state.config.getDomain(state.slot, DOMAIN_RANDAO, block.slot);
|
|
15
14
|
return {
|
|
16
15
|
type: SignatureSetType.single,
|
|
17
|
-
pubkey:
|
|
16
|
+
pubkey: index2pubkey[block.proposerIndex],
|
|
18
17
|
signingRoot: computeSigningRoot(ssz.Epoch, epoch, domain),
|
|
19
18
|
signature: block.body.randaoReveal,
|
|
20
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"randao.js","sourceRoot":"","sources":["../../src/signatureSets/randao.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAc,GAAG,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"randao.js","sourceRoot":"","sources":["../../src/signatureSets/randao.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAc,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAGjD,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,UAAU,qBAAqB,CACnC,YAA+B,EAC/B,KAAgC,EAChC,KAAkB;IAElB,OAAO,kBAAkB,CAAC,2BAA2B,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AACrF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CACzC,YAA+B,EAC/B,KAAgC,EAChC,KAAkB;IAElB,qCAAqC;IACrC,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAE7E,OAAO;QACL,IAAI,EAAE,gBAAgB,CAAC,MAAM;QAC7B,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,aAAa,CAAC;QACzC,WAAW,EAAE,kBAAkB,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC;QACzD,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY;KACnC,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { SignedBeaconBlock, phase0 } from "@lodestar/types";
|
|
2
|
+
import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
|
|
2
3
|
import { CachedBeaconStateAllForks } from "../types.js";
|
|
3
4
|
import { ISignatureSet } from "../util/index.js";
|
|
4
|
-
export declare function verifyVoluntaryExitSignature(state: CachedBeaconStateAllForks, signedVoluntaryExit: phase0.SignedVoluntaryExit): boolean;
|
|
5
|
+
export declare function verifyVoluntaryExitSignature(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedVoluntaryExit: phase0.SignedVoluntaryExit): boolean;
|
|
5
6
|
/**
|
|
6
7
|
* Extract signatures to allow validating all block signatures at once
|
|
7
8
|
*/
|
|
8
|
-
export declare function getVoluntaryExitSignatureSet(state: CachedBeaconStateAllForks, signedVoluntaryExit: phase0.SignedVoluntaryExit): ISignatureSet;
|
|
9
|
-
export declare function getVoluntaryExitsSignatureSets(state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock): ISignatureSet[];
|
|
9
|
+
export declare function getVoluntaryExitSignatureSet(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedVoluntaryExit: phase0.SignedVoluntaryExit): ISignatureSet;
|
|
10
|
+
export declare function getVoluntaryExitsSignatureSets(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock): ISignatureSet[];
|
|
10
11
|
//# sourceMappingURL=voluntaryExits.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voluntaryExits.d.ts","sourceRoot":"","sources":["../../src/signatureSets/voluntaryExits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,MAAM,EAAM,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAC,yBAAyB,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,aAAa,EAKd,MAAM,kBAAkB,CAAC;AAE1B,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,yBAAyB,EAChC,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,GAC9C,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,yBAAyB,EAChC,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,GAC9C,aAAa,
|
|
1
|
+
{"version":3,"file":"voluntaryExits.d.ts","sourceRoot":"","sources":["../../src/signatureSets/voluntaryExits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,MAAM,EAAM,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAC,yBAAyB,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,aAAa,EAKd,MAAM,kBAAkB,CAAC;AAE1B,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,GAC9C,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,GAC9C,aAAa,CAUf;AAED,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,WAAW,EAAE,iBAAiB,GAC7B,aAAa,EAAE,CAIjB"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { ssz } from "@lodestar/types";
|
|
2
2
|
import { SignatureSetType, computeSigningRoot, computeStartSlotAtEpoch, verifySignatureSet, } from "../util/index.js";
|
|
3
|
-
export function verifyVoluntaryExitSignature(state, signedVoluntaryExit) {
|
|
4
|
-
return verifySignatureSet(getVoluntaryExitSignatureSet(state, signedVoluntaryExit));
|
|
3
|
+
export function verifyVoluntaryExitSignature(index2pubkey, state, signedVoluntaryExit) {
|
|
4
|
+
return verifySignatureSet(getVoluntaryExitSignatureSet(index2pubkey, state, signedVoluntaryExit));
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Extract signatures to allow validating all block signatures at once
|
|
8
8
|
*/
|
|
9
|
-
export function getVoluntaryExitSignatureSet(state, signedVoluntaryExit) {
|
|
10
|
-
const { epochCtx } = state;
|
|
9
|
+
export function getVoluntaryExitSignatureSet(index2pubkey, state, signedVoluntaryExit) {
|
|
11
10
|
const slot = computeStartSlotAtEpoch(signedVoluntaryExit.message.epoch);
|
|
12
11
|
const domain = state.config.getDomainForVoluntaryExit(state.slot, slot);
|
|
13
12
|
return {
|
|
14
13
|
type: SignatureSetType.single,
|
|
15
|
-
pubkey:
|
|
14
|
+
pubkey: index2pubkey[signedVoluntaryExit.message.validatorIndex],
|
|
16
15
|
signingRoot: computeSigningRoot(ssz.phase0.VoluntaryExit, signedVoluntaryExit.message, domain),
|
|
17
16
|
signature: signedVoluntaryExit.signature,
|
|
18
17
|
};
|
|
19
18
|
}
|
|
20
|
-
export function getVoluntaryExitsSignatureSets(state, signedBlock) {
|
|
21
|
-
return signedBlock.message.body.voluntaryExits.map((voluntaryExit) => getVoluntaryExitSignatureSet(state, voluntaryExit));
|
|
19
|
+
export function getVoluntaryExitsSignatureSets(index2pubkey, state, signedBlock) {
|
|
20
|
+
return signedBlock.message.body.voluntaryExits.map((voluntaryExit) => getVoluntaryExitSignatureSet(index2pubkey, state, voluntaryExit));
|
|
22
21
|
}
|
|
23
22
|
//# sourceMappingURL=voluntaryExits.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voluntaryExits.js","sourceRoot":"","sources":["../../src/signatureSets/voluntaryExits.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,GAAG,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"voluntaryExits.js","sourceRoot":"","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
1
|
+
import { ForkSeq } from "@lodestar/params";
|
|
1
2
|
import { CachedBeaconStateAllForks } from "../types.js";
|
|
2
3
|
export { upgradeStateToAltair } from "./upgradeStateToAltair.js";
|
|
3
4
|
export { upgradeStateToBellatrix } from "./upgradeStateToBellatrix.js";
|
|
@@ -9,5 +10,5 @@ export { upgradeStateToGloas } from "./upgradeStateToGloas.js";
|
|
|
9
10
|
/**
|
|
10
11
|
* Dial state to next slot. Common for all forks
|
|
11
12
|
*/
|
|
12
|
-
export declare function processSlot(state: CachedBeaconStateAllForks): void;
|
|
13
|
+
export declare function processSlot(fork: ForkSeq, state: CachedBeaconStateAllForks): void;
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/slot/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slot/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slot/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAA4B,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EAAC,yBAAyB,EAAyB,MAAM,aAAa,CAAC;AAE9E,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAC,qBAAqB,EAAC,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAC,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAC,qBAAqB,EAAC,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAC,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AAE7D;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,yBAAyB,GAAG,IAAI,CAuBjF"}
|