@lodestar/state-transition 1.39.0-dev.86298a43e6 → 1.39.0-dev.90493ebb47

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 (40) hide show
  1. package/lib/block/isValidIndexedAttestation.d.ts +4 -5
  2. package/lib/block/isValidIndexedAttestation.d.ts.map +1 -1
  3. package/lib/block/isValidIndexedAttestation.js +9 -10
  4. package/lib/block/isValidIndexedAttestation.js.map +1 -1
  5. package/lib/block/processAttestationPhase0.d.ts.map +1 -1
  6. package/lib/block/processAttestationPhase0.js +1 -1
  7. package/lib/block/processAttestationPhase0.js.map +1 -1
  8. package/lib/block/processAttesterSlashing.d.ts +3 -2
  9. package/lib/block/processAttesterSlashing.d.ts.map +1 -1
  10. package/lib/block/processAttesterSlashing.js +3 -3
  11. package/lib/block/processAttesterSlashing.js.map +1 -1
  12. package/lib/block/processBlsToExecutionChange.d.ts +3 -1
  13. package/lib/block/processBlsToExecutionChange.d.ts.map +1 -1
  14. package/lib/block/processBlsToExecutionChange.js +7 -11
  15. package/lib/block/processBlsToExecutionChange.js.map +1 -1
  16. package/lib/block/processProposerSlashing.d.ts +5 -2
  17. package/lib/block/processProposerSlashing.d.ts.map +1 -1
  18. package/lib/block/processProposerSlashing.js +7 -5
  19. package/lib/block/processProposerSlashing.js.map +1 -1
  20. package/lib/block/processWithdrawals.d.ts +3 -3
  21. package/lib/block/processWithdrawals.d.ts.map +1 -1
  22. package/lib/block/processWithdrawals.js +152 -105
  23. package/lib/block/processWithdrawals.js.map +1 -1
  24. package/lib/signatureSets/blsToExecutionChange.d.ts +1 -2
  25. package/lib/signatureSets/blsToExecutionChange.d.ts.map +1 -1
  26. package/lib/signatureSets/blsToExecutionChange.js +2 -2
  27. package/lib/signatureSets/blsToExecutionChange.js.map +1 -1
  28. package/lib/signatureSets/proposer.d.ts +3 -4
  29. package/lib/signatureSets/proposer.d.ts.map +1 -1
  30. package/lib/signatureSets/proposer.js +5 -6
  31. package/lib/signatureSets/proposer.js.map +1 -1
  32. package/package.json +14 -11
  33. package/src/block/isValidIndexedAttestation.ts +17 -12
  34. package/src/block/processAttestationPhase0.ts +2 -1
  35. package/src/block/processAttesterSlashing.ts +16 -4
  36. package/src/block/processBlsToExecutionChange.ts +13 -14
  37. package/src/block/processProposerSlashing.ts +21 -11
  38. package/src/block/processWithdrawals.ts +230 -135
  39. package/src/signatureSets/blsToExecutionChange.ts +2 -3
  40. package/src/signatureSets/proposer.ts +6 -7
@@ -2,7 +2,6 @@ import {BeaconConfig} from "@lodestar/config";
2
2
  import {DOMAIN_BEACON_PROPOSER} from "@lodestar/params";
3
3
  import {SignedBeaconBlock, SignedBlindedBeaconBlock, Slot, isBlindedBeaconBlock, phase0, ssz} from "@lodestar/types";
4
4
  import {Index2PubkeyCache} from "../cache/pubkeyCache.js";
5
- import {CachedBeaconStateAllForks} from "../types.js";
6
5
  import {computeSigningRoot} from "../util/index.js";
7
6
  import {ISignatureSet, SignatureSetType, verifySignatureSet} from "../util/signatureSets.js";
8
7
 
@@ -38,28 +37,28 @@ export function getBlockProposerSignatureSet(
38
37
  }
39
38
 
40
39
  export function getBlockHeaderProposerSignatureSetByParentStateSlot(
40
+ config: BeaconConfig,
41
41
  index2pubkey: Index2PubkeyCache,
42
- parentState: CachedBeaconStateAllForks,
42
+ parentStateSlot: Slot,
43
43
  signedBlockHeader: phase0.SignedBeaconBlockHeader
44
44
  ) {
45
- return getBlockHeaderProposerSignatureSet(index2pubkey, parentState, signedBlockHeader, parentState.slot);
45
+ return getBlockHeaderProposerSignatureSet(config, index2pubkey, signedBlockHeader, parentStateSlot);
46
46
  }
47
47
 
48
48
  export function getBlockHeaderProposerSignatureSetByHeaderSlot(
49
+ config: BeaconConfig,
49
50
  index2pubkey: Index2PubkeyCache,
50
- headState: CachedBeaconStateAllForks,
51
51
  signedBlockHeader: phase0.SignedBeaconBlockHeader
52
52
  ) {
53
- return getBlockHeaderProposerSignatureSet(index2pubkey, headState, signedBlockHeader, signedBlockHeader.message.slot);
53
+ return getBlockHeaderProposerSignatureSet(config, index2pubkey, signedBlockHeader, signedBlockHeader.message.slot);
54
54
  }
55
55
 
56
56
  function getBlockHeaderProposerSignatureSet(
57
+ config: BeaconConfig,
57
58
  index2pubkey: Index2PubkeyCache,
58
- state: CachedBeaconStateAllForks,
59
59
  signedBlockHeader: phase0.SignedBeaconBlockHeader,
60
60
  domainSlot: Slot
61
61
  ): ISignatureSet {
62
- const {config} = state;
63
62
  const domain = config.getDomain(domainSlot, DOMAIN_BEACON_PROPOSER, signedBlockHeader.message.slot);
64
63
 
65
64
  return {