@lodestar/state-transition 1.40.0-dev.4acd3ce568 → 1.40.0-dev.4e6ba60398

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.
Files changed (123) hide show
  1. package/lib/block/isValidIndexedAttestation.d.ts.map +1 -1
  2. package/lib/block/isValidIndexedAttestation.js +2 -2
  3. package/lib/block/isValidIndexedAttestation.js.map +1 -1
  4. package/lib/block/isValidIndexedPayloadAttestation.d.ts.map +1 -1
  5. package/lib/block/isValidIndexedPayloadAttestation.js +1 -1
  6. package/lib/block/isValidIndexedPayloadAttestation.js.map +1 -1
  7. package/lib/block/processAttestationsAltair.d.ts.map +1 -1
  8. package/lib/block/processAttestationsAltair.js +2 -2
  9. package/lib/block/processAttestationsAltair.js.map +1 -1
  10. package/lib/block/processConsolidationRequest.d.ts +1 -2
  11. package/lib/block/processConsolidationRequest.d.ts.map +1 -1
  12. package/lib/block/processConsolidationRequest.js +2 -2
  13. package/lib/block/processConsolidationRequest.js.map +1 -1
  14. package/lib/block/processExecutionPayloadBid.d.ts.map +1 -1
  15. package/lib/block/processExecutionPayloadBid.js +5 -5
  16. package/lib/block/processExecutionPayloadBid.js.map +1 -1
  17. package/lib/block/processExecutionPayloadEnvelope.js +1 -1
  18. package/lib/block/processExecutionPayloadEnvelope.js.map +1 -1
  19. package/lib/block/processOperations.js +1 -1
  20. package/lib/block/processOperations.js.map +1 -1
  21. package/lib/block/processProposerSlashing.js +2 -2
  22. package/lib/block/processProposerSlashing.js.map +1 -1
  23. package/lib/block/processSyncCommittee.d.ts +1 -2
  24. package/lib/block/processSyncCommittee.d.ts.map +1 -1
  25. package/lib/block/processSyncCommittee.js +5 -5
  26. package/lib/block/processSyncCommittee.js.map +1 -1
  27. package/lib/block/processVoluntaryExit.js +2 -2
  28. package/lib/block/processVoluntaryExit.js.map +1 -1
  29. package/lib/block/processWithdrawalRequest.js +1 -1
  30. package/lib/block/processWithdrawalRequest.js.map +1 -1
  31. package/lib/block/processWithdrawals.d.ts.map +1 -1
  32. package/lib/block/processWithdrawals.js +6 -0
  33. package/lib/block/processWithdrawals.js.map +1 -1
  34. package/lib/signatureSets/attesterSlashings.d.ts +3 -4
  35. package/lib/signatureSets/attesterSlashings.d.ts.map +1 -1
  36. package/lib/signatureSets/attesterSlashings.js +6 -6
  37. package/lib/signatureSets/attesterSlashings.js.map +1 -1
  38. package/lib/signatureSets/blsToExecutionChange.d.ts +3 -3
  39. package/lib/signatureSets/blsToExecutionChange.d.ts.map +1 -1
  40. package/lib/signatureSets/blsToExecutionChange.js.map +1 -1
  41. package/lib/signatureSets/executionPayloadBid.d.ts +4 -0
  42. package/lib/signatureSets/executionPayloadBid.d.ts.map +1 -0
  43. package/lib/signatureSets/executionPayloadBid.js +8 -0
  44. package/lib/signatureSets/executionPayloadBid.js.map +1 -0
  45. package/lib/signatureSets/executionPayloadEnvelope.d.ts +4 -0
  46. package/lib/signatureSets/executionPayloadEnvelope.d.ts.map +1 -0
  47. package/lib/signatureSets/executionPayloadEnvelope.js +8 -0
  48. package/lib/signatureSets/executionPayloadEnvelope.js.map +1 -0
  49. package/lib/signatureSets/index.d.ts +3 -2
  50. package/lib/signatureSets/index.d.ts.map +1 -1
  51. package/lib/signatureSets/index.js +10 -8
  52. package/lib/signatureSets/index.js.map +1 -1
  53. package/lib/signatureSets/indexedAttestation.d.ts +3 -4
  54. package/lib/signatureSets/indexedAttestation.d.ts.map +1 -1
  55. package/lib/signatureSets/indexedAttestation.js +6 -6
  56. package/lib/signatureSets/indexedAttestation.js.map +1 -1
  57. package/lib/signatureSets/indexedPayloadAttestation.d.ts +5 -4
  58. package/lib/signatureSets/indexedPayloadAttestation.d.ts.map +1 -1
  59. package/lib/signatureSets/indexedPayloadAttestation.js +3 -3
  60. package/lib/signatureSets/indexedPayloadAttestation.js.map +1 -1
  61. package/lib/signatureSets/proposer.d.ts +3 -3
  62. package/lib/signatureSets/proposer.d.ts.map +1 -1
  63. package/lib/signatureSets/proposer.js +12 -12
  64. package/lib/signatureSets/proposer.js.map +1 -1
  65. package/lib/signatureSets/proposerSlashings.d.ts +2 -3
  66. package/lib/signatureSets/proposerSlashings.d.ts.map +1 -1
  67. package/lib/signatureSets/proposerSlashings.js +6 -6
  68. package/lib/signatureSets/proposerSlashings.js.map +1 -1
  69. package/lib/signatureSets/randao.d.ts +1 -1
  70. package/lib/signatureSets/randao.d.ts.map +1 -1
  71. package/lib/signatureSets/randao.js +4 -4
  72. package/lib/signatureSets/randao.js.map +1 -1
  73. package/lib/signatureSets/voluntaryExits.d.ts +2 -2
  74. package/lib/signatureSets/voluntaryExits.d.ts.map +1 -1
  75. package/lib/signatureSets/voluntaryExits.js +6 -6
  76. package/lib/signatureSets/voluntaryExits.js.map +1 -1
  77. package/lib/util/gloas.d.ts +10 -9
  78. package/lib/util/gloas.d.ts.map +1 -1
  79. package/lib/util/gloas.js +1 -3
  80. package/lib/util/gloas.js.map +1 -1
  81. package/lib/util/index.d.ts +1 -0
  82. package/lib/util/index.d.ts.map +1 -1
  83. package/lib/util/index.js +1 -0
  84. package/lib/util/index.js.map +1 -1
  85. package/lib/util/interop.js +1 -1
  86. package/lib/util/interop.js.map +1 -1
  87. package/lib/util/signatureSets.d.ts +38 -5
  88. package/lib/util/signatureSets.d.ts.map +1 -1
  89. package/lib/util/signatureSets.js +48 -6
  90. package/lib/util/signatureSets.js.map +1 -1
  91. package/lib/util/validator.d.ts +1 -1
  92. package/lib/util/validator.d.ts.map +1 -1
  93. package/lib/util/validator.js +1 -14
  94. package/lib/util/validator.js.map +1 -1
  95. package/package.json +8 -8
  96. package/src/block/isValidIndexedAttestation.ts +3 -2
  97. package/src/block/isValidIndexedPayloadAttestation.ts +4 -1
  98. package/src/block/processAttestationsAltair.ts +2 -8
  99. package/src/block/processConsolidationRequest.ts +2 -3
  100. package/src/block/processExecutionPayloadBid.ts +5 -5
  101. package/src/block/processExecutionPayloadEnvelope.ts +1 -1
  102. package/src/block/processOperations.ts +1 -1
  103. package/src/block/processProposerSlashing.ts +2 -2
  104. package/src/block/processSyncCommittee.ts +3 -6
  105. package/src/block/processVoluntaryExit.ts +2 -2
  106. package/src/block/processWithdrawalRequest.ts +1 -1
  107. package/src/block/processWithdrawals.ts +6 -0
  108. package/src/signatureSets/attesterSlashings.ts +3 -7
  109. package/src/signatureSets/blsToExecutionChange.ts +3 -3
  110. package/src/signatureSets/executionPayloadBid.ts +14 -0
  111. package/src/signatureSets/executionPayloadEnvelope.ts +13 -0
  112. package/src/signatureSets/index.ts +8 -9
  113. package/src/signatureSets/indexedAttestation.ts +2 -7
  114. package/src/signatureSets/indexedPayloadAttestation.ts +9 -7
  115. package/src/signatureSets/proposer.ts +8 -12
  116. package/src/signatureSets/proposerSlashings.ts +4 -7
  117. package/src/signatureSets/randao.ts +4 -8
  118. package/src/signatureSets/voluntaryExits.ts +5 -10
  119. package/src/util/gloas.ts +19 -14
  120. package/src/util/index.ts +1 -0
  121. package/src/util/interop.ts +1 -1
  122. package/src/util/signatureSets.ts +84 -8
  123. package/src/util/validator.ts +0 -15
@@ -2,22 +2,22 @@ import { DOMAIN_BEACON_ATTESTER } from "@lodestar/params";
2
2
  import { ssz } from "@lodestar/types";
3
3
  import { SignatureSetType, computeSigningRoot, computeStartSlotAtEpoch } from "../util/index.js";
4
4
  /** Get signature sets from all AttesterSlashing objects in a block */
5
- export function getAttesterSlashingsSignatureSets(config, index2pubkey, signedBlock) {
5
+ export function getAttesterSlashingsSignatureSets(config, signedBlock) {
6
6
  // the getDomain() api requires the state slot as 1st param, however it's the same to block.slot in state-transition
7
7
  // and the same epoch when we verify blocks in batch in beacon-node. So we can safely use block.slot here.
8
8
  const blockSlot = signedBlock.message.slot;
9
- return signedBlock.message.body.attesterSlashings.flatMap((attesterSlashing) => getAttesterSlashingSignatureSets(config, index2pubkey, blockSlot, attesterSlashing));
9
+ return signedBlock.message.body.attesterSlashings.flatMap((attesterSlashing) => getAttesterSlashingSignatureSets(config, blockSlot, attesterSlashing));
10
10
  }
11
11
  /** Get signature sets from a single AttesterSlashing object */
12
- export function getAttesterSlashingSignatureSets(config, index2pubkey, stateSlot, attesterSlashing) {
13
- return [attesterSlashing.attestation1, attesterSlashing.attestation2].map((attestation) => getIndexedAttestationBigintSignatureSet(config, index2pubkey, stateSlot, attestation));
12
+ export function getAttesterSlashingSignatureSets(config, stateSlot, attesterSlashing) {
13
+ return [attesterSlashing.attestation1, attesterSlashing.attestation2].map((attestation) => getIndexedAttestationBigintSignatureSet(config, stateSlot, attestation));
14
14
  }
15
- export function getIndexedAttestationBigintSignatureSet(config, index2pubkey, stateSlot, indexedAttestation) {
15
+ export function getIndexedAttestationBigintSignatureSet(config, stateSlot, indexedAttestation) {
16
16
  const messageSlot = computeStartSlotAtEpoch(Number(indexedAttestation.data.target.epoch));
17
17
  const domain = config.getDomain(stateSlot, DOMAIN_BEACON_ATTESTER, messageSlot);
18
18
  return {
19
19
  type: SignatureSetType.aggregate,
20
- pubkeys: indexedAttestation.attestingIndices.map((i) => index2pubkey[i]),
20
+ indices: indexedAttestation.attestingIndices.map((i) => Number(i)),
21
21
  signingRoot: computeSigningRoot(ssz.phase0.AttestationDataBigint, indexedAttestation.data, domain),
22
22
  signature: indexedAttestation.signature,
23
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"attesterSlashings.js","sourceRoot":"","sources":["../../src/signatureSets/attesterSlashings.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAsE,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAEzG,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,WAA8B;IAE9B,oHAAoH;IACpH,0GAA0G;IAC1G,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;IA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,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,10 +1,10 @@
1
1
  import { BeaconConfig } from "@lodestar/config";
2
2
  import { capella } from "@lodestar/types";
3
- import { ISignatureSet } from "../util/index.js";
3
+ import { SingleSignatureSet } from "../util/index.js";
4
4
  export declare function verifyBlsToExecutionChangeSignature(config: BeaconConfig, signedBLSToExecutionChange: capella.SignedBLSToExecutionChange): boolean;
5
5
  /**
6
6
  * Extract signatures to allow validating all block signatures at once
7
7
  */
8
- export declare function getBlsToExecutionChangeSignatureSet(config: BeaconConfig, signedBLSToExecutionChange: capella.SignedBLSToExecutionChange): ISignatureSet;
9
- export declare function getBlsToExecutionChangeSignatureSets(config: BeaconConfig, signedBlock: capella.SignedBeaconBlock): ISignatureSet[];
8
+ export declare function getBlsToExecutionChangeSignatureSet(config: BeaconConfig, signedBLSToExecutionChange: capella.SignedBLSToExecutionChange): SingleSignatureSet;
9
+ export declare function getBlsToExecutionChangeSignatureSets(config: BeaconConfig, signedBlock: capella.SignedBeaconBlock): SingleSignatureSet[];
10
10
  //# sourceMappingURL=blsToExecutionChange.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"blsToExecutionChange.d.ts","sourceRoot":"","sources":["../../src/signatureSets/blsToExecutionChange.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,OAAO,EAAM,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,aAAa,EAA2D,MAAM,kBAAkB,CAAC;AAEzG,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,YAAY,EACpB,0BAA0B,EAAE,OAAO,CAAC,0BAA0B,GAC7D,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,YAAY,EACpB,0BAA0B,EAAE,OAAO,CAAC,0BAA0B,GAC7D,aAAa,CAaf;AAED,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,OAAO,CAAC,iBAAiB,GACrC,aAAa,EAAE,CAIjB"}
1
+ {"version":3,"file":"blsToExecutionChange.d.ts","sourceRoot":"","sources":["../../src/signatureSets/blsToExecutionChange.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,OAAO,EAAM,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAmB,kBAAkB,EAAyC,MAAM,kBAAkB,CAAC;AAE9G,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,YAAY,EACpB,0BAA0B,EAAE,OAAO,CAAC,0BAA0B,GAC7D,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,YAAY,EACpB,0BAA0B,EAAE,OAAO,CAAC,0BAA0B,GAC7D,kBAAkB,CAapB;AAED,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,OAAO,CAAC,iBAAiB,GACrC,kBAAkB,EAAE,CAItB"}
@@ -1 +1 @@
1
- {"version":3,"file":"blsToExecutionChange.js","sourceRoot":"","sources":["../../src/signatureSets/blsToExecutionChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAC,8BAA8B,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAU,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAgB,gBAAgB,EAAE,kBAAkB,EAAE,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAEzG,MAAM,UAAU,mCAAmC,CACjD,MAAoB,EACpB,0BAA8D;IAE9D,OAAO,kBAAkB,CAAC,mCAAmC,CAA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A8D;IAE9D,OAAO,kBAAkB,CAAC,mCAAmC,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC,CAAC;AACrG,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mCAAmC,CACjD,MAAoB,EACpB,0BAA8D;IAE9D,4CAA4C;IAC5C,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC,aAAa,EAAE,8BAA8B,CAAC,CAAC;IAErF,OAAO;QACL,IAAI,EAAE,gBAAgB,CAAC,MAAM;QAC7B,+FAA+F;QAC/F,yDAAyD;QACzD,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,0BAA0B,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC;QACnF,WAAW,EAAE,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,oBAAoB,EAAE,0BAA0B,CAAC,OAAO,EAAE,MAAM,CAAC;QAC7G,SAAS,EAAE,0BAA0B,CAAC,SAAS;KAChD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oCAAoC,CAClD,MAAoB,EACpB,WAAsC;IAEtC,OAAO,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,oBAAoB,EAAE,EAAE,CACjF,mCAAmC,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAClE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { BeaconConfig } from "@lodestar/config";
2
+ import { Slot, gloas } from "@lodestar/types";
3
+ export declare function getExecutionPayloadBidSigningRoot(config: BeaconConfig, stateSlot: Slot, bid: gloas.ExecutionPayloadBid): Uint8Array;
4
+ //# sourceMappingURL=executionPayloadBid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executionPayloadBid.d.ts","sourceRoot":"","sources":["../../src/signatureSets/executionPayloadBid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,IAAI,EAAE,KAAK,EAAM,MAAM,iBAAiB,CAAC;AAGjD,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,IAAI,EACf,GAAG,EAAE,KAAK,CAAC,mBAAmB,GAC7B,UAAU,CAIZ"}
@@ -0,0 +1,8 @@
1
+ import { DOMAIN_BEACON_BUILDER } from "@lodestar/params";
2
+ import { ssz } from "@lodestar/types";
3
+ import { computeSigningRoot } from "../util/index.js";
4
+ export function getExecutionPayloadBidSigningRoot(config, stateSlot, bid) {
5
+ const domain = config.getDomain(stateSlot, DOMAIN_BEACON_BUILDER);
6
+ return computeSigningRoot(ssz.gloas.ExecutionPayloadBid, bid, domain);
7
+ }
8
+ //# sourceMappingURL=executionPayloadBid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executionPayloadBid.js","sourceRoot":"","sources":["../../src/signatureSets/executionPayloadBid.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAc,GAAG,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAEpD,MAAM,UAAU,iCAAiC,CAC/C,MAAoB,EACpB,SAAe,EACf,GAA8B;IAE9B,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC;IAElE,OAAO,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AACxE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { BeaconConfig } from "@lodestar/config";
2
+ import { gloas } from "@lodestar/types";
3
+ export declare function getExecutionPayloadEnvelopeSigningRoot(config: BeaconConfig, envelope: gloas.ExecutionPayloadEnvelope): Uint8Array;
4
+ //# sourceMappingURL=executionPayloadEnvelope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executionPayloadEnvelope.d.ts","sourceRoot":"","sources":["../../src/signatureSets/executionPayloadEnvelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,KAAK,EAAM,MAAM,iBAAiB,CAAC;AAG3C,wBAAgB,sCAAsC,CACpD,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,KAAK,CAAC,wBAAwB,GACvC,UAAU,CAIZ"}
@@ -0,0 +1,8 @@
1
+ import { DOMAIN_BEACON_BUILDER } from "@lodestar/params";
2
+ import { ssz } from "@lodestar/types";
3
+ import { computeSigningRoot } from "../util/index.js";
4
+ export function getExecutionPayloadEnvelopeSigningRoot(config, envelope) {
5
+ const domain = config.getDomain(envelope.slot, DOMAIN_BEACON_BUILDER);
6
+ return computeSigningRoot(ssz.gloas.ExecutionPayloadEnvelope, envelope, domain);
7
+ }
8
+ //# sourceMappingURL=executionPayloadEnvelope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executionPayloadEnvelope.js","sourceRoot":"","sources":["../../src/signatureSets/executionPayloadEnvelope.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAQ,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAEpD,MAAM,UAAU,sCAAsC,CACpD,MAAoB,EACpB,QAAwC;IAExC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;IAEtE,OAAO,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,wBAAwB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAClF,CAAC"}
@@ -1,10 +1,11 @@
1
1
  import { BeaconConfig } from "@lodestar/config";
2
2
  import { IndexedAttestation, SignedBeaconBlock } from "@lodestar/types";
3
- import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
4
3
  import { SyncCommitteeCache } from "../cache/syncCommitteeCache.js";
5
4
  import { ISignatureSet } from "../util/index.js";
6
5
  export * from "./attesterSlashings.js";
7
6
  export * from "./blsToExecutionChange.js";
7
+ export * from "./executionPayloadBid.js";
8
+ export * from "./executionPayloadEnvelope.js";
8
9
  export * from "./indexedAttestation.js";
9
10
  export * from "./indexedPayloadAttestation.js";
10
11
  export * from "./proposer.js";
@@ -15,7 +16,7 @@ export * from "./voluntaryExits.js";
15
16
  * Includes all signatures on the block (except the deposit signatures) for verification.
16
17
  * Deposits are not included because they can legally have invalid signatures.
17
18
  */
18
- export declare function getBlockSignatureSets(config: BeaconConfig, index2pubkey: Index2PubkeyCache, currentSyncCommitteeIndexed: SyncCommitteeCache, signedBlock: SignedBeaconBlock, indexedAttestations: IndexedAttestation[], opts?: {
19
+ export declare function getBlockSignatureSets(config: BeaconConfig, currentSyncCommitteeIndexed: SyncCommitteeCache, signedBlock: SignedBeaconBlock, indexedAttestations: IndexedAttestation[], opts?: {
19
20
  /** Useful since block proposer signature is verified beforehand on gossip validation */
20
21
  skipProposerSignature?: boolean;
21
22
  }): ISignatureSet[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signatureSets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAkB,MAAM,iBAAiB,CAAC;AAEvF,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAS/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,gC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B"}
@@ -9,6 +9,8 @@ import { getRandaoRevealSignatureSet } from "./randao.js";
9
9
  import { getVoluntaryExitsSignatureSets } from "./voluntaryExits.js";
10
10
  export * from "./attesterSlashings.js";
11
11
  export * from "./blsToExecutionChange.js";
12
+ export * from "./executionPayloadBid.js";
13
+ export * from "./executionPayloadEnvelope.js";
12
14
  export * from "./indexedAttestation.js";
13
15
  export * from "./indexedPayloadAttestation.js";
14
16
  export * from "./proposer.js";
@@ -19,22 +21,22 @@ export * from "./voluntaryExits.js";
19
21
  * Includes all signatures on the block (except the deposit signatures) for verification.
20
22
  * Deposits are not included because they can legally have invalid signatures.
21
23
  */
22
- export function getBlockSignatureSets(config, index2pubkey, currentSyncCommitteeIndexed, signedBlock, indexedAttestations, opts) {
24
+ export function getBlockSignatureSets(config, currentSyncCommitteeIndexed, signedBlock, indexedAttestations, opts) {
23
25
  // fork based validations
24
26
  const fork = config.getForkSeq(signedBlock.message.slot);
25
27
  const signatureSets = [
26
- getRandaoRevealSignatureSet(config, index2pubkey, signedBlock.message),
27
- ...getProposerSlashingsSignatureSets(config, index2pubkey, signedBlock),
28
- ...getAttesterSlashingsSignatureSets(config, index2pubkey, signedBlock),
29
- ...getAttestationsSignatureSets(config, index2pubkey, signedBlock, indexedAttestations),
30
- ...getVoluntaryExitsSignatureSets(config, index2pubkey, signedBlock),
28
+ getRandaoRevealSignatureSet(config, signedBlock.message),
29
+ ...getProposerSlashingsSignatureSets(config, signedBlock),
30
+ ...getAttesterSlashingsSignatureSets(config, signedBlock),
31
+ ...getAttestationsSignatureSets(config, signedBlock, indexedAttestations),
32
+ ...getVoluntaryExitsSignatureSets(config, signedBlock),
31
33
  ];
32
34
  if (!opts?.skipProposerSignature) {
33
- signatureSets.push(getBlockProposerSignatureSet(config, index2pubkey, signedBlock));
35
+ signatureSets.push(getBlockProposerSignatureSet(config, signedBlock));
34
36
  }
35
37
  // Only after altair fork, validate tSyncCommitteeSignature
36
38
  if (fork >= ForkSeq.altair) {
37
- const syncCommitteeSignatureSet = getSyncCommitteeSignatureSet(config, index2pubkey, currentSyncCommitteeIndexed, signedBlock.message);
39
+ const syncCommitteeSignatureSet = getSyncCommitteeSignatureSet(config, currentSyncCommitteeIndexed, signedBlock.message);
38
40
  // There may be no participants in this syncCommitteeSignature, so it must not be validated
39
41
  if (syncCommitteeSignatureSet) {
40
42
  signatureSets.push(syncCommitteeSignatureSet);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/signatureSets/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAC,4BAA4B,EAAC,MAAM,kCAAkC,CAAC;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,2BAA+C,EAC/C,WAA8B,EAC9B,mBAAyC,EACzC,IAGC;IAED,yBAAyB;IACzB,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,IAA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AAE,WAAW,CAAC;KACvD,CAAC;IAEF,IAAI,CAAC,IAAI,EAAE,qBAAqB,EAAE,CAAC;QACjC,aAAa,CAAC,IAAI,CAAC,4BAA4B,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IACxE,CAAC;IAED,2DAA2D;IAC3D,IAAI,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QAC3B,MAAM,yBAAyB,GAAG,4BAA4B,CAC5D,MAAM,EACN,2BAA2B,EAC1B,WAAwC,CAAC,OAAO,CAClD,CAAC;QACF,2FAA2F;QAC3F,IAAI,yBAAyB,EAAE,CAAC;YAC9B,aAAa,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAED,0BAA0B;IAC1B,IAAI,IAAI,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QAC5B,MAAM,iCAAiC,GAAG,oCAAoC,CAC5E,MAAM,EACN,WAAwC,CACzC,CAAC;QACF,IAAI,iCAAiC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjD,aAAa,CAAC,IAAI,CAAC,GAAG,iCAAiC,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC"}
@@ -1,9 +1,8 @@
1
1
  import { BeaconConfig } from "@lodestar/config";
2
2
  import { IndexedAttestation, SignedBeaconBlock, Slot, phase0 } from "@lodestar/types";
3
- import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
4
3
  import { ISignatureSet } from "../util/index.js";
5
4
  export declare function getAttestationDataSigningRoot(config: BeaconConfig, stateSlot: Slot, data: phase0.AttestationData): Uint8Array;
6
- export declare function getAttestationWithIndicesSignatureSet(config: BeaconConfig, index2pubkey: Index2PubkeyCache, stateSlot: Slot, attestation: Pick<phase0.Attestation, "data" | "signature">, attestingIndices: number[]): ISignatureSet;
7
- export declare function getIndexedAttestationSignatureSet(config: BeaconConfig, index2pubkey: Index2PubkeyCache, stateSlot: Slot, indexedAttestation: IndexedAttestation): ISignatureSet;
8
- export declare function getAttestationsSignatureSets(config: BeaconConfig, index2pubkey: Index2PubkeyCache, signedBlock: SignedBeaconBlock, indexedAttestations: IndexedAttestation[]): ISignatureSet[];
5
+ export declare function getAttestationWithIndicesSignatureSet(config: BeaconConfig, stateSlot: Slot, attestation: Pick<phase0.Attestation, "data" | "signature">, attestingIndices: number[]): ISignatureSet;
6
+ export declare function getIndexedAttestationSignatureSet(config: BeaconConfig, stateSlot: Slot, indexedAttestation: IndexedAttestation): ISignatureSet;
7
+ export declare function getAttestationsSignatureSets(config: BeaconConfig, signedBlock: SignedBeaconBlock, indexedAttestations: IndexedAttestation[]): ISignatureSet[];
9
8
  //# sourceMappingURL=indexedAttestation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"indexedAttestation.d.ts","sourceRoot":"","sources":["../../src/signatureSets/indexedAttestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAM,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,aAAa,EAId,MAAM,kBAAkB,CAAC;AAE1B,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,IAAI,EACf,IAAI,EAAE,MAAM,CAAC,eAAe,GAC3B,UAAU,CAKZ;AAED,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,SAAS,EAAE,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CAAC,EAC3D,gBAAgB,EAAE,MAAM,EAAE,GACzB,aAAa,CAMf;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,SAAS,EAAE,IAAI,EACf,kBAAkB,EAAE,kBAAkB,GACrC,aAAa,CAQf;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,WAAW,EAAE,iBAAiB,EAC9B,mBAAmB,EAAE,kBAAkB,EAAE,GACxC,aAAa,EAAE,CAYjB"}
1
+ {"version":3,"file":"indexedAttestation.d.ts","sourceRoot":"","sources":["../../src/signatureSets/indexedAttestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAM,MAAM,iBAAiB,CAAC;AACzF,OAAO,EACL,aAAa,EAId,MAAM,kBAAkB,CAAC;AAE1B,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,IAAI,EACf,IAAI,EAAE,MAAM,CAAC,eAAe,GAC3B,UAAU,CAKZ;AAED,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CAAC,EAC3D,gBAAgB,EAAE,MAAM,EAAE,GACzB,aAAa,CAMf;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,IAAI,EACf,kBAAkB,EAAE,kBAAkB,GACrC,aAAa,CAOf;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,iBAAiB,EAC9B,mBAAmB,EAAE,kBAAkB,EAAE,GACxC,aAAa,EAAE,CAYjB"}
@@ -6,19 +6,19 @@ export function getAttestationDataSigningRoot(config, stateSlot, data) {
6
6
  const domain = config.getDomain(stateSlot, DOMAIN_BEACON_ATTESTER, messageSlot);
7
7
  return computeSigningRoot(ssz.phase0.AttestationData, data, domain);
8
8
  }
9
- export function getAttestationWithIndicesSignatureSet(config, index2pubkey, stateSlot, attestation, attestingIndices) {
10
- return createAggregateSignatureSetFromComponents(attestingIndices.map((i) => index2pubkey[i]), getAttestationDataSigningRoot(config, stateSlot, attestation.data), attestation.signature);
9
+ export function getAttestationWithIndicesSignatureSet(config, stateSlot, attestation, attestingIndices) {
10
+ return createAggregateSignatureSetFromComponents(attestingIndices, getAttestationDataSigningRoot(config, stateSlot, attestation.data), attestation.signature);
11
11
  }
12
- export function getIndexedAttestationSignatureSet(config, index2pubkey, stateSlot, indexedAttestation) {
13
- return getAttestationWithIndicesSignatureSet(config, index2pubkey, stateSlot, indexedAttestation, indexedAttestation.attestingIndices);
12
+ export function getIndexedAttestationSignatureSet(config, stateSlot, indexedAttestation) {
13
+ return getAttestationWithIndicesSignatureSet(config, stateSlot, indexedAttestation, indexedAttestation.attestingIndices);
14
14
  }
15
- export function getAttestationsSignatureSets(config, index2pubkey, signedBlock, indexedAttestations) {
15
+ export function getAttestationsSignatureSets(config, signedBlock, indexedAttestations) {
16
16
  if (indexedAttestations.length !== signedBlock.message.body.attestations.length) {
17
17
  throw Error(`Indexed attestations length mismatch: got ${indexedAttestations.length}, expected ${signedBlock.message.body.attestations.length}`);
18
18
  }
19
19
  // the getDomain() api requires the state slot as 1st param, however it's the same to block.slot in state-transition
20
20
  // and the same epoch when we verify blocks in batch in beacon-node. So we can safely use block.slot here.
21
21
  const blockSlot = signedBlock.message.slot;
22
- return indexedAttestations.map((indexedAttestation) => getIndexedAttestationSignatureSet(config, index2pubkey, blockSlot, indexedAttestation));
22
+ return indexedAttestations.map((indexedAttestation) => getIndexedAttestationSignatureSet(config, blockSlot, indexedAttestation));
23
23
  }
24
24
  //# sourceMappingURL=indexedAttestation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"indexedAttestation.js","sourceRoot":"","sources":["../../src/signatureSets/indexedAttestation.ts"],"names":[],"mappings":"AACA,OAA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S,CACtB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,MAAoB,EACpB,SAAe,EACf,kBAAsC;IAEtC,OAAO,qCAAqC,CAC1C,MAAM,EACN,SAAS,EACT,kBAAkB,EAClB,kBAAkB,CAAC,gBAAgB,CACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,MAAoB,EACpB,WAA8B,EAC9B,mBAAyC;IAEzC,IAAI,mBAAmB,CAAC,MAAM,KAAK,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;QAChF,MAAM,KAAK,CACT,6CAA6C,mBAAmB,CAAC,MAAM,cAAc,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CACpI,CAAC;IACJ,CAAC;IACD,oHAAoH;IACpH,0GAA0G;IAC1G,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3C,OAAO,mBAAmB,CAAC,GAAG,CAAC,CAAC,kBAAkB,EAAE,EAAE,CACpD,iCAAiC,CAAC,MAAM,EAAE,SAAS,EAAE,kBAAkB,CAAC,CACzE,CAAC;AACJ,CAAC"}
@@ -1,6 +1,7 @@
1
- import { gloas } from "@lodestar/types";
2
- import { CachedBeaconStateGloas } from "../types.ts";
3
- import { ISignatureSet } from "../util/index.ts";
1
+ import { BeaconConfig } from "@lodestar/config";
2
+ import { Slot, gloas } from "@lodestar/types";
3
+ import { CachedBeaconStateGloas } from "../types.js";
4
+ import { ISignatureSet } from "../util/index.js";
4
5
  export declare function getIndexedPayloadAttestationSignatureSet(state: CachedBeaconStateGloas, indexedPayloadAttestation: gloas.IndexedPayloadAttestation): ISignatureSet;
5
- export declare function getPayloadAttestationDataSigningRoot(state: CachedBeaconStateGloas, data: gloas.PayloadAttestationData): Uint8Array;
6
+ export declare function getPayloadAttestationDataSigningRoot(config: BeaconConfig, stateSlot: Slot, data: gloas.PayloadAttestationData): Uint8Array;
6
7
  //# sourceMappingURL=indexedPayloadAttestation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"indexedPayloadAttestation.d.ts","sourceRoot":"","sources":["../../src/signatureSets/indexedPayloadAttestation.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"indexedPayloadAttestation.d.ts","sourceRoot":"","sources":["../../src/signatureSets/indexedPayloadAttestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,IAAI,EAAE,KAAK,EAAM,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,sBAAsB,EAAC,MAAM,aAAa,CAAC;AACnD,OAAO,EAAC,aAAa,EAAgE,MAAM,kBAAkB,CAAC;AAE9G,wBAAgB,wCAAwC,CACtD,KAAK,EAAE,sBAAsB,EAC7B,yBAAyB,EAAE,KAAK,CAAC,yBAAyB,GACzD,aAAa,CAMf;AAED,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,IAAI,EACf,IAAI,EAAE,KAAK,CAAC,sBAAsB,GACjC,UAAU,CAIZ"}
@@ -2,10 +2,10 @@ import { DOMAIN_PTC_ATTESTER } from "@lodestar/params";
2
2
  import { ssz } from "@lodestar/types";
3
3
  import { computeSigningRoot, createAggregateSignatureSetFromComponents } from "../util/index.js";
4
4
  export function getIndexedPayloadAttestationSignatureSet(state, indexedPayloadAttestation) {
5
- return createAggregateSignatureSetFromComponents(indexedPayloadAttestation.attestingIndices.map((i) => state.epochCtx.index2pubkey[i]), getPayloadAttestationDataSigningRoot(state, indexedPayloadAttestation.data), indexedPayloadAttestation.signature);
5
+ return createAggregateSignatureSetFromComponents(indexedPayloadAttestation.attestingIndices, getPayloadAttestationDataSigningRoot(state.config, state.slot, indexedPayloadAttestation.data), indexedPayloadAttestation.signature);
6
6
  }
7
- export function getPayloadAttestationDataSigningRoot(state, data) {
8
- const domain = state.config.getDomain(state.slot, DOMAIN_PTC_ATTESTER);
7
+ export function getPayloadAttestationDataSigningRoot(config, stateSlot, data) {
8
+ const domain = config.getDomain(stateSlot, DOMAIN_PTC_ATTESTER);
9
9
  return computeSigningRoot(ssz.gloas.PayloadAttestationData, data, domain);
10
10
  }
11
11
  //# sourceMappingURL=indexedPayloadAttestation.js.map
@@ -1 +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
+ {"version":3,"file":"indexedPayloadAttestation.js","sourceRoot":"","sources":["../../src/signatureSets/indexedPayloadAttestation.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAc,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAgB,kBAAkB,EAAE,yCAAyC,EAAC,MAAM,kBAAkB,CAAC;AAE9G,MAAM,UAAU,wCAAwC,CACtD,KAA6B,EAC7B,yBAA0D;IAE1D,OAAO,yCAAyC,CAC9C,yBAAyB,CAAC,gBAAgB,EAC1C,oCAAoC,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,yBAAyB,CAAC,IAAI,CAAC,EAC9F,yBAAyB,CAAC,SAAS,CACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oCAAoC,CAClD,MAAoB,EACpB,SAAe,EACf,IAAkC;IAElC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;IAEhE,OAAO,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAsB,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC5E,CAAC"}
@@ -3,7 +3,7 @@ import { SignedBeaconBlock, SignedBlindedBeaconBlock, Slot, phase0 } from "@lode
3
3
  import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
4
4
  import { ISignatureSet } from "../util/signatureSets.js";
5
5
  export declare function verifyProposerSignature(config: BeaconConfig, index2pubkey: Index2PubkeyCache, signedBlock: SignedBeaconBlock | SignedBlindedBeaconBlock): boolean;
6
- export declare function getBlockProposerSignatureSet(config: BeaconConfig, index2pubkey: Index2PubkeyCache, signedBlock: SignedBeaconBlock | SignedBlindedBeaconBlock): ISignatureSet;
7
- export declare function getBlockHeaderProposerSignatureSetByParentStateSlot(config: BeaconConfig, index2pubkey: Index2PubkeyCache, parentStateSlot: Slot, signedBlockHeader: phase0.SignedBeaconBlockHeader): ISignatureSet;
8
- export declare function getBlockHeaderProposerSignatureSetByHeaderSlot(config: BeaconConfig, index2pubkey: Index2PubkeyCache, signedBlockHeader: phase0.SignedBeaconBlockHeader): ISignatureSet;
6
+ export declare function getBlockProposerSignatureSet(config: BeaconConfig, signedBlock: SignedBeaconBlock | SignedBlindedBeaconBlock): ISignatureSet;
7
+ export declare function getBlockHeaderProposerSignatureSetByParentStateSlot(config: BeaconConfig, parentStateSlot: Slot, signedBlockHeader: phase0.SignedBeaconBlockHeader): ISignatureSet;
8
+ export declare function getBlockHeaderProposerSignatureSetByHeaderSlot(config: BeaconConfig, signedBlockHeader: phase0.SignedBeaconBlockHeader): ISignatureSet;
9
9
  //# sourceMappingURL=proposer.d.ts.map
@@ -1 +1 @@
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,EAAE,IAAI,EAAwB,MAAM,EAAM,MAAM,iBAAiB,CAAC;AACrH,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAC,aAAa,EAAuC,MAAM,0BAA0B,CAAC;AAE7F,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,WAAW,EAAE,iBAAiB,GAAG,wBAAwB,GACxD,OAAO,CAGT;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,WAAW,EAAE,iBAAiB,GAAG,wBAAwB,GACxD,aAAa,CAgBf;AAED,wBAAgB,mDAAmD,CACjE,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,eAAe,EAAE,IAAI,EACrB,iBAAiB,EAAE,MAAM,CAAC,uBAAuB,iBAGlD;AAED,wBAAgB,8CAA8C,CAC5D,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,iBAAiB,EAAE,MAAM,CAAC,uBAAuB,iBAGlD"}
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,EAAE,IAAI,EAAwB,MAAM,EAAM,MAAM,iBAAiB,CAAC;AACrH,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAC,aAAa,EAAuC,MAAM,0BAA0B,CAAC;AAE7F,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,WAAW,EAAE,iBAAiB,GAAG,wBAAwB,GACxD,OAAO,CAGT;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,iBAAiB,GAAG,wBAAwB,GACxD,aAAa,CAgBf;AAED,wBAAgB,mDAAmD,CACjE,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,IAAI,EACrB,iBAAiB,EAAE,MAAM,CAAC,uBAAuB,iBAGlD;AAED,wBAAgB,8CAA8C,CAC5D,MAAM,EAAE,YAAY,EACpB,iBAAiB,EAAE,MAAM,CAAC,uBAAuB,iBAGlD"}
@@ -3,10 +3,10 @@ import { isBlindedBeaconBlock, ssz } from "@lodestar/types";
3
3
  import { computeSigningRoot } from "../util/index.js";
4
4
  import { SignatureSetType, verifySignatureSet } from "../util/signatureSets.js";
5
5
  export function verifyProposerSignature(config, index2pubkey, signedBlock) {
6
- const signatureSet = getBlockProposerSignatureSet(config, index2pubkey, signedBlock);
7
- return verifySignatureSet(signatureSet);
6
+ const signatureSet = getBlockProposerSignatureSet(config, signedBlock);
7
+ return verifySignatureSet(signatureSet, index2pubkey);
8
8
  }
9
- export function getBlockProposerSignatureSet(config, index2pubkey, signedBlock) {
9
+ export function getBlockProposerSignatureSet(config, signedBlock) {
10
10
  // the getDomain() api requires the state slot as 1st param, however it's the same to block.slot in state-transition
11
11
  // and the same epoch when we verify blocks in batch in beacon-node. So we can safely use block.slot here.
12
12
  const blockSlot = signedBlock.message.slot;
@@ -15,23 +15,23 @@ export function getBlockProposerSignatureSet(config, index2pubkey, signedBlock)
15
15
  ? config.getPostBellatrixForkTypes(signedBlock.message.slot).BlindedBeaconBlock
16
16
  : config.getForkTypes(signedBlock.message.slot).BeaconBlock;
17
17
  return {
18
- type: SignatureSetType.single,
19
- pubkey: index2pubkey[signedBlock.message.proposerIndex],
18
+ type: SignatureSetType.indexed,
19
+ index: signedBlock.message.proposerIndex,
20
20
  signingRoot: computeSigningRoot(blockType, signedBlock.message, domain),
21
21
  signature: signedBlock.signature,
22
22
  };
23
23
  }
24
- export function getBlockHeaderProposerSignatureSetByParentStateSlot(config, index2pubkey, parentStateSlot, signedBlockHeader) {
25
- return getBlockHeaderProposerSignatureSet(config, index2pubkey, signedBlockHeader, parentStateSlot);
24
+ export function getBlockHeaderProposerSignatureSetByParentStateSlot(config, parentStateSlot, signedBlockHeader) {
25
+ return getBlockHeaderProposerSignatureSet(config, signedBlockHeader, parentStateSlot);
26
26
  }
27
- export function getBlockHeaderProposerSignatureSetByHeaderSlot(config, index2pubkey, signedBlockHeader) {
28
- return getBlockHeaderProposerSignatureSet(config, index2pubkey, signedBlockHeader, signedBlockHeader.message.slot);
27
+ export function getBlockHeaderProposerSignatureSetByHeaderSlot(config, signedBlockHeader) {
28
+ return getBlockHeaderProposerSignatureSet(config, signedBlockHeader, signedBlockHeader.message.slot);
29
29
  }
30
- function getBlockHeaderProposerSignatureSet(config, index2pubkey, signedBlockHeader, domainSlot) {
30
+ function getBlockHeaderProposerSignatureSet(config, signedBlockHeader, domainSlot) {
31
31
  const domain = config.getDomain(domainSlot, DOMAIN_BEACON_PROPOSER, signedBlockHeader.message.slot);
32
32
  return {
33
- type: SignatureSetType.single,
34
- pubkey: index2pubkey[signedBlockHeader.message.proposerIndex],
33
+ type: SignatureSetType.indexed,
34
+ index: signedBlockHeader.message.proposerIndex,
35
35
  signingRoot: computeSigningRoot(ssz.phase0.BeaconBlockHeader, signedBlockHeader.message, domain),
36
36
  signature: signedBlockHeader.signature,
37
37
  };
@@ -1 +1 @@
1
- {"version":3,"file":"proposer.js","sourceRoot":"","sources":["../../src/signatureSets/proposer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAoD,oBAAoB,EAAU,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAErH,OAAO,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAgB,gBAAgB,EAAE,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAE7F,MAAM,UAAU,uBAAuB,CACrC,MAAoB,EACpB,YAA+B,EAC/B,WAAyD;IAEzD,MAAM,YAAY,GAAG,4BAA4B,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;IACrF,OAAO,kBAAkB,CAAC,YAAY,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,MAAoB,EACpB,YAA+B,EAC/B,WAAyD;IAEzD,oHAAoH;IACpH,0GAA0G;IAC1G,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,sBAAsB,EAAE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B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,aAAa;QACxC,WAAW,EAAE,kBAAkB,CAAC,SAAS,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC;QACvE,SAAS,EAAE,WAAW,CAAC,SAAS;KACjC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mDAAmD,CACjE,MAAoB,EACpB,eAAqB,EACrB,iBAAiD;IAEjD,OAAO,kCAAkC,CAAC,MAAM,EAAE,iBAAiB,EAAE,eAAe,CAAC,CAAC;AACxF,CAAC;AAED,MAAM,UAAU,8CAA8C,CAC5D,MAAoB,EACpB,iBAAiD;IAEjD,OAAO,kCAAkC,CAAC,MAAM,EAAE,iBAAiB,EAAE,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACvG,CAAC;AAED,SAAS,kCAAkC,CACzC,MAAoB,EACpB,iBAAiD,EACjD,UAAgB;IAEhB,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,OAAO;QAC9B,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,aAAa;QAC9C,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,10 +1,9 @@
1
1
  import { BeaconConfig } from "@lodestar/config";
2
2
  import { SignedBeaconBlock, Slot, phase0 } from "@lodestar/types";
3
- import { Index2PubkeyCache } from "../cache/pubkeyCache.js";
4
3
  import { ISignatureSet } from "../util/index.js";
5
4
  /**
6
5
  * Extract signatures to allow validating all block signatures at once
7
6
  */
8
- export declare function getProposerSlashingSignatureSets(config: BeaconConfig, index2pubkey: Index2PubkeyCache, stateSlot: Slot, proposerSlashing: phase0.ProposerSlashing): ISignatureSet[];
9
- export declare function getProposerSlashingsSignatureSets(config: BeaconConfig, index2pubkey: Index2PubkeyCache, signedBlock: SignedBeaconBlock): ISignatureSet[];
7
+ export declare function getProposerSlashingSignatureSets(config: BeaconConfig, stateSlot: Slot, proposerSlashing: phase0.ProposerSlashing): ISignatureSet[];
8
+ export declare function getProposerSlashingsSignatureSets(config: BeaconConfig, signedBlock: SignedBeaconBlock): ISignatureSet[];
10
9
  //# sourceMappingURL=proposerSlashings.d.ts.map
@@ -1 +1 @@
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,IAAI,EAAE,MAAM,EAAM,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAC,aAAa,EAAuC,MAAM,kBAAkB,CAAC;AAErF;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,SAAS,EAAE,IAAI,EACf,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,GACxC,aAAa,EAAE,CAejB;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,WAAW,EAAE,iBAAiB,GAC7B,aAAa,EAAE,CAOjB"}
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,IAAI,EAAE,MAAM,EAAM,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAC,aAAa,EAAuC,MAAM,kBAAkB,CAAC;AAErF;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,IAAI,EACf,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,GACxC,aAAa,EAAE,CAejB;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,iBAAiB,GAC7B,aAAa,EAAE,CAOjB"}
@@ -4,24 +4,24 @@ 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(config, index2pubkey, stateSlot, proposerSlashing) {
8
- const pubkey = index2pubkey[proposerSlashing.signedHeader1.message.proposerIndex];
7
+ export function getProposerSlashingSignatureSets(config, stateSlot, proposerSlashing) {
8
+ const proposerIndex = 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
12
  const domain = config.getDomain(stateSlot, DOMAIN_BEACON_PROPOSER, Number(signedHeader.message.slot));
13
13
  return {
14
- type: SignatureSetType.single,
15
- pubkey,
14
+ type: SignatureSetType.indexed,
15
+ index: proposerIndex,
16
16
  signingRoot: computeSigningRoot(ssz.phase0.BeaconBlockHeaderBigint, signedHeader.message, domain),
17
17
  signature: signedHeader.signature,
18
18
  };
19
19
  });
20
20
  }
21
- export function getProposerSlashingsSignatureSets(config, index2pubkey, signedBlock) {
21
+ export function getProposerSlashingsSignatureSets(config, signedBlock) {
22
22
  // the getDomain() api requires the state slot as 1st param, however it's the same to block.slot in state-transition
23
23
  // and the same epoch when we verify blocks in batch in beacon-node. So we can safely use block.slot here.
24
24
  const blockSlot = signedBlock.message.slot;
25
- return signedBlock.message.body.proposerSlashings.flatMap((proposerSlashing) => getProposerSlashingSignatureSets(config, index2pubkey, blockSlot, proposerSlashing));
25
+ return signedBlock.message.body.proposerSlashings.flatMap((proposerSlashing) => getProposerSlashingSignatureSets(config, blockSlot, proposerSlashing));
26
26
  }
27
27
  //# sourceMappingURL=proposerSlashings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"proposerSlashings.js","sourceRoot":"","sources":["../../src/signatureSets/proposerSlashings.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAkC,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAgB,gBAAgB,EAAE,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAErF;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAC9C,MAAoB,EACpB,YAA+B,EAC/B,SAAe,EACf,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,SAAS,EAAE,sBAAsB,EAAE,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,IAAc,CAAC,CAAC,CAAC;QAEhH,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,WAA8B;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CAAC;AACL,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,MAAoB,EACpB,WAA8B;IAE9B,oHAAoH;IACpH,0GAA0G;IAC1G,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3C,OAAO,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAC7E,gCAAgC,CAAC,MAAM,EAAE,SAAS,EAAE,gBAAgB,CAAC,CACtE,CAAC;AACJ,CAAC"}
@@ -6,5 +6,5 @@ export declare function verifyRandaoSignature(config: BeaconConfig, index2pubkey
6
6
  /**
7
7
  * Extract signatures to allow validating all block signatures at once
8
8
  */
9
- export declare function getRandaoRevealSignatureSet(config: BeaconConfig, index2pubkey: Index2PubkeyCache, block: BeaconBlock): ISignatureSet;
9
+ export declare function getRandaoRevealSignatureSet(config: BeaconConfig, block: BeaconBlock): ISignatureSet;
10
10
  //# sourceMappingURL=randao.d.ts.map
@@ -1 +1 @@
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,EACL,aAAa,EAKd,MAAM,kBAAkB,CAAC;AAE1B,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,WAAW,GACjB,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,WAAW,GACjB,aAAa,CAaf"}
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,EACL,aAAa,EAKd,MAAM,kBAAkB,CAAC;AAE1B,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,WAAW,GACjB,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,GAAG,aAAa,CAanG"}
@@ -2,20 +2,20 @@ 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
4
  export function verifyRandaoSignature(config, index2pubkey, block) {
5
- return verifySignatureSet(getRandaoRevealSignatureSet(config, index2pubkey, block));
5
+ return verifySignatureSet(getRandaoRevealSignatureSet(config, block), index2pubkey);
6
6
  }
7
7
  /**
8
8
  * Extract signatures to allow validating all block signatures at once
9
9
  */
10
- export function getRandaoRevealSignatureSet(config, index2pubkey, block) {
10
+ export function getRandaoRevealSignatureSet(config, block) {
11
11
  // should not get epoch from epochCtx
12
12
  const epoch = computeEpochAtSlot(block.slot);
13
13
  // the getDomain() api requires the state slot as 1st param, however it's the same to block.slot in state-transition
14
14
  // and the same epoch when we verify blocks in batch in beacon-node. So we can safely use block.slot here.
15
15
  const domain = config.getDomain(block.slot, DOMAIN_RANDAO, block.slot);
16
16
  return {
17
- type: SignatureSetType.single,
18
- pubkey: index2pubkey[block.proposerIndex],
17
+ type: SignatureSetType.indexed,
18
+ index: block.proposerIndex,
19
19
  signingRoot: computeSigningRoot(ssz.Epoch, epoch, domain),
20
20
  signature: block.body.randaoReveal,
21
21
  };
@@ -1 +1 @@
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;AAEjD,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,UAAU,qBAAqB,CACnC,MAAoB,EACpB,YAA+B,EAC/B,KAAkB;IAElB,OAAO,kBAAkB,CAAC,2BAA2B,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;AACtF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CACzC,MAAoB,EACpB,YAA+B,EAC/B,KAAkB;IAElB,qCAAqC;IACrC,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7C,oHAAoH;IACpH,0GAA0G;IAC1G,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
+ {"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;AAEjD,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,UAAU,qBAAqB,CACnC,MAAoB,EACpB,YAA+B,EAC/B,KAAkB;IAElB,OAAO,kBAAkB,CAAC,2BAA2B,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC;AACtF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAoB,EAAE,KAAkB;IAClF,qCAAqC;IACrC,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7C,oHAAoH;IACpH,0GAA0G;IAC1G,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,OAAO;QAC9B,KAAK,EAAE,KAAK,CAAC,aAAa;QAC1B,WAAW,EAAE,kBAAkB,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC;QACzD,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY;KACnC,CAAC;AACJ,CAAC"}
@@ -6,6 +6,6 @@ export declare function verifyVoluntaryExitSignature(config: BeaconConfig, index
6
6
  /**
7
7
  * Extract signatures to allow validating all block signatures at once
8
8
  */
9
- export declare function getVoluntaryExitSignatureSet(config: BeaconConfig, index2pubkey: Index2PubkeyCache, stateSlot: Slot, signedVoluntaryExit: phase0.SignedVoluntaryExit): ISignatureSet;
10
- export declare function getVoluntaryExitsSignatureSets(config: BeaconConfig, index2pubkey: Index2PubkeyCache, signedBlock: SignedBeaconBlock): ISignatureSet[];
9
+ export declare function getVoluntaryExitSignatureSet(config: BeaconConfig, stateSlot: Slot, signedVoluntaryExit: phase0.SignedVoluntaryExit): ISignatureSet;
10
+ export declare function getVoluntaryExitsSignatureSets(config: BeaconConfig, signedBlock: SignedBeaconBlock): ISignatureSet[];
11
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,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAC,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAM,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,aAAa,EAKd,MAAM,kBAAkB,CAAC;AAE1B,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,SAAS,EAAE,IAAI,EACf,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,GAC9C,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,SAAS,EAAE,IAAI,EACf,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,GAC9C,aAAa,CAUf;AAED,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,WAAW,EAAE,iBAAiB,GAC7B,aAAa,EAAE,CAOjB"}
1
+ {"version":3,"file":"voluntaryExits.d.ts","sourceRoot":"","sources":["../../src/signatureSets/voluntaryExits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAC,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAM,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,aAAa,EAKd,MAAM,kBAAkB,CAAC;AAE1B,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,iBAAiB,EAC/B,SAAS,EAAE,IAAI,EACf,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,GAC9C,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,IAAI,EACf,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,GAC9C,aAAa,CAUf;AAED,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,GAAG,aAAa,EAAE,CAOpH"}
@@ -1,25 +1,25 @@
1
1
  import { ssz } from "@lodestar/types";
2
2
  import { SignatureSetType, computeSigningRoot, computeStartSlotAtEpoch, verifySignatureSet, } from "../util/index.js";
3
3
  export function verifyVoluntaryExitSignature(config, index2pubkey, stateSlot, signedVoluntaryExit) {
4
- return verifySignatureSet(getVoluntaryExitSignatureSet(config, index2pubkey, stateSlot, signedVoluntaryExit));
4
+ return verifySignatureSet(getVoluntaryExitSignatureSet(config, stateSlot, signedVoluntaryExit), index2pubkey);
5
5
  }
6
6
  /**
7
7
  * Extract signatures to allow validating all block signatures at once
8
8
  */
9
- export function getVoluntaryExitSignatureSet(config, index2pubkey, stateSlot, signedVoluntaryExit) {
9
+ export function getVoluntaryExitSignatureSet(config, stateSlot, signedVoluntaryExit) {
10
10
  const messageSlot = computeStartSlotAtEpoch(signedVoluntaryExit.message.epoch);
11
11
  const domain = config.getDomainForVoluntaryExit(stateSlot, messageSlot);
12
12
  return {
13
- type: SignatureSetType.single,
14
- pubkey: index2pubkey[signedVoluntaryExit.message.validatorIndex],
13
+ type: SignatureSetType.indexed,
14
+ index: signedVoluntaryExit.message.validatorIndex,
15
15
  signingRoot: computeSigningRoot(ssz.phase0.VoluntaryExit, signedVoluntaryExit.message, domain),
16
16
  signature: signedVoluntaryExit.signature,
17
17
  };
18
18
  }
19
- export function getVoluntaryExitsSignatureSets(config, index2pubkey, signedBlock) {
19
+ export function getVoluntaryExitsSignatureSets(config, signedBlock) {
20
20
  // the getDomain() api requires the state slot as 1st param, however it's the same to block.slot in state-transition
21
21
  // and the same epoch when we verify blocks in batch in beacon-node. So we can safely use block.slot here.
22
22
  const blockSlot = signedBlock.message.slot;
23
- return signedBlock.message.body.voluntaryExits.map((voluntaryExit) => getVoluntaryExitSignatureSet(config, index2pubkey, blockSlot, voluntaryExit));
23
+ return signedBlock.message.body.voluntaryExits.map((voluntaryExit) => getVoluntaryExitSignatureSet(config, blockSlot, voluntaryExit));
24
24
  }
25
25
  //# sourceMappingURL=voluntaryExits.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"voluntaryExits.js","sourceRoot":"","sources":["../../src/signatureSets/voluntaryExits.ts"],"names":[],"mappings":"AACA,OAAO,EAAkC,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,UAAU,4BAA4B,CAC1C,MAAoB,EACpB,YAA+B,EAC/B,SAAe,EACf,mBAA+C;IAE/C,OAAO,kBAAkB,CAAC,4BAA4B,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAChH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAC1C,MAAoB,EACpB,YAA+B,EAC/B,SAAe,EACf,mBAA+C;IAE/C,MAAM,WAAW,GAAG,uBAAuB,CAAC,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/E,MAAM,MAAM,GAAG,MAAM,CAAC,yBAAyB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAExE,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,EAA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