@lodestar/state-transition 1.39.0-dev.b37f2bd1bd → 1.39.0-dev.c151a164f2
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/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/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 +1 -1
- package/lib/block/processAttestationsAltair.js.map +1 -1
- package/lib/block/processAttesterSlashing.js +1 -1
- package/lib/block/processAttesterSlashing.js.map +1 -1
- package/lib/block/processProposerSlashing.d.ts.map +1 -1
- package/lib/block/processProposerSlashing.js +1 -1
- 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 -3
- package/lib/block/processSyncCommittee.js.map +1 -1
- package/lib/block/processVoluntaryExit.d.ts.map +1 -1
- package/lib/block/processVoluntaryExit.js +2 -1
- package/lib/block/processVoluntaryExit.js.map +1 -1
- package/lib/cache/epochCache.d.ts +0 -3
- package/lib/cache/epochCache.d.ts.map +1 -1
- package/lib/cache/epochCache.js +0 -3
- package/lib/cache/epochCache.js.map +1 -1
- package/lib/cache/stateCache.d.ts +1 -0
- package/lib/cache/stateCache.d.ts.map +1 -1
- package/lib/cache/stateCache.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 +2 -1
- package/lib/signatureSets/index.d.ts.map +1 -1
- package/lib/signatureSets/index.js +8 -8
- package/lib/signatureSets/index.js.map +1 -1
- package/lib/signatureSets/indexedAttestation.d.ts +5 -4
- package/lib/signatureSets/indexedAttestation.d.ts.map +1 -1
- package/lib/signatureSets/indexedAttestation.js +8 -8
- package/lib/signatureSets/indexedAttestation.js.map +1 -1
- package/lib/signatureSets/proposer.d.ts +3 -2
- package/lib/signatureSets/proposer.d.ts.map +1 -1
- package/lib/signatureSets/proposer.js +3 -4
- 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 -4
- 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 -4
- 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 -6
- package/lib/signatureSets/voluntaryExits.js.map +1 -1
- package/lib/stateTransition.d.ts.map +1 -1
- package/lib/stateTransition.js +2 -1
- package/lib/stateTransition.js.map +1 -1
- package/package.json +6 -6
- package/src/block/isValidIndexedAttestation.ts +5 -2
- package/src/block/processAttestationPhase0.ts +1 -0
- package/src/block/processAttestationsAltair.ts +7 -1
- package/src/block/processAttesterSlashing.ts +1 -1
- package/src/block/processProposerSlashing.ts +6 -1
- package/src/block/processRandao.ts +1 -1
- package/src/block/processSyncCommittee.ts +10 -2
- package/src/block/processVoluntaryExit.ts +4 -1
- package/src/cache/epochCache.ts +0 -3
- package/src/cache/stateCache.ts +1 -0
- package/src/signatureSets/attesterSlashings.ts +7 -3
- package/src/signatureSets/index.ts +9 -6
- package/src/signatureSets/indexedAttestation.ts +9 -3
- package/src/signatureSets/proposer.ts +4 -2
- package/src/signatureSets/proposerSlashings.ts +5 -6
- package/src/signatureSets/randao.ts +5 -2
- package/src/signatureSets/voluntaryExits.ts +7 -3
- package/src/stateTransition.ts +4 -1
|
@@ -2,16 +2,16 @@ 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(index2pubkey, state, signedBlock) {
|
|
6
|
-
return signedBlock.message.body.attesterSlashings.flatMap((attesterSlashing) => getAttesterSlashingSignatureSets(index2pubkey, state, attesterSlashing));
|
|
5
|
+
export function getAttesterSlashingsSignatureSets(config, index2pubkey, state, signedBlock) {
|
|
6
|
+
return signedBlock.message.body.attesterSlashings.flatMap((attesterSlashing) => getAttesterSlashingSignatureSets(config, index2pubkey, state, attesterSlashing));
|
|
7
7
|
}
|
|
8
8
|
/** Get signature sets from a single AttesterSlashing object */
|
|
9
|
-
export function getAttesterSlashingSignatureSets(index2pubkey, state, attesterSlashing) {
|
|
10
|
-
return [attesterSlashing.attestation1, attesterSlashing.attestation2].map((attestation) => getIndexedAttestationBigintSignatureSet(index2pubkey, state, attestation));
|
|
9
|
+
export function getAttesterSlashingSignatureSets(config, index2pubkey, state, attesterSlashing) {
|
|
10
|
+
return [attesterSlashing.attestation1, attesterSlashing.attestation2].map((attestation) => getIndexedAttestationBigintSignatureSet(config, index2pubkey, state, attestation));
|
|
11
11
|
}
|
|
12
|
-
export function getIndexedAttestationBigintSignatureSet(index2pubkey, state, indexedAttestation) {
|
|
12
|
+
export function getIndexedAttestationBigintSignatureSet(config, index2pubkey, state, indexedAttestation) {
|
|
13
13
|
const slot = computeStartSlotAtEpoch(Number(indexedAttestation.data.target.epoch));
|
|
14
|
-
const domain =
|
|
14
|
+
const domain = config.getDomain(state.slot, DOMAIN_BEACON_ATTESTER, slot);
|
|
15
15
|
return {
|
|
16
16
|
type: SignatureSetType.aggregate,
|
|
17
17
|
pubkeys: indexedAttestation.attestingIndices.map((i) => index2pubkey[i]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attesterSlashings.js","sourceRoot":"","sources":["../../src/signatureSets/attesterSlashings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"attesterSlashings.js","sourceRoot":"","sources":["../../src/signatureSets/attesterSlashings.ts"],"names":[],"mappings":"AACA,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,MAAoB,EACpB,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,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAChF,CAAC;AACJ,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,gCAAgC,CAC9C,MAAoB,EACpB,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,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,CAAC,CAClF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uCAAuC,CACrD,MAAoB,EACpB,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,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,sBAAsB,EAAE,IAAI,CAAC,CAAC;IAE1E,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,3 +1,4 @@
|
|
|
1
|
+
import { BeaconConfig } from "@lodestar/config";
|
|
1
2
|
import { IndexedAttestation, SignedBeaconBlock } from "@lodestar/types";
|
|
2
3
|
import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
|
|
3
4
|
import { CachedBeaconStateAllForks } from "../types.js";
|
|
@@ -14,7 +15,7 @@ export * from "./voluntaryExits.js";
|
|
|
14
15
|
* Includes all signatures on the block (except the deposit signatures) for verification.
|
|
15
16
|
* Deposits are not included because they can legally have invalid signatures.
|
|
16
17
|
*/
|
|
17
|
-
export declare function getBlockSignatureSets(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock, indexedAttestations: IndexedAttestation[], opts?: {
|
|
18
|
+
export declare function getBlockSignatureSets(config: BeaconConfig, index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock, indexedAttestations: IndexedAttestation[], opts?: {
|
|
18
19
|
/** Useful since block proposer signature is verified beforehand on gossip validation */
|
|
19
20
|
skipProposerSignature?: boolean;
|
|
20
21
|
}): ISignatureSet[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signatureSets/index.ts"],"names":[],"mappings":"
|
|
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,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,MAAM,EAAE,YAAY,EACpB,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,CA0CjB"}
|
|
@@ -19,22 +19,22 @@ export * from "./voluntaryExits.js";
|
|
|
19
19
|
* Includes all signatures on the block (except the deposit signatures) for verification.
|
|
20
20
|
* Deposits are not included because they can legally have invalid signatures.
|
|
21
21
|
*/
|
|
22
|
-
export function getBlockSignatureSets(index2pubkey, state, signedBlock, indexedAttestations, opts) {
|
|
22
|
+
export function getBlockSignatureSets(config, index2pubkey, state, signedBlock, indexedAttestations, opts) {
|
|
23
23
|
// fork based validations
|
|
24
24
|
const fork = state.config.getForkSeq(signedBlock.message.slot);
|
|
25
25
|
const signatureSets = [
|
|
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),
|
|
26
|
+
getRandaoRevealSignatureSet(config, index2pubkey, state, signedBlock.message),
|
|
27
|
+
...getProposerSlashingsSignatureSets(config, index2pubkey, state, signedBlock),
|
|
28
|
+
...getAttesterSlashingsSignatureSets(config, index2pubkey, state, signedBlock),
|
|
29
|
+
...getAttestationsSignatureSets(config, index2pubkey, state, signedBlock, indexedAttestations),
|
|
30
|
+
...getVoluntaryExitsSignatureSets(config, index2pubkey, state, signedBlock),
|
|
31
31
|
];
|
|
32
32
|
if (!opts?.skipProposerSignature) {
|
|
33
|
-
signatureSets.push(getBlockProposerSignatureSet(index2pubkey, state, signedBlock));
|
|
33
|
+
signatureSets.push(getBlockProposerSignatureSet(config, index2pubkey, state, signedBlock));
|
|
34
34
|
}
|
|
35
35
|
// Only after altair fork, validate tSyncCommitteeSignature
|
|
36
36
|
if (fork >= ForkSeq.altair) {
|
|
37
|
-
const syncCommitteeSignatureSet = getSyncCommitteeSignatureSet(index2pubkey, state, signedBlock.message);
|
|
37
|
+
const syncCommitteeSignatureSet = getSyncCommitteeSignatureSet(config, index2pubkey, state, signedBlock.message);
|
|
38
38
|
// There may be no participants in this syncCommitteeSignature, so it must not be validated
|
|
39
39
|
if (syncCommitteeSignatureSet) {
|
|
40
40
|
signatureSets.push(syncCommitteeSignatureSet);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/signatureSets/index.ts"],"names":[],"mappings":"
|
|
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;AAI9E,OAAO,EAAC,iCAAiC,EAAC,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAC,oCAAoC,EAAC,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAC,4BAA4B,EAAC,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAC,4BAA4B,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,iCAAiC,EAAC,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAC,2BAA2B,EAAC,MAAM,aAAa,CAAC;AACxD,OAAO,EAAC,8BAA8B,EAAC,MAAM,qBAAqB,CAAC;AAEnE,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,MAAM,UAAU,qBAAqB,CACnC,MAAoB,EACpB,YAA+B,EAC/B,KAAgC,EAChC,WAA8B,EAC9B,mBAAyC,EACzC,IAGC;IAED,yBAAyB;IACzB,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/D,MAAM,aAAa,GAAG;QACpB,2BAA2B,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC;QAC7E,GAAG,iCAAiC,CAAC,MAAM,EAAE,YAAY,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} from "../cache/pubkeyCache.js";
|
|
3
4
|
import { CachedBeaconStateAllForks } from "../types.js";
|
|
4
5
|
import { ISignatureSet } from "../util/index.js";
|
|
5
|
-
export declare function getAttestationDataSigningRoot(state: CachedBeaconStateAllForks, data: phase0.AttestationData): Uint8Array;
|
|
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[];
|
|
6
|
+
export declare function getAttestationDataSigningRoot(config: BeaconConfig, state: CachedBeaconStateAllForks, data: phase0.AttestationData): Uint8Array;
|
|
7
|
+
export declare function getAttestationWithIndicesSignatureSet(config: BeaconConfig, index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, attestation: Pick<phase0.Attestation, "data" | "signature">, attestingIndices: number[]): ISignatureSet;
|
|
8
|
+
export declare function getIndexedAttestationSignatureSet(config: BeaconConfig, index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, indexedAttestation: IndexedAttestation): ISignatureSet;
|
|
9
|
+
export declare function getAttestationsSignatureSets(config: BeaconConfig, index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock, indexedAttestations: IndexedAttestation[]): ISignatureSet[];
|
|
9
10
|
//# sourceMappingURL=indexedAttestation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexedAttestation.d.ts","sourceRoot":"","sources":["../../src/signatureSets/indexedAttestation.ts"],"names":[],"mappings":"
|
|
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,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,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,yBAAyB,EAChC,IAAI,EAAE,MAAM,CAAC,eAAe,GAC3B,UAAU,CAKZ;AAED,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,YAAY,EACpB,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,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,kBAAkB,EAAE,kBAAkB,GACrC,aAAa,CAQf;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,WAAW,EAAE,iBAAiB,EAC9B,mBAAmB,EAAE,kBAAkB,EAAE,GACxC,aAAa,EAAE,CASjB"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { DOMAIN_BEACON_ATTESTER } from "@lodestar/params";
|
|
2
2
|
import { ssz } from "@lodestar/types";
|
|
3
3
|
import { computeSigningRoot, computeStartSlotAtEpoch, createAggregateSignatureSetFromComponents, } from "../util/index.js";
|
|
4
|
-
export function getAttestationDataSigningRoot(state, data) {
|
|
4
|
+
export function getAttestationDataSigningRoot(config, state, data) {
|
|
5
5
|
const slot = computeStartSlotAtEpoch(data.target.epoch);
|
|
6
|
-
const domain =
|
|
6
|
+
const domain = config.getDomain(state.slot, DOMAIN_BEACON_ATTESTER, slot);
|
|
7
7
|
return computeSigningRoot(ssz.phase0.AttestationData, data, domain);
|
|
8
8
|
}
|
|
9
|
-
export function getAttestationWithIndicesSignatureSet(index2pubkey, state, attestation, attestingIndices) {
|
|
10
|
-
return createAggregateSignatureSetFromComponents(attestingIndices.map((i) => index2pubkey[i]), getAttestationDataSigningRoot(state, attestation.data), attestation.signature);
|
|
9
|
+
export function getAttestationWithIndicesSignatureSet(config, index2pubkey, state, attestation, attestingIndices) {
|
|
10
|
+
return createAggregateSignatureSetFromComponents(attestingIndices.map((i) => index2pubkey[i]), getAttestationDataSigningRoot(config, state, attestation.data), attestation.signature);
|
|
11
11
|
}
|
|
12
|
-
export function getIndexedAttestationSignatureSet(index2pubkey, state, indexedAttestation) {
|
|
13
|
-
return getAttestationWithIndicesSignatureSet(index2pubkey, state, indexedAttestation, indexedAttestation.attestingIndices);
|
|
12
|
+
export function getIndexedAttestationSignatureSet(config, index2pubkey, state, indexedAttestation) {
|
|
13
|
+
return getAttestationWithIndicesSignatureSet(config, index2pubkey, state, indexedAttestation, indexedAttestation.attestingIndices);
|
|
14
14
|
}
|
|
15
|
-
export function getAttestationsSignatureSets(index2pubkey, state, signedBlock, indexedAttestations) {
|
|
15
|
+
export function getAttestationsSignatureSets(config, 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(index2pubkey, state, indexedAttestation));
|
|
19
|
+
return indexedAttestations.map((indexedAttestation) => getIndexedAttestationSignatureSet(config, 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":"
|
|
1
|
+
{"version":3,"file":"indexedAttestation.js","sourceRoot":"","sources":["../../src/signatureSets/indexedAttestation.ts"],"names":[],"mappings":"AACA,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,MAAoB,EACpB,KAAgC,EAChC,IAA4B;IAE5B,MAAM,IAAI,GAAG,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,sBAAsB,EAAE,IAAI,CAAC,CAAC;IAE1E,OAAO,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,qCAAqC,CACnD,MAAoB,EACpB,YAA+B,EAC/B,KAAgC,EAChC,WAA2D,EAC3D,gBAA0B;IAE1B,OAAO,yCAAyC,CAC9C,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAC5C,6BAA6B,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,EAC9D,WAAW,CAAC,SAAS,CACtB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,MAAoB,EACpB,YAA+B,EAC/B,KAAgC,EAChC,kBAAsC;IAEtC,OAAO,qCAAqC,CAC1C,MAAM,EACN,YAAY,EACZ,KAAK,EACL,kBAAkB,EAClB,kBAAkB,CAAC,gBAAgB,CACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,MAAoB,EACpB,YAA+B,EAC/B,KAAgC,EAChC,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,OAAO,mBAAmB,CAAC,GAAG,CAAC,CAAC,kBAAkB,EAAE,EAAE,CACpD,iCAAiC,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,kBAAkB,CAAC,CACnF,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { BeaconConfig } from "@lodestar/config";
|
|
1
2
|
import { SignedBeaconBlock, SignedBlindedBeaconBlock, phase0 } from "@lodestar/types";
|
|
2
3
|
import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
|
|
3
4
|
import { CachedBeaconStateAllForks } from "../types.js";
|
|
4
5
|
import { ISignatureSet } from "../util/signatureSets.js";
|
|
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;
|
|
6
|
+
export declare function verifyProposerSignature(config: BeaconConfig, index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock | SignedBlindedBeaconBlock): boolean;
|
|
7
|
+
export declare function getBlockProposerSignatureSet(config: BeaconConfig, index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock | SignedBlindedBeaconBlock): ISignatureSet;
|
|
7
8
|
export declare function getBlockHeaderProposerSignatureSetByParentStateSlot(index2pubkey: Index2PubkeyCache, parentState: CachedBeaconStateAllForks, signedBlockHeader: phase0.SignedBeaconBlockHeader): ISignatureSet;
|
|
8
9
|
export declare function getBlockHeaderProposerSignatureSetByHeaderSlot(index2pubkey: Index2PubkeyCache, headState: CachedBeaconStateAllForks, signedBlockHeader: phase0.SignedBeaconBlockHeader): ISignatureSet;
|
|
9
10
|
//# sourceMappingURL=proposer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposer.d.ts","sourceRoot":"","sources":["../../src/signatureSets/proposer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proposer.d.ts","sourceRoot":"","sources":["../../src/signatureSets/proposer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,iBAAiB,EAAE,wBAAwB,EAA8B,MAAM,EAAM,MAAM,iBAAiB,CAAC;AACrH,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAC,yBAAyB,EAAC,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAC,aAAa,EAAuC,MAAM,0BAA0B,CAAC;AAE7F,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,WAAW,EAAE,iBAAiB,GAAG,wBAAwB,GACxD,OAAO,CAGT;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,WAAW,EAAE,iBAAiB,GAAG,wBAAwB,GACxD,aAAa,CAaf;AAED,wBAAgB,mDAAmD,CACjE,YAAY,EAAE,iBAAiB,EAC/B,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,12 +2,11 @@ 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(index2pubkey, state, signedBlock) {
|
|
6
|
-
const signatureSet = getBlockProposerSignatureSet(index2pubkey, state, signedBlock);
|
|
5
|
+
export function verifyProposerSignature(config, index2pubkey, state, signedBlock) {
|
|
6
|
+
const signatureSet = getBlockProposerSignatureSet(config, index2pubkey, state, signedBlock);
|
|
7
7
|
return verifySignatureSet(signatureSet);
|
|
8
8
|
}
|
|
9
|
-
export function getBlockProposerSignatureSet(index2pubkey, state, signedBlock) {
|
|
10
|
-
const { config } = state;
|
|
9
|
+
export function getBlockProposerSignatureSet(config, index2pubkey, state, signedBlock) {
|
|
11
10
|
const domain = config.getDomain(state.slot, DOMAIN_BEACON_PROPOSER, signedBlock.message.slot);
|
|
12
11
|
const blockType = isBlindedBeaconBlock(signedBlock.message)
|
|
13
12
|
? config.getPostBellatrixForkTypes(signedBlock.message.slot).BlindedBeaconBlock
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposer.js","sourceRoot":"","sources":["../../src/signatureSets/proposer.ts"],"names":[],"mappings":"
|
|
1
|
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AAW,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,3 +1,4 @@
|
|
|
1
|
+
import { BeaconConfig } from "@lodestar/config";
|
|
1
2
|
import { SignedBeaconBlock, phase0 } from "@lodestar/types";
|
|
2
3
|
import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
|
|
3
4
|
import { CachedBeaconStateAllForks } from "../types.js";
|
|
@@ -5,6 +6,6 @@ import { ISignatureSet } from "../util/index.js";
|
|
|
5
6
|
/**
|
|
6
7
|
* Extract signatures to allow validating all block signatures at once
|
|
7
8
|
*/
|
|
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
|
+
export declare function getProposerSlashingSignatureSets(config: BeaconConfig, index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, proposerSlashing: phase0.ProposerSlashing): ISignatureSet[];
|
|
10
|
+
export declare function getProposerSlashingsSignatureSets(config: BeaconConfig, index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock): ISignatureSet[];
|
|
10
11
|
//# sourceMappingURL=proposerSlashings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposerSlashings.d.ts","sourceRoot":"","sources":["../../src/signatureSets/proposerSlashings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proposerSlashings.d.ts","sourceRoot":"","sources":["../../src/signatureSets/proposerSlashings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,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,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,GACxC,aAAa,EAAE,CAejB;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,WAAW,EAAE,iBAAiB,GAC7B,aAAa,EAAE,CAIjB"}
|
|
@@ -4,12 +4,12 @@ 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(index2pubkey, state, proposerSlashing) {
|
|
7
|
+
export function getProposerSlashingSignatureSets(config, index2pubkey, state, proposerSlashing) {
|
|
8
8
|
const pubkey = index2pubkey[proposerSlashing.signedHeader1.message.proposerIndex];
|
|
9
9
|
// In state transition, ProposerSlashing headers are only partially validated. Their slot could be higher than the
|
|
10
10
|
// clock and the slashing would still be valid. Must use bigint variants to hash correctly to all possible values
|
|
11
11
|
return [proposerSlashing.signedHeader1, proposerSlashing.signedHeader2].map((signedHeader) => {
|
|
12
|
-
const domain =
|
|
12
|
+
const domain = config.getDomain(state.slot, DOMAIN_BEACON_PROPOSER, Number(signedHeader.message.slot));
|
|
13
13
|
return {
|
|
14
14
|
type: SignatureSetType.single,
|
|
15
15
|
pubkey,
|
|
@@ -18,7 +18,7 @@ export function getProposerSlashingSignatureSets(index2pubkey, state, proposerSl
|
|
|
18
18
|
};
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
export function getProposerSlashingsSignatureSets(index2pubkey, state, signedBlock) {
|
|
22
|
-
return signedBlock.message.body.proposerSlashings.flatMap((proposerSlashing) => getProposerSlashingSignatureSets(index2pubkey, state, proposerSlashing));
|
|
21
|
+
export function getProposerSlashingsSignatureSets(config, index2pubkey, state, signedBlock) {
|
|
22
|
+
return signedBlock.message.body.proposerSlashings.flatMap((proposerSlashing) => getProposerSlashingSignatureSets(config, index2pubkey, state, proposerSlashing));
|
|
23
23
|
}
|
|
24
24
|
//# sourceMappingURL=proposerSlashings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposerSlashings.js","sourceRoot":"","sources":["../../src/signatureSets/proposerSlashings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proposerSlashings.js","sourceRoot":"","sources":["../../src/signatureSets/proposerSlashings.ts"],"names":[],"mappings":"AACA,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,MAAoB,EACpB,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,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,sBAAsB,EAAE,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,IAAc,CAAC,CAAC,CAAC;QAEjH,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,MAAoB,EACpB,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,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAChF,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { BeaconConfig } from "@lodestar/config";
|
|
1
2
|
import { BeaconBlock } from "@lodestar/types";
|
|
2
3
|
import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
|
|
3
4
|
import { CachedBeaconStateAllForks } from "../types.js";
|
|
4
5
|
import { ISignatureSet } from "../util/index.js";
|
|
5
|
-
export declare function verifyRandaoSignature(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, block: BeaconBlock): boolean;
|
|
6
|
+
export declare function verifyRandaoSignature(config: BeaconConfig, index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, block: BeaconBlock): boolean;
|
|
6
7
|
/**
|
|
7
8
|
* Extract signatures to allow validating all block signatures at once
|
|
8
9
|
*/
|
|
9
|
-
export declare function getRandaoRevealSignatureSet(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, block: BeaconBlock): ISignatureSet;
|
|
10
|
+
export declare function getRandaoRevealSignatureSet(config: BeaconConfig, index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, block: BeaconBlock): ISignatureSet;
|
|
10
11
|
//# sourceMappingURL=randao.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"randao.d.ts","sourceRoot":"","sources":["../../src/signatureSets/randao.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"randao.d.ts","sourceRoot":"","sources":["../../src/signatureSets/randao.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,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,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,KAAK,EAAE,WAAW,GACjB,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,yBAAyB,EAChC,KAAK,EAAE,WAAW,GACjB,aAAa,CAWf"}
|
|
@@ -1,16 +1,16 @@
|
|
|
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(index2pubkey, state, block) {
|
|
5
|
-
return verifySignatureSet(getRandaoRevealSignatureSet(index2pubkey, state, block));
|
|
4
|
+
export function verifyRandaoSignature(config, index2pubkey, state, block) {
|
|
5
|
+
return verifySignatureSet(getRandaoRevealSignatureSet(config, 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(index2pubkey, state, block) {
|
|
10
|
+
export function getRandaoRevealSignatureSet(config, index2pubkey, state, block) {
|
|
11
11
|
// should not get epoch from epochCtx
|
|
12
12
|
const epoch = computeEpochAtSlot(block.slot);
|
|
13
|
-
const domain =
|
|
13
|
+
const domain = config.getDomain(state.slot, DOMAIN_RANDAO, block.slot);
|
|
14
14
|
return {
|
|
15
15
|
type: SignatureSetType.single,
|
|
16
16
|
pubkey: index2pubkey[block.proposerIndex],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"randao.js","sourceRoot":"","sources":["../../src/signatureSets/randao.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"randao.js","sourceRoot":"","sources":["../../src/signatureSets/randao.ts"],"names":[],"mappings":"AACA,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,MAAoB,EACpB,YAA+B,EAC/B,KAAgC,EAChC,KAAkB;IAElB,OAAO,kBAAkB,CAAC,2BAA2B,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CACzC,MAAoB,EACpB,YAA+B,EAC/B,KAAgC,EAChC,KAAkB;IAElB,qCAAqC;IACrC,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAEvE,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,11 +1,12 @@
|
|
|
1
|
+
import { BeaconConfig } from "@lodestar/config";
|
|
1
2
|
import { SignedBeaconBlock, phase0 } from "@lodestar/types";
|
|
2
3
|
import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
|
|
3
4
|
import { CachedBeaconStateAllForks } from "../types.js";
|
|
4
5
|
import { ISignatureSet } from "../util/index.js";
|
|
5
|
-
export declare function verifyVoluntaryExitSignature(index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedVoluntaryExit: phase0.SignedVoluntaryExit): boolean;
|
|
6
|
+
export declare function verifyVoluntaryExitSignature(config: BeaconConfig, index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedVoluntaryExit: phase0.SignedVoluntaryExit): boolean;
|
|
6
7
|
/**
|
|
7
8
|
* Extract signatures to allow validating all block signatures at once
|
|
8
9
|
*/
|
|
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
|
+
export declare function getVoluntaryExitSignatureSet(config: BeaconConfig, index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedVoluntaryExit: phase0.SignedVoluntaryExit): ISignatureSet;
|
|
11
|
+
export declare function getVoluntaryExitsSignatureSets(config: BeaconConfig, index2pubkey: Index2PubkeyCache, state: CachedBeaconStateAllForks, signedBlock: SignedBeaconBlock): ISignatureSet[];
|
|
11
12
|
//# 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,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAC,yBAAyB,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,aAAa,EAKd,MAAM,kB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yB,EAChC,WAAW,EAAE,iBAAiB,GAC7B,aAAa,EAAE,CAIjB"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ssz } from "@lodestar/types";
|
|
2
2
|
import { SignatureSetType, computeSigningRoot, computeStartSlotAtEpoch, verifySignatureSet, } from "../util/index.js";
|
|
3
|
-
export function verifyVoluntaryExitSignature(index2pubkey, state, signedVoluntaryExit) {
|
|
4
|
-
return verifySignatureSet(getVoluntaryExitSignatureSet(index2pubkey, state, signedVoluntaryExit));
|
|
3
|
+
export function verifyVoluntaryExitSignature(config, index2pubkey, state, signedVoluntaryExit) {
|
|
4
|
+
return verifySignatureSet(getVoluntaryExitSignatureSet(config, 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(index2pubkey, state, signedVoluntaryExit) {
|
|
9
|
+
export function getVoluntaryExitSignatureSet(config, index2pubkey, state, signedVoluntaryExit) {
|
|
10
10
|
const slot = computeStartSlotAtEpoch(signedVoluntaryExit.message.epoch);
|
|
11
|
-
const domain =
|
|
11
|
+
const domain = config.getDomainForVoluntaryExit(state.slot, slot);
|
|
12
12
|
return {
|
|
13
13
|
type: SignatureSetType.single,
|
|
14
14
|
pubkey: index2pubkey[signedVoluntaryExit.message.validatorIndex],
|
|
@@ -16,7 +16,7 @@ export function getVoluntaryExitSignatureSet(index2pubkey, state, signedVoluntar
|
|
|
16
16
|
signature: signedVoluntaryExit.signature,
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
export function getVoluntaryExitsSignatureSets(index2pubkey, state, signedBlock) {
|
|
20
|
-
return signedBlock.message.body.voluntaryExits.map((voluntaryExit) => getVoluntaryExitSignatureSet(index2pubkey, state, voluntaryExit));
|
|
19
|
+
export function getVoluntaryExitsSignatureSets(config, index2pubkey, state, signedBlock) {
|
|
20
|
+
return signedBlock.message.body.voluntaryExits.map((voluntaryExit) => getVoluntaryExitSignatureSet(config, index2pubkey, state, voluntaryExit));
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=voluntaryExits.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voluntaryExits.js","sourceRoot":"","sources":["../../src/signatureSets/voluntaryExits.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"voluntaryExits.js","sourceRoot":"","sources":["../../src/signatureSets/voluntaryExits.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAG/D,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,UAAU,4BAA4B,CAC1C,MAAoB,EACpB,YAA+B,EAC/B,KAAgC,EAChC,mBAA+C;IAE/C,OAAO,kBAAkB,CAAC,4BAA4B,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAC5G,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAC1C,MAAoB,EACpB,YAA+B,EAC/B,KAAgC,EAChC,mBAA+C;IAE/C,MAAM,IAAI,GAAG,uBAAuB,CAAC,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxE,MAAM,MAAM,GAAG,MAAM,CAAC,yBAAyB,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAElE,OAAO;QACL,IAAI,EAAE,gBAAgB,CAAC,MAAM;QAC7B,MAAM,EAAE,YAAY,CAAC,mBAAmB,CAAC,OAAO,CAAC,cAAc,CAAC;QAChE,WAAW,EAAE,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,aAAa,EAAE,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC;QAC9F,SAAS,EAAE,mBAAmB,CAAC,SAAS;KACzC,CAAC;AACJ,C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BAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEJ,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,CAAC,EAAE,4BAA4B,GAAG,IAAI,CAAC;IAC9C,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC5C,CAAC;AAEF,UAAU,gBAAgB;IACxB,yBAAyB,CACvB,YAAY,EAAE,KAAK,EACnB,eAAe,EAAE,MAAM,EAAE,EACzB,KAAK,EAAE,MAAM,EAAE,EACf,iBAAiB,EAAE,OAAO,EAAE,EAC5B,iBAAiB,EAAE,OAAO,EAAE,EAC5B,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,IAAI,CAAC;CACT;AAED;;GAEG;AACH,oBAAY,gBAAgB;IAC1B,eAAe,oBAAoB;IACnC,YAAY,iBAAiB;CAC9B;AAED;;GAEG;AACH,oBAAY,uBAAuB;IACjC,eAAe,qBAAqB;IACpC,eAAe,qBAAqB;IACpC,eAAe,sBAAsB;IACrC,gBAAgB,uBAAuB;IACvC,UAAU,gBAAgB;IAC1B,mBAAmB,2BAA2B;CAC/C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,yBAAyB,EAChC,WAAW,EAAE,iBAAiB,GAAG,wBAAwB,EACzD,OAAO,GAAE,mBAIR,EACD,EAAC,OAAO,EAAE,gBAAgB,EAAC,GAAE,sBAA2B,GACvD,yBAAyB,CAiE3B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,yBAAyB,EAChC,IAAI,EAAE,IAAI,EACV,wBAAwB,CAAC,EAAE,wBAAwB,GAAG;IAAC,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAAC,EACnF,EAAC,OAAO,EAAE,gBAAgB,EAAC,GAAE,sBAA2B,GACvD,yBAAyB,CAiB3B"}
|
package/lib/stateTransition.js
CHANGED
|
@@ -52,7 +52,8 @@ export function stateTransition(state, signedBlock, options = {
|
|
|
52
52
|
// Includes state upgrades
|
|
53
53
|
postState = processSlotsWithTransientCache(postState, blockSlot, options, { metrics, validatorMonitor });
|
|
54
54
|
// Verify proposer signature only
|
|
55
|
-
if (verifyProposer &&
|
|
55
|
+
if (verifyProposer &&
|
|
56
|
+
!verifyProposerSignature(postState.config, postState.epochCtx.index2pubkey, postState, signedBlock)) {
|
|
56
57
|
throw new Error("Invalid block signature");
|
|
57
58
|
}
|
|
58
59
|
// Process block
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stateTransition.js","sourceRoot":"","sources":["../src/stateTransition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAA2D,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAC9F,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAoB,sBAAsB,EAAE,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAC1G,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAiD,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AACnH,OAAO,EAAC,mBAAmB,EAAE,YAAY,EAAC,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAA+B,kBAAkB,EAAE,mBAAmB,EAAC,MAAM,cAAc,CAAC;AACnG,OAAO,EAAC,uBAAuB,EAAC,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,kBAAkB,EAAC,MAAM,8BAA8B,CAAC;AAWhE,OAAO,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AA8BnD;;GAEG;AACH,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,uDAAmC,CAAA;IACnC,iDAA6B,CAA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D,IAAI,UAAU,KAAK,MAAM,CAAC,eAAe,EAAE,CAAC;gBAC1C,SAAS,GAAG,kBAAkB,CAAC,SAAqC,CAA8B,CAAC;YACrG,CAAC;YACD,IAAI,UAAU,KAAK,MAAM,CAAC,gBAAgB,EAAE,CAAC;gBAC3C,SAAS,GAAG,mBAAmB,CAAC,SAAkC,CAA8B,CAAC;YACnG,CAAC;YAED,CAAC;gBACC,MAAM,KAAK,GAAG,OAAO,EAAE,uBAAuB,CAAC,UAAU,CAAC,EAAC,IAAI,EAAE,mBAAmB,CAAC,iBAAiB,EAAC,CAAC,CAAC;gBACzG,uHAAuH;gBACvH,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;gBAChD,KAAK,EAAE,EAAE,CAAC;YACZ,CAAC;YAED,+GAA+G;YAC/G,0GAA0G;YAC1G,CAAC;gBACC,MAAM,KAAK,GAAG,OAAO,EAAE,yBAAyB,CAAC,UAAU,EAAE,CAAC;gBAC9D,SAAS,CAAC,MAAM,EAAE,CAAC;gBACnB,KAAK,EAAE,EAAE,CAAC;YACZ,CAAC;YAED,oIAAoI;YACpI,oBAAoB,EAAE,EAAE,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,IAAI,EAAE,CAAC;QACnB,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.39.0-dev.
|
|
14
|
+
"version": "1.39.0-dev.c151a164f2",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
"@chainsafe/pubkey-index-map": "^3.0.0",
|
|
63
63
|
"@chainsafe/ssz": "^1.2.2",
|
|
64
64
|
"@chainsafe/swap-or-not-shuffle": "^1.2.1",
|
|
65
|
-
"@lodestar/config": "1.39.0-dev.
|
|
66
|
-
"@lodestar/params": "1.39.0-dev.
|
|
67
|
-
"@lodestar/types": "1.39.0-dev.
|
|
68
|
-
"@lodestar/utils": "1.39.0-dev.
|
|
65
|
+
"@lodestar/config": "1.39.0-dev.c151a164f2",
|
|
66
|
+
"@lodestar/params": "1.39.0-dev.c151a164f2",
|
|
67
|
+
"@lodestar/types": "1.39.0-dev.c151a164f2",
|
|
68
|
+
"@lodestar/utils": "1.39.0-dev.c151a164f2",
|
|
69
69
|
"bigint-buffer": "^1.1.5"
|
|
70
70
|
},
|
|
71
71
|
"keywords": [
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"beacon",
|
|
75
75
|
"blockchain"
|
|
76
76
|
],
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "754677d50463b1608d590c4d1b10076b3000655c"
|
|
78
78
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {BeaconConfig} from "@lodestar/config";
|
|
1
2
|
import {ForkSeq, MAX_COMMITTEES_PER_SLOT, MAX_VALIDATORS_PER_COMMITTEE} from "@lodestar/params";
|
|
2
3
|
import {IndexedAttestation, IndexedAttestationBigint} from "@lodestar/types";
|
|
3
4
|
import {Index2PubkeyCache} from "../cache/pubkeyCache.js";
|
|
@@ -9,6 +10,7 @@ import {verifySignatureSet} from "../util/index.js";
|
|
|
9
10
|
* Check if `indexedAttestation` has sorted and unique indices and a valid aggregate signature.
|
|
10
11
|
*/
|
|
11
12
|
export function isValidIndexedAttestation(
|
|
13
|
+
config: BeaconConfig,
|
|
12
14
|
index2pubkey: Index2PubkeyCache,
|
|
13
15
|
state: CachedBeaconStateAllForks,
|
|
14
16
|
indexedAttestation: IndexedAttestation,
|
|
@@ -19,12 +21,13 @@ export function isValidIndexedAttestation(
|
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
if (verifySignature) {
|
|
22
|
-
return verifySignatureSet(getIndexedAttestationSignatureSet(index2pubkey, state, indexedAttestation));
|
|
24
|
+
return verifySignatureSet(getIndexedAttestationSignatureSet(config, index2pubkey, state, indexedAttestation));
|
|
23
25
|
}
|
|
24
26
|
return true;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
export function isValidIndexedAttestationBigint(
|
|
30
|
+
config: BeaconConfig,
|
|
28
31
|
index2pubkey: Index2PubkeyCache,
|
|
29
32
|
state: CachedBeaconStateAllForks,
|
|
30
33
|
indexedAttestation: IndexedAttestationBigint,
|
|
@@ -35,7 +38,7 @@ export function isValidIndexedAttestationBigint(
|
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
if (verifySignature) {
|
|
38
|
-
return verifySignatureSet(getIndexedAttestationBigintSignatureSet(index2pubkey, state, indexedAttestation));
|
|
41
|
+
return verifySignatureSet(getIndexedAttestationBigintSignatureSet(config, index2pubkey, state, indexedAttestation));
|
|
39
42
|
}
|
|
40
43
|
return true;
|
|
41
44
|
}
|
|
@@ -64,7 +64,13 @@ export function processAttestationsAltair(
|
|
|
64
64
|
// TODO: Why should we verify an indexed attestation that we just created? If it's just for the signature
|
|
65
65
|
// we can verify only that and nothing else.
|
|
66
66
|
if (verifySignature) {
|
|
67
|
-
const sigSet = getAttestationWithIndicesSignatureSet(
|
|
67
|
+
const sigSet = getAttestationWithIndicesSignatureSet(
|
|
68
|
+
state.config,
|
|
69
|
+
epochCtx.index2pubkey,
|
|
70
|
+
state,
|
|
71
|
+
attestation,
|
|
72
|
+
attestingIndices
|
|
73
|
+
);
|
|
68
74
|
if (!verifySignatureSet(sigSet)) {
|
|
69
75
|
throw new Error("Attestation signature is not valid");
|
|
70
76
|
}
|
|
@@ -55,7 +55,7 @@ export function assertValidAttesterSlashing(
|
|
|
55
55
|
// be higher than the clock and the slashing would still be valid. Same applies to attestation data index, which
|
|
56
56
|
// can be any arbitrary value. Must use bigint variants to hash correctly to all possible values
|
|
57
57
|
for (const [i, attestation] of [attestation1, attestation2].entries()) {
|
|
58
|
-
if (!isValidIndexedAttestationBigint(index2pubkey, state, attestation, verifySignatures)) {
|
|
58
|
+
if (!isValidIndexedAttestationBigint(state.config, index2pubkey, state, attestation, verifySignatures)) {
|
|
59
59
|
throw new Error(`AttesterSlashing attestation${i} is invalid`);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -77,7 +77,12 @@ export function assertValidProposerSlashing(
|
|
|
77
77
|
|
|
78
78
|
// verify signatures
|
|
79
79
|
if (verifySignatures) {
|
|
80
|
-
const signatureSets = getProposerSlashingSignatureSets(
|
|
80
|
+
const signatureSets = getProposerSlashingSignatureSets(
|
|
81
|
+
state.config,
|
|
82
|
+
state.epochCtx.index2pubkey,
|
|
83
|
+
state,
|
|
84
|
+
proposerSlashing
|
|
85
|
+
);
|
|
81
86
|
for (let i = 0; i < signatureSets.length; i++) {
|
|
82
87
|
if (!verifySignatureSet(signatureSets[i])) {
|
|
83
88
|
throw new Error(`ProposerSlashing header${i + 1} signature invalid`);
|
|
@@ -17,7 +17,7 @@ export function processRandao(state: CachedBeaconStateAllForks, block: BeaconBlo
|
|
|
17
17
|
const randaoReveal = block.body.randaoReveal;
|
|
18
18
|
|
|
19
19
|
// verify RANDAO reveal
|
|
20
|
-
if (verifySignature && !verifyRandaoSignature(epochCtx.index2pubkey, state, block)) {
|
|
20
|
+
if (verifySignature && !verifyRandaoSignature(state.config, epochCtx.index2pubkey, state, block)) {
|
|
21
21
|
throw new Error("RANDAO reveal is an invalid signature");
|
|
22
22
|
}
|
|
23
23
|
|