@xyo-network/chain-sdk 5.0.4 → 5.1.1
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/dist/browser/index.d.ts +1 -0
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.mjs +1 -0
- package/dist/browser/index.mjs.map +2 -2
- package/dist/browser/modules/analyze/ChainHeadSelector.d.ts +40 -0
- package/dist/browser/modules/analyze/ChainHeadSelector.d.ts.map +1 -1
- package/dist/browser/modules/analyze/admission.d.ts +65 -0
- package/dist/browser/modules/analyze/admission.d.ts.map +1 -0
- package/dist/browser/modules/analyze/index.d.ts +1 -0
- package/dist/browser/modules/analyze/index.d.ts.map +1 -1
- package/dist/browser/modules/protocol/block/BuildBlockOptions.d.ts +8 -0
- package/dist/browser/modules/protocol/block/BuildBlockOptions.d.ts.map +1 -1
- package/dist/browser/modules/protocol/block/buildBlock.d.ts.map +1 -1
- package/dist/browser/modules/protocol/block/buildNextBlock.d.ts +2 -1
- package/dist/browser/modules/protocol/block/buildNextBlock.d.ts.map +1 -1
- package/dist/browser/modules/services/implementation/processPendingBlocks.d.ts +9 -1
- package/dist/browser/modules/services/implementation/processPendingBlocks.d.ts.map +1 -1
- package/dist/browser/modules/services/simple/block/runner/SimpleBlockRunner.d.ts +34 -1
- package/dist/browser/modules/services/simple/block/runner/SimpleBlockRunner.d.ts.map +1 -1
- package/dist/browser/modules/services/simple/block/runner/index.d.ts +1 -0
- package/dist/browser/modules/services/simple/block/runner/index.d.ts.map +1 -1
- package/dist/browser/modules/services/simple/block/runner/selectSupersededCandidate.d.ts +22 -0
- package/dist/browser/modules/services/simple/block/runner/selectSupersededCandidate.d.ts.map +1 -0
- package/dist/browser/modules/slashing/detect/DetectedOffense.d.ts +27 -0
- package/dist/browser/modules/slashing/detect/DetectedOffense.d.ts.map +1 -0
- package/dist/browser/modules/slashing/detect/candidatePairs.d.ts +44 -0
- package/dist/browser/modules/slashing/detect/candidatePairs.d.ts.map +1 -0
- package/dist/browser/modules/slashing/detect/index.d.ts +5 -0
- package/dist/browser/modules/slashing/detect/index.d.ts.map +1 -0
- package/dist/browser/modules/slashing/detect/offenseGate.d.ts +18 -0
- package/dist/browser/modules/slashing/detect/offenseGate.d.ts.map +1 -0
- package/dist/browser/modules/slashing/detect/suppression.d.ts +23 -0
- package/dist/browser/modules/slashing/detect/suppression.d.ts.map +1 -0
- package/dist/browser/modules/slashing/eligibility/evaluateProducerEligibility.d.ts +71 -0
- package/dist/browser/modules/slashing/eligibility/evaluateProducerEligibility.d.ts.map +1 -0
- package/dist/browser/modules/slashing/eligibility/index.d.ts +2 -0
- package/dist/browser/modules/slashing/eligibility/index.d.ts.map +1 -0
- package/dist/browser/modules/slashing/index/SlashIndexStore.d.ts +22 -0
- package/dist/browser/modules/slashing/index/SlashIndexStore.d.ts.map +1 -0
- package/dist/browser/modules/slashing/index/foldSlashIndex.d.ts +56 -0
- package/dist/browser/modules/slashing/index/foldSlashIndex.d.ts.map +1 -0
- package/dist/browser/modules/slashing/index/index.d.ts +3 -0
- package/dist/browser/modules/slashing/index/index.d.ts.map +1 -0
- package/dist/browser/modules/slashing/index.d.ts +6 -0
- package/dist/browser/modules/slashing/index.d.ts.map +1 -0
- package/dist/browser/modules/slashing/model/OffenseProcedure.d.ts +28 -0
- package/dist/browser/modules/slashing/model/OffenseProcedure.d.ts.map +1 -0
- package/dist/browser/modules/slashing/model/OffenseVerificationContext.d.ts +88 -0
- package/dist/browser/modules/slashing/model/OffenseVerificationContext.d.ts.map +1 -0
- package/dist/browser/modules/slashing/model/SlashHistoryReader.d.ts +34 -0
- package/dist/browser/modules/slashing/model/SlashHistoryReader.d.ts.map +1 -0
- package/dist/browser/modules/slashing/model/VerificationOutcome.d.ts +39 -0
- package/dist/browser/modules/slashing/model/VerificationOutcome.d.ts.map +1 -0
- package/dist/browser/modules/slashing/model/index.d.ts +6 -0
- package/dist/browser/modules/slashing/model/index.d.ts.map +1 -0
- package/dist/browser/modules/slashing/model/offenseKey.d.ts +42 -0
- package/dist/browser/modules/slashing/model/offenseKey.d.ts.map +1 -0
- package/dist/browser/modules/slashing/verify/index.d.ts +10 -0
- package/dist/browser/modules/slashing/verify/index.d.ts.map +1 -0
- package/dist/browser/modules/slashing/verify/preamble.d.ts +63 -0
- package/dist/browser/modules/slashing/verify/preamble.d.ts.map +1 -0
- package/dist/browser/modules/slashing/verify/verifyEquivocation.d.ts +19 -0
- package/dist/browser/modules/slashing/verify/verifyEquivocation.d.ts.map +1 -0
- package/dist/browser/modules/slashing/verify/verifyFalseAnchor.d.ts +15 -0
- package/dist/browser/modules/slashing/verify/verifyFalseAnchor.d.ts.map +1 -0
- package/dist/browser/modules/slashing/verify/verifyFalseAttestation.d.ts +22 -0
- package/dist/browser/modules/slashing/verify/verifyFalseAttestation.d.ts.map +1 -0
- package/dist/browser/modules/slashing/verify/verifyIneligibleProduction.d.ts +18 -0
- package/dist/browser/modules/slashing/verify/verifyIneligibleProduction.d.ts.map +1 -0
- package/dist/browser/modules/slashing/verify/verifyInvalidBlock.d.ts +18 -0
- package/dist/browser/modules/slashing/verify/verifyInvalidBlock.d.ts.map +1 -0
- package/dist/browser/modules/slashing/verify/verifyInvalidSlashRequest.d.ts +11 -0
- package/dist/browser/modules/slashing/verify/verifyInvalidSlashRequest.d.ts.map +1 -0
- package/dist/browser/modules/slashing/verify/verifyOffense.d.ts +29 -0
- package/dist/browser/modules/slashing/verify/verifyOffense.d.ts.map +1 -0
- package/dist/browser/modules/slashing/verify/verifyRewardOvermint.d.ts +23 -0
- package/dist/browser/modules/slashing/verify/verifyRewardOvermint.d.ts.map +1 -0
- package/dist/browser/modules/validation/elevatedPayload/lib/findElevatingTransaction.d.ts +14 -0
- package/dist/browser/modules/validation/elevatedPayload/lib/findElevatingTransaction.d.ts.map +1 -0
- package/dist/browser/modules/validation/elevatedPayload/lib/index.d.ts +2 -0
- package/dist/browser/modules/validation/elevatedPayload/lib/index.d.ts.map +1 -1
- package/dist/browser/modules/validation/elevatedPayload/lib/validateSlashPayloadInBlock.d.ts +33 -0
- package/dist/browser/modules/validation/elevatedPayload/lib/validateSlashPayloadInBlock.d.ts.map +1 -0
- package/dist/browser/modules/validation/elevatedPayload/payloads/index.d.ts +5 -0
- package/dist/browser/modules/validation/elevatedPayload/payloads/index.d.ts.map +1 -1
- package/dist/browser/modules/validation/elevatedPayload/payloads/validateSlashAdjudicationInBlock.d.ts +14 -0
- package/dist/browser/modules/validation/elevatedPayload/payloads/validateSlashAdjudicationInBlock.d.ts.map +1 -0
- package/dist/browser/modules/validation/elevatedPayload/payloads/validateSlashChallengeInBlock.d.ts +10 -0
- package/dist/browser/modules/validation/elevatedPayload/payloads/validateSlashChallengeInBlock.d.ts.map +1 -0
- package/dist/browser/modules/validation/elevatedPayload/payloads/validateSlashCommitInBlock.d.ts +10 -0
- package/dist/browser/modules/validation/elevatedPayload/payloads/validateSlashCommitInBlock.d.ts.map +1 -0
- package/dist/browser/modules/validation/elevatedPayload/payloads/validateSlashEvidenceInBlock.d.ts +10 -0
- package/dist/browser/modules/validation/elevatedPayload/payloads/validateSlashEvidenceInBlock.d.ts.map +1 -0
- package/dist/browser/modules/validation/elevatedPayload/payloads/validateSlashRequestInBlock.d.ts +14 -0
- package/dist/browser/modules/validation/elevatedPayload/payloads/validateSlashRequestInBlock.d.ts.map +1 -0
- package/dist/browser/modules/validation/elevatedPayload/validatePayloadInBlock.d.ts.map +1 -1
- package/dist/browser/slashing.d.ts +2 -0
- package/dist/browser/slashing.d.ts.map +1 -0
- package/dist/neutral/analyze.mjs +85 -3
- package/dist/neutral/analyze.mjs.map +3 -3
- package/dist/neutral/index.d.ts +1 -0
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +1 -0
- package/dist/neutral/index.mjs.map +2 -2
- package/dist/neutral/modules/analyze/ChainHeadSelector.d.ts +40 -0
- package/dist/neutral/modules/analyze/ChainHeadSelector.d.ts.map +1 -1
- package/dist/neutral/modules/analyze/admission.d.ts +65 -0
- package/dist/neutral/modules/analyze/admission.d.ts.map +1 -0
- package/dist/neutral/modules/analyze/index.d.ts +1 -0
- package/dist/neutral/modules/analyze/index.d.ts.map +1 -1
- package/dist/neutral/modules/protocol/block/BuildBlockOptions.d.ts +8 -0
- package/dist/neutral/modules/protocol/block/BuildBlockOptions.d.ts.map +1 -1
- package/dist/neutral/modules/protocol/block/buildBlock.d.ts.map +1 -1
- package/dist/neutral/modules/protocol/block/buildNextBlock.d.ts +2 -1
- package/dist/neutral/modules/protocol/block/buildNextBlock.d.ts.map +1 -1
- package/dist/neutral/modules/services/implementation/processPendingBlocks.d.ts +9 -1
- package/dist/neutral/modules/services/implementation/processPendingBlocks.d.ts.map +1 -1
- package/dist/neutral/modules/services/simple/block/runner/SimpleBlockRunner.d.ts +34 -1
- package/dist/neutral/modules/services/simple/block/runner/SimpleBlockRunner.d.ts.map +1 -1
- package/dist/neutral/modules/services/simple/block/runner/index.d.ts +1 -0
- package/dist/neutral/modules/services/simple/block/runner/index.d.ts.map +1 -1
- package/dist/neutral/modules/services/simple/block/runner/selectSupersededCandidate.d.ts +22 -0
- package/dist/neutral/modules/services/simple/block/runner/selectSupersededCandidate.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/detect/DetectedOffense.d.ts +27 -0
- package/dist/neutral/modules/slashing/detect/DetectedOffense.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/detect/candidatePairs.d.ts +44 -0
- package/dist/neutral/modules/slashing/detect/candidatePairs.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/detect/index.d.ts +5 -0
- package/dist/neutral/modules/slashing/detect/index.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/detect/offenseGate.d.ts +18 -0
- package/dist/neutral/modules/slashing/detect/offenseGate.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/detect/suppression.d.ts +23 -0
- package/dist/neutral/modules/slashing/detect/suppression.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/eligibility/evaluateProducerEligibility.d.ts +71 -0
- package/dist/neutral/modules/slashing/eligibility/evaluateProducerEligibility.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/eligibility/index.d.ts +2 -0
- package/dist/neutral/modules/slashing/eligibility/index.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/index/SlashIndexStore.d.ts +22 -0
- package/dist/neutral/modules/slashing/index/SlashIndexStore.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/index/foldSlashIndex.d.ts +56 -0
- package/dist/neutral/modules/slashing/index/foldSlashIndex.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/index/index.d.ts +3 -0
- package/dist/neutral/modules/slashing/index/index.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/index.d.ts +6 -0
- package/dist/neutral/modules/slashing/index.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/model/OffenseProcedure.d.ts +28 -0
- package/dist/neutral/modules/slashing/model/OffenseProcedure.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/model/OffenseVerificationContext.d.ts +88 -0
- package/dist/neutral/modules/slashing/model/OffenseVerificationContext.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/model/SlashHistoryReader.d.ts +34 -0
- package/dist/neutral/modules/slashing/model/SlashHistoryReader.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/model/VerificationOutcome.d.ts +39 -0
- package/dist/neutral/modules/slashing/model/VerificationOutcome.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/model/index.d.ts +6 -0
- package/dist/neutral/modules/slashing/model/index.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/model/offenseKey.d.ts +42 -0
- package/dist/neutral/modules/slashing/model/offenseKey.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/verify/index.d.ts +10 -0
- package/dist/neutral/modules/slashing/verify/index.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/verify/preamble.d.ts +63 -0
- package/dist/neutral/modules/slashing/verify/preamble.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/verify/verifyEquivocation.d.ts +19 -0
- package/dist/neutral/modules/slashing/verify/verifyEquivocation.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/verify/verifyFalseAnchor.d.ts +15 -0
- package/dist/neutral/modules/slashing/verify/verifyFalseAnchor.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/verify/verifyFalseAttestation.d.ts +22 -0
- package/dist/neutral/modules/slashing/verify/verifyFalseAttestation.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/verify/verifyIneligibleProduction.d.ts +18 -0
- package/dist/neutral/modules/slashing/verify/verifyIneligibleProduction.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/verify/verifyInvalidBlock.d.ts +18 -0
- package/dist/neutral/modules/slashing/verify/verifyInvalidBlock.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/verify/verifyInvalidSlashRequest.d.ts +11 -0
- package/dist/neutral/modules/slashing/verify/verifyInvalidSlashRequest.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/verify/verifyOffense.d.ts +29 -0
- package/dist/neutral/modules/slashing/verify/verifyOffense.d.ts.map +1 -0
- package/dist/neutral/modules/slashing/verify/verifyRewardOvermint.d.ts +23 -0
- package/dist/neutral/modules/slashing/verify/verifyRewardOvermint.d.ts.map +1 -0
- package/dist/neutral/modules/validation/elevatedPayload/lib/findElevatingTransaction.d.ts +14 -0
- package/dist/neutral/modules/validation/elevatedPayload/lib/findElevatingTransaction.d.ts.map +1 -0
- package/dist/neutral/modules/validation/elevatedPayload/lib/index.d.ts +2 -0
- package/dist/neutral/modules/validation/elevatedPayload/lib/index.d.ts.map +1 -1
- package/dist/neutral/modules/validation/elevatedPayload/lib/validateSlashPayloadInBlock.d.ts +33 -0
- package/dist/neutral/modules/validation/elevatedPayload/lib/validateSlashPayloadInBlock.d.ts.map +1 -0
- package/dist/neutral/modules/validation/elevatedPayload/payloads/index.d.ts +5 -0
- package/dist/neutral/modules/validation/elevatedPayload/payloads/index.d.ts.map +1 -1
- package/dist/neutral/modules/validation/elevatedPayload/payloads/validateSlashAdjudicationInBlock.d.ts +14 -0
- package/dist/neutral/modules/validation/elevatedPayload/payloads/validateSlashAdjudicationInBlock.d.ts.map +1 -0
- package/dist/neutral/modules/validation/elevatedPayload/payloads/validateSlashChallengeInBlock.d.ts +10 -0
- package/dist/neutral/modules/validation/elevatedPayload/payloads/validateSlashChallengeInBlock.d.ts.map +1 -0
- package/dist/neutral/modules/validation/elevatedPayload/payloads/validateSlashCommitInBlock.d.ts +10 -0
- package/dist/neutral/modules/validation/elevatedPayload/payloads/validateSlashCommitInBlock.d.ts.map +1 -0
- package/dist/neutral/modules/validation/elevatedPayload/payloads/validateSlashEvidenceInBlock.d.ts +10 -0
- package/dist/neutral/modules/validation/elevatedPayload/payloads/validateSlashEvidenceInBlock.d.ts.map +1 -0
- package/dist/neutral/modules/validation/elevatedPayload/payloads/validateSlashRequestInBlock.d.ts +14 -0
- package/dist/neutral/modules/validation/elevatedPayload/payloads/validateSlashRequestInBlock.d.ts.map +1 -0
- package/dist/neutral/modules/validation/elevatedPayload/validatePayloadInBlock.d.ts.map +1 -1
- package/dist/neutral/protocol.mjs +8 -3
- package/dist/neutral/protocol.mjs.map +2 -2
- package/dist/neutral/services.mjs +77 -7
- package/dist/neutral/services.mjs.map +4 -4
- package/dist/neutral/slashing.d.ts +2 -0
- package/dist/neutral/slashing.d.ts.map +1 -0
- package/dist/neutral/slashing.mjs +824 -0
- package/dist/neutral/slashing.mjs.map +7 -0
- package/dist/neutral/validation.mjs +274 -43
- package/dist/neutral/validation.mjs.map +4 -4
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.mjs +1 -0
- package/dist/node/index.mjs.map +2 -2
- package/dist/node/modules/analyze/ChainHeadSelector.d.ts +40 -0
- package/dist/node/modules/analyze/ChainHeadSelector.d.ts.map +1 -1
- package/dist/node/modules/analyze/admission.d.ts +65 -0
- package/dist/node/modules/analyze/admission.d.ts.map +1 -0
- package/dist/node/modules/analyze/index.d.ts +1 -0
- package/dist/node/modules/analyze/index.d.ts.map +1 -1
- package/dist/node/modules/protocol/block/BuildBlockOptions.d.ts +8 -0
- package/dist/node/modules/protocol/block/BuildBlockOptions.d.ts.map +1 -1
- package/dist/node/modules/protocol/block/buildBlock.d.ts.map +1 -1
- package/dist/node/modules/protocol/block/buildNextBlock.d.ts +2 -1
- package/dist/node/modules/protocol/block/buildNextBlock.d.ts.map +1 -1
- package/dist/node/modules/services/implementation/processPendingBlocks.d.ts +9 -1
- package/dist/node/modules/services/implementation/processPendingBlocks.d.ts.map +1 -1
- package/dist/node/modules/services/simple/block/runner/SimpleBlockRunner.d.ts +34 -1
- package/dist/node/modules/services/simple/block/runner/SimpleBlockRunner.d.ts.map +1 -1
- package/dist/node/modules/services/simple/block/runner/index.d.ts +1 -0
- package/dist/node/modules/services/simple/block/runner/index.d.ts.map +1 -1
- package/dist/node/modules/services/simple/block/runner/selectSupersededCandidate.d.ts +22 -0
- package/dist/node/modules/services/simple/block/runner/selectSupersededCandidate.d.ts.map +1 -0
- package/dist/node/modules/slashing/detect/DetectedOffense.d.ts +27 -0
- package/dist/node/modules/slashing/detect/DetectedOffense.d.ts.map +1 -0
- package/dist/node/modules/slashing/detect/candidatePairs.d.ts +44 -0
- package/dist/node/modules/slashing/detect/candidatePairs.d.ts.map +1 -0
- package/dist/node/modules/slashing/detect/index.d.ts +5 -0
- package/dist/node/modules/slashing/detect/index.d.ts.map +1 -0
- package/dist/node/modules/slashing/detect/offenseGate.d.ts +18 -0
- package/dist/node/modules/slashing/detect/offenseGate.d.ts.map +1 -0
- package/dist/node/modules/slashing/detect/suppression.d.ts +23 -0
- package/dist/node/modules/slashing/detect/suppression.d.ts.map +1 -0
- package/dist/node/modules/slashing/eligibility/evaluateProducerEligibility.d.ts +71 -0
- package/dist/node/modules/slashing/eligibility/evaluateProducerEligibility.d.ts.map +1 -0
- package/dist/node/modules/slashing/eligibility/index.d.ts +2 -0
- package/dist/node/modules/slashing/eligibility/index.d.ts.map +1 -0
- package/dist/node/modules/slashing/index/SlashIndexStore.d.ts +22 -0
- package/dist/node/modules/slashing/index/SlashIndexStore.d.ts.map +1 -0
- package/dist/node/modules/slashing/index/foldSlashIndex.d.ts +56 -0
- package/dist/node/modules/slashing/index/foldSlashIndex.d.ts.map +1 -0
- package/dist/node/modules/slashing/index/index.d.ts +3 -0
- package/dist/node/modules/slashing/index/index.d.ts.map +1 -0
- package/dist/node/modules/slashing/index.d.ts +6 -0
- package/dist/node/modules/slashing/index.d.ts.map +1 -0
- package/dist/node/modules/slashing/model/OffenseProcedure.d.ts +28 -0
- package/dist/node/modules/slashing/model/OffenseProcedure.d.ts.map +1 -0
- package/dist/node/modules/slashing/model/OffenseVerificationContext.d.ts +88 -0
- package/dist/node/modules/slashing/model/OffenseVerificationContext.d.ts.map +1 -0
- package/dist/node/modules/slashing/model/SlashHistoryReader.d.ts +34 -0
- package/dist/node/modules/slashing/model/SlashHistoryReader.d.ts.map +1 -0
- package/dist/node/modules/slashing/model/VerificationOutcome.d.ts +39 -0
- package/dist/node/modules/slashing/model/VerificationOutcome.d.ts.map +1 -0
- package/dist/node/modules/slashing/model/index.d.ts +6 -0
- package/dist/node/modules/slashing/model/index.d.ts.map +1 -0
- package/dist/node/modules/slashing/model/offenseKey.d.ts +42 -0
- package/dist/node/modules/slashing/model/offenseKey.d.ts.map +1 -0
- package/dist/node/modules/slashing/verify/index.d.ts +10 -0
- package/dist/node/modules/slashing/verify/index.d.ts.map +1 -0
- package/dist/node/modules/slashing/verify/preamble.d.ts +63 -0
- package/dist/node/modules/slashing/verify/preamble.d.ts.map +1 -0
- package/dist/node/modules/slashing/verify/verifyEquivocation.d.ts +19 -0
- package/dist/node/modules/slashing/verify/verifyEquivocation.d.ts.map +1 -0
- package/dist/node/modules/slashing/verify/verifyFalseAnchor.d.ts +15 -0
- package/dist/node/modules/slashing/verify/verifyFalseAnchor.d.ts.map +1 -0
- package/dist/node/modules/slashing/verify/verifyFalseAttestation.d.ts +22 -0
- package/dist/node/modules/slashing/verify/verifyFalseAttestation.d.ts.map +1 -0
- package/dist/node/modules/slashing/verify/verifyIneligibleProduction.d.ts +18 -0
- package/dist/node/modules/slashing/verify/verifyIneligibleProduction.d.ts.map +1 -0
- package/dist/node/modules/slashing/verify/verifyInvalidBlock.d.ts +18 -0
- package/dist/node/modules/slashing/verify/verifyInvalidBlock.d.ts.map +1 -0
- package/dist/node/modules/slashing/verify/verifyInvalidSlashRequest.d.ts +11 -0
- package/dist/node/modules/slashing/verify/verifyInvalidSlashRequest.d.ts.map +1 -0
- package/dist/node/modules/slashing/verify/verifyOffense.d.ts +29 -0
- package/dist/node/modules/slashing/verify/verifyOffense.d.ts.map +1 -0
- package/dist/node/modules/slashing/verify/verifyRewardOvermint.d.ts +23 -0
- package/dist/node/modules/slashing/verify/verifyRewardOvermint.d.ts.map +1 -0
- package/dist/node/modules/validation/elevatedPayload/lib/findElevatingTransaction.d.ts +14 -0
- package/dist/node/modules/validation/elevatedPayload/lib/findElevatingTransaction.d.ts.map +1 -0
- package/dist/node/modules/validation/elevatedPayload/lib/index.d.ts +2 -0
- package/dist/node/modules/validation/elevatedPayload/lib/index.d.ts.map +1 -1
- package/dist/node/modules/validation/elevatedPayload/lib/validateSlashPayloadInBlock.d.ts +33 -0
- package/dist/node/modules/validation/elevatedPayload/lib/validateSlashPayloadInBlock.d.ts.map +1 -0
- package/dist/node/modules/validation/elevatedPayload/payloads/index.d.ts +5 -0
- package/dist/node/modules/validation/elevatedPayload/payloads/index.d.ts.map +1 -1
- package/dist/node/modules/validation/elevatedPayload/payloads/validateSlashAdjudicationInBlock.d.ts +14 -0
- package/dist/node/modules/validation/elevatedPayload/payloads/validateSlashAdjudicationInBlock.d.ts.map +1 -0
- package/dist/node/modules/validation/elevatedPayload/payloads/validateSlashChallengeInBlock.d.ts +10 -0
- package/dist/node/modules/validation/elevatedPayload/payloads/validateSlashChallengeInBlock.d.ts.map +1 -0
- package/dist/node/modules/validation/elevatedPayload/payloads/validateSlashCommitInBlock.d.ts +10 -0
- package/dist/node/modules/validation/elevatedPayload/payloads/validateSlashCommitInBlock.d.ts.map +1 -0
- package/dist/node/modules/validation/elevatedPayload/payloads/validateSlashEvidenceInBlock.d.ts +10 -0
- package/dist/node/modules/validation/elevatedPayload/payloads/validateSlashEvidenceInBlock.d.ts.map +1 -0
- package/dist/node/modules/validation/elevatedPayload/payloads/validateSlashRequestInBlock.d.ts +14 -0
- package/dist/node/modules/validation/elevatedPayload/payloads/validateSlashRequestInBlock.d.ts.map +1 -0
- package/dist/node/modules/validation/elevatedPayload/validatePayloadInBlock.d.ts.map +1 -1
- package/dist/node/slashing.d.ts +2 -0
- package/dist/node/slashing.d.ts.map +1 -0
- package/package.json +16 -10
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Payload } from '@xyo-network/sdk';
|
|
2
|
+
import type { OffenseCode } from '@xyo-network/xl1-sdk';
|
|
3
|
+
import type { OffenseKey } from '../model/offenseKey.js';
|
|
4
|
+
import type { OffenseVerdict } from '../model/VerificationOutcome.js';
|
|
5
|
+
/**
|
|
6
|
+
* Conduct a watcher found and then verified.
|
|
7
|
+
*
|
|
8
|
+
* Carries the verdict rather than a bare flag, because the transcript is what makes the detection
|
|
9
|
+
* worth anything: it is the same record an arbiter would publish, so an operator watching in
|
|
10
|
+
* telemetry mode can see exactly what a report would have said before any are ever filed.
|
|
11
|
+
*/
|
|
12
|
+
export interface DetectedOffense {
|
|
13
|
+
/**
|
|
14
|
+
* The artifacts the verdict rests on.
|
|
15
|
+
*
|
|
16
|
+
* Carried because a report has to supply them: a reporter that named hashes without producing
|
|
17
|
+
* the objects would be asking everyone else to take its word for it.
|
|
18
|
+
*/
|
|
19
|
+
artifacts: Payload[];
|
|
20
|
+
/** What the offense is filed under. */
|
|
21
|
+
key: OffenseKey;
|
|
22
|
+
/** Which class. */
|
|
23
|
+
offense: OffenseCode;
|
|
24
|
+
/** What verification concluded, with its transcript. */
|
|
25
|
+
verdict: OffenseVerdict;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=DetectedOffense.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DetectedOffense.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/detect/DetectedOffense.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAEvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAErE;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,SAAS,EAAE,OAAO,EAAE,CAAA;IACpB,uCAAuC;IACvC,GAAG,EAAE,UAAU,CAAA;IACf,mBAAmB;IACnB,OAAO,EAAE,WAAW,CAAA;IACpB,wDAAwD;IACxD,OAAO,EAAE,cAAc,CAAA;CACxB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Hash } from '@ariestools/sdk';
|
|
2
|
+
import type { XyoAddress } from '@xyo-network/sdk';
|
|
3
|
+
/** One candidate a watcher saw a producer sign, reduced to what deciding equivocation needs. */
|
|
4
|
+
export interface CandidateSighting {
|
|
5
|
+
/** Height the candidate claims. */
|
|
6
|
+
block: number;
|
|
7
|
+
/** Recomputed signed identity — never the storage hash, which client meta can move. */
|
|
8
|
+
dataHash: Hash;
|
|
9
|
+
/** Parent the candidate builds on. */
|
|
10
|
+
previous: Hash | null;
|
|
11
|
+
/** Address that signed it. */
|
|
12
|
+
producer: XyoAddress;
|
|
13
|
+
/** The candidate this one declares it replaces, when it declares one. */
|
|
14
|
+
supersedes?: Hash;
|
|
15
|
+
}
|
|
16
|
+
/** Two candidates from one producer that compete for the same slot. */
|
|
17
|
+
export interface CandidatePair {
|
|
18
|
+
/** Height they compete at. */
|
|
19
|
+
block: number;
|
|
20
|
+
/** The earlier sighting. */
|
|
21
|
+
first: CandidateSighting;
|
|
22
|
+
/** Who signed both. */
|
|
23
|
+
producer: XyoAddress;
|
|
24
|
+
/** The later sighting. */
|
|
25
|
+
second: CandidateSighting;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Finds candidate pairs that look like equivocation among what a watcher has seen.
|
|
29
|
+
*
|
|
30
|
+
* This is detection, not judgment. It answers which pairs are worth verifying, and a pair reaching
|
|
31
|
+
* this list is not yet an accusation — the verification procedure decides that, and it re-derives
|
|
32
|
+
* everything from the artifacts rather than trusting anything here.
|
|
33
|
+
*
|
|
34
|
+
* A declared link clears the pair immediately, so an honest producer's re-proposal never enters
|
|
35
|
+
* the pipeline at all. Doing that here rather than later matters: a watcher that queued every
|
|
36
|
+
* re-proposal for verification would spend its budget on producers doing exactly what they should.
|
|
37
|
+
*
|
|
38
|
+
* Sightings are compared by recomputed identity, so a candidate seen twice through different paths
|
|
39
|
+
* collapses to one rather than becoming a pair with itself.
|
|
40
|
+
* @param sightings Candidates the watcher has observed
|
|
41
|
+
* @returns Pairs worth verifying, one per competing combination
|
|
42
|
+
*/
|
|
43
|
+
export declare function findCandidatePairs(sightings: readonly CandidateSighting[]): CandidatePair[];
|
|
44
|
+
//# sourceMappingURL=candidatePairs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"candidatePairs.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/detect/candidatePairs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,gGAAgG;AAChG,MAAM,WAAW,iBAAiB;IAChC,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,uFAAuF;IACvF,QAAQ,EAAE,IAAI,CAAA;IACd,sCAAsC;IACtC,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAA;IACrB,8BAA8B;IAC9B,QAAQ,EAAE,UAAU,CAAA;IACpB,yEAAyE;IACzE,UAAU,CAAC,EAAE,IAAI,CAAA;CAClB;AAED,uEAAuE;AACvE,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,4BAA4B;IAC5B,KAAK,EAAE,iBAAiB,CAAA;IACxB,uBAAuB;IACvB,QAAQ,EAAE,UAAU,CAAA;IACpB,0BAA0B;IAC1B,MAAM,EAAE,iBAAiB,CAAA;CAC1B;AAaD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,iBAAiB,EAAE,GAAG,aAAa,EAAE,CAqB3F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/detect/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ChainParams, OffenseCode } from '@xyo-network/xl1-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Whether a watcher may treat conduct at a height as a reportable offense.
|
|
4
|
+
*
|
|
5
|
+
* Two gates, and the second one only applies to equivocation. A producer cannot declare that one
|
|
6
|
+
* candidate replaces another until the field that says so is active, so before that activation
|
|
7
|
+
* every honest re-proposal is indistinguishable from equivocation. Reporting the class then would
|
|
8
|
+
* accuse operators of an offense the protocol gave them no way to avoid.
|
|
9
|
+
*
|
|
10
|
+
* That conjunction is fixed here rather than left to configuration. An operator who could switch
|
|
11
|
+
* it off would be arming their node to file accusations the chain cannot sustain.
|
|
12
|
+
* @param params The register version covering the offense height
|
|
13
|
+
* @param offense The offense class being considered
|
|
14
|
+
* @param height The XL1 height the conduct occurred at
|
|
15
|
+
* @returns True when reports naming this class at this height may be recorded
|
|
16
|
+
*/
|
|
17
|
+
export declare function isOffenseWatchable(params: ChainParams, offense: OffenseCode, height: number): boolean;
|
|
18
|
+
//# sourceMappingURL=offenseGate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offenseGate.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/detect/offenseGate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAGpE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAGrG"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { OffenseKey } from '../model/offenseKey.js';
|
|
2
|
+
import type { SlashHistoryReader } from '../model/SlashHistoryReader.js';
|
|
3
|
+
/** Why a watcher should not file a report it would otherwise have filed. */
|
|
4
|
+
export type SuppressionReason = 'adjudicated' | 'already-reported';
|
|
5
|
+
/**
|
|
6
|
+
* Whether an offense a watcher has detected is already spoken for.
|
|
7
|
+
*
|
|
8
|
+
* Duplicate detection is normal — every validator watching the same chain sees the same
|
|
9
|
+
* misconduct — so the interesting question is not whether to detect it but whether to add another
|
|
10
|
+
* report of it.
|
|
11
|
+
*
|
|
12
|
+
* A settled offense is the stronger case. Filing against something already adjudicated is not
|
|
13
|
+
* merely redundant: an adjudicated offense cannot be re-litigated, so the new report is itself
|
|
14
|
+
* invalid and exposes its filer to a counter-slash. A watcher must never walk into that.
|
|
15
|
+
*
|
|
16
|
+
* An existing unsettled report is only redundant. Nothing is lost by staying quiet — the offense
|
|
17
|
+
* is already on the record and the bounty already claimed by whoever got there first.
|
|
18
|
+
* @param history Finalized slash traffic as this watcher can see it
|
|
19
|
+
* @param key The offense being considered
|
|
20
|
+
* @returns Why to stay quiet, or undefined when the report is worth filing
|
|
21
|
+
*/
|
|
22
|
+
export declare function suppressionFor(history: SlashHistoryReader, key: OffenseKey): Promise<SuppressionReason | undefined>;
|
|
23
|
+
//# sourceMappingURL=suppression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suppression.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/detect/suppression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAExE,4EAA4E;AAC5E,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,kBAAkB,CAAA;AAElE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,kBAAkB,EAC3B,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAGxC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Promisable } from '@ariestools/sdk';
|
|
2
|
+
import type { XyoAddress } from '@xyo-network/sdk';
|
|
3
|
+
import type { ChainParams, StakeSnapshotViewerMethods } from '@xyo-network/xl1-sdk';
|
|
4
|
+
/**
|
|
5
|
+
* Whether an address has a current declaration to produce, as of a height.
|
|
6
|
+
*
|
|
7
|
+
* `undefined` means the question could not be answered — no intent reader is wired — which is
|
|
8
|
+
* different from `false` (the reader looked and found nothing current). Collapsing the two would
|
|
9
|
+
* turn a missing reader into either a free pass or an accusation, depending on the direction.
|
|
10
|
+
*/
|
|
11
|
+
export type HasValidIntent = (address: XyoAddress, height: number) => Promisable<boolean | undefined>;
|
|
12
|
+
/** What the participation predicate needs about a candidate block. */
|
|
13
|
+
export interface EligibilityInput {
|
|
14
|
+
/** The producer being evaluated. */
|
|
15
|
+
accused: XyoAddress;
|
|
16
|
+
/** EVM anchor carried by the candidate itself. */
|
|
17
|
+
blockAnchor?: number;
|
|
18
|
+
/** The candidate's XL1 height, where intent windows are judged. */
|
|
19
|
+
height: number;
|
|
20
|
+
/** Whether the address has a current production declaration. */
|
|
21
|
+
intent: HasValidIntent;
|
|
22
|
+
/** The register version in force. */
|
|
23
|
+
params: ChainParams;
|
|
24
|
+
/** EVM anchor carried by the candidate's parent. */
|
|
25
|
+
parentAnchor?: number;
|
|
26
|
+
/** Stake as it stood at an EVM height. */
|
|
27
|
+
snapshot?: StakeSnapshotViewerMethods;
|
|
28
|
+
}
|
|
29
|
+
/** What evaluating participation concluded, including the numbers it concluded it from. */
|
|
30
|
+
export interface EligibilityEvaluation {
|
|
31
|
+
/** Seasoned active stake measured at the evaluation point. */
|
|
32
|
+
activeStake?: bigint;
|
|
33
|
+
/** The EVM height stake was measured at. */
|
|
34
|
+
eStar?: number;
|
|
35
|
+
/** Whether the address may produce, when that could be established. */
|
|
36
|
+
eligible?: boolean;
|
|
37
|
+
/** Whether the address has a current declaration. */
|
|
38
|
+
intentValid?: boolean;
|
|
39
|
+
/** Why not, when it is not. */
|
|
40
|
+
reason?: string;
|
|
41
|
+
/** False when the inputs to the predicate could not be resolved at all. */
|
|
42
|
+
resolvable: boolean;
|
|
43
|
+
/** The seasoned portion staked on itself. */
|
|
44
|
+
selfBond?: bigint;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The one place participation is decided.
|
|
48
|
+
*
|
|
49
|
+
* Admission and after-the-fact verification call this same function, and that is the point. If
|
|
50
|
+
* the finalizer's idea of who may produce and the offense procedure's idea ever diverged, a block
|
|
51
|
+
* could be admitted by the network and simultaneously constitute an offense by its producer — so
|
|
52
|
+
* there is exactly one implementation and both callers take it.
|
|
53
|
+
*
|
|
54
|
+
* The measurement point comes from the two blocks' own signed anchors rather than any live view,
|
|
55
|
+
* so the answer does not depend on when it is asked. A block admissible when it was produced must
|
|
56
|
+
* still evaluate as admissible a week later.
|
|
57
|
+
*
|
|
58
|
+
* Stake is counted seasoned: a position participates only once it has sat at risk for the
|
|
59
|
+
* register's minimum age, so production rights cannot be flash-acquired the block before the
|
|
60
|
+
* measurement point. The unaged total is measured beside it purely so the report can tell an
|
|
61
|
+
* entrant waiting out seasoning apart from an operator short of capital.
|
|
62
|
+
*
|
|
63
|
+
* The tri-state matters as much as the verdict. `resolvable: false` means the question could not
|
|
64
|
+
* be put — no snapshot, no anchors, no intent reader — which admission treats as "do not gate"
|
|
65
|
+
* and verification treats as inconclusive. Collapsing it into ineligible would turn a missing
|
|
66
|
+
* reader into an accusation.
|
|
67
|
+
* @param input The candidate, the register, and the readers to consult
|
|
68
|
+
* @returns The verdict with the measurements behind it
|
|
69
|
+
*/
|
|
70
|
+
export declare function evaluateProducerEligibility(input: EligibilityInput): Promise<EligibilityEvaluation>;
|
|
71
|
+
//# sourceMappingURL=evaluateProducerEligibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluateProducerEligibility.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/eligibility/evaluateProducerEligibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAA;AAGnF;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,UAAU,CAAC,OAAO,GAAG,SAAS,CAAC,CAAA;AAErG,sEAAsE;AACtE,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,OAAO,EAAE,UAAU,CAAA;IACnB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAA;IACd,gEAAgE;IAChE,MAAM,EAAE,cAAc,CAAA;IACtB,qCAAqC;IACrC,MAAM,EAAE,WAAW,CAAA;IACnB,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,0BAA0B,CAAA;CACtC;AAED,2FAA2F;AAC3F,MAAM,WAAW,qBAAqB;IACpC,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qDAAqD;IACrD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,2EAA2E;IAC3E,UAAU,EAAE,OAAO,CAAA;IACnB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,2BAA2B,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA6CzG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/eligibility/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { JsonObject, Promisable } from '@ariestools/sdk';
|
|
2
|
+
/** Moniker the slash index's store resolves under. */
|
|
3
|
+
export declare const SlashIndexStoreMoniker = "SlashIndexStore";
|
|
4
|
+
/**
|
|
5
|
+
* The object store the slash index is written to.
|
|
6
|
+
*
|
|
7
|
+
* Named apart from any S3 base class on purpose: the pass that decides *what* to write is pure
|
|
8
|
+
* and tested on its own, and this is the whole of what it needs from the world. Keeping the two
|
|
9
|
+
* separate is what makes the crash-safety argument checkable — the part with the reasoning has no
|
|
10
|
+
* I/O, and the part with I/O has no reasoning.
|
|
11
|
+
*/
|
|
12
|
+
export interface SlashIndexStore {
|
|
13
|
+
/** Whether an object already exists, so immutable writes can be skipped. */
|
|
14
|
+
hasObject(path: string): Promisable<boolean>;
|
|
15
|
+
/** Reads a published object, or undefined when it is not there. */
|
|
16
|
+
readObject(path: string): Promisable<unknown>;
|
|
17
|
+
/** Writes an object. */
|
|
18
|
+
writeObject(path: string, value: JsonObject, immutable: boolean): Promisable<void>;
|
|
19
|
+
}
|
|
20
|
+
/** Whether a resolved provider can actually serve as the index store. */
|
|
21
|
+
export declare function isSlashIndexStore(value: unknown): value is SlashIndexStore;
|
|
22
|
+
//# sourceMappingURL=SlashIndexStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlashIndexStore.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/index/SlashIndexStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE7D,sDAAsD;AACtD,eAAO,MAAM,sBAAsB,oBAAoB,CAAA;AAEvD;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAC5C,mEAAmE;IACnE,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAC7C,wBAAwB;IACxB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;CACnF;AAED,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAK1E"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Hash, JsonObject } from '@ariestools/sdk';
|
|
2
|
+
import type { SignedHydratedBlockWithHashMeta, SlashIndexKeyRecord } from '@xyo-network/xl1-sdk';
|
|
3
|
+
/** One object to write, and whether it may ever be rewritten. */
|
|
4
|
+
export interface SlashIndexWrite {
|
|
5
|
+
/** True when the object is content-addressed and must never change once written. */
|
|
6
|
+
immutable: boolean;
|
|
7
|
+
/** Where it goes. */
|
|
8
|
+
path: string;
|
|
9
|
+
/** What goes there. */
|
|
10
|
+
value: JsonObject;
|
|
11
|
+
}
|
|
12
|
+
/** Everything one batch of finalized blocks contributes to the index. */
|
|
13
|
+
export interface SlashIndexDelta {
|
|
14
|
+
/** Producer aggregates: path to the offense keys seen for that producer. */
|
|
15
|
+
accused: Map<string, string[]>;
|
|
16
|
+
/** Per-offense aggregates, keyed by their path. */
|
|
17
|
+
keys: Map<string, SlashIndexKeyRecord>;
|
|
18
|
+
/**
|
|
19
|
+
* Adjudications and challenges whose report was not in this batch.
|
|
20
|
+
*
|
|
21
|
+
* Their offense cannot be resolved from the blocks alone — the report that names it is further
|
|
22
|
+
* back — so the writing pass resolves them against the published request records.
|
|
23
|
+
*/
|
|
24
|
+
pending: {
|
|
25
|
+
hash: Hash;
|
|
26
|
+
kind: 'adjudication' | 'challenge';
|
|
27
|
+
request: Hash;
|
|
28
|
+
}[];
|
|
29
|
+
/** Content-addressed records, safe to skip when already present. */
|
|
30
|
+
records: SlashIndexWrite[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Folds finalized blocks into everything the index should gain from them.
|
|
34
|
+
*
|
|
35
|
+
* Pure, and deliberately so: the pass that writes has to be safe to re-run after a crash, and the
|
|
36
|
+
* cheapest way to be sure of that is for the decision of *what* to write to depend on nothing but
|
|
37
|
+
* the blocks. Run it twice over the same range and it produces the same delta.
|
|
38
|
+
*
|
|
39
|
+
* Aggregates are keyed by canonical offense identity, so several validators reporting the same
|
|
40
|
+
* misconduct converge on one record instead of accumulating as separate accusations.
|
|
41
|
+
* @param blocks Finalized blocks to fold, in ascending height order
|
|
42
|
+
* @returns The records and aggregate contributions from those blocks
|
|
43
|
+
*/
|
|
44
|
+
export declare function foldSlashIndex(blocks: SignedHydratedBlockWithHashMeta[]): SlashIndexDelta;
|
|
45
|
+
/**
|
|
46
|
+
* Merges an aggregate contribution into whatever is already published.
|
|
47
|
+
*
|
|
48
|
+
* Every field either appends or is set once. That is what lets a crashed pass simply rescan: a
|
|
49
|
+
* second fold over the same blocks adds nothing it did not already add, and a fold over new blocks
|
|
50
|
+
* never erases what an earlier one recorded.
|
|
51
|
+
* @param existing The published aggregate, when there is one
|
|
52
|
+
* @param next The contribution from this pass
|
|
53
|
+
* @returns The aggregate to publish
|
|
54
|
+
*/
|
|
55
|
+
export declare function mergeKeyRecord(existing: SlashIndexKeyRecord | undefined, next: SlashIndexKeyRecord): SlashIndexKeyRecord;
|
|
56
|
+
//# sourceMappingURL=foldSlashIndex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"foldSlashIndex.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/index/foldSlashIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEvD,OAAO,KAAK,EAAE,+BAA+B,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAShG,iEAAiE;AACjE,MAAM,WAAW,eAAe;IAC9B,oFAAoF;IACpF,SAAS,EAAE,OAAO,CAAA;IAClB,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,uBAAuB;IACvB,KAAK,EAAE,UAAU,CAAA;CAClB;AAED,yEAAyE;AACzE,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAC9B,mDAAmD;IACnD,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;IACtC;;;;;OAKG;IACH,OAAO,EAAE;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,cAAc,GAAG,WAAW,CAAC;QAAC,OAAO,EAAE,IAAI,CAAA;KAAE,EAAE,CAAA;IAC5E,oEAAoE;IACpE,OAAO,EAAE,eAAe,EAAE,CAAA;CAC3B;AAWD;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,+BAA+B,EAAE,GAAG,eAAe,CAOzF;AA+ED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,mBAAmB,GAAG,SAAS,EACzC,IAAI,EAAE,mBAAmB,GACxB,mBAAmB,CAYrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/index/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/slashing/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Hash } from '@ariestools/sdk';
|
|
2
|
+
import type { Payload } from '@xyo-network/sdk';
|
|
3
|
+
import type { SlashRequest } from '@xyo-network/xl1-sdk';
|
|
4
|
+
import type { OffenseVerificationContext } from './OffenseVerificationContext.js';
|
|
5
|
+
import type { OffenseVerdict } from './VerificationOutcome.js';
|
|
6
|
+
/** An artifact that survived re-hashing and signature checking. */
|
|
7
|
+
export interface VerifiedArtifact {
|
|
8
|
+
/** The recomputed data hash, which is the artifact's identity. */
|
|
9
|
+
dataHash: Hash;
|
|
10
|
+
/** The artifact itself. */
|
|
11
|
+
payload: Payload;
|
|
12
|
+
/**
|
|
13
|
+
* The recomputed meta-inclusive hash, when the preamble computed it.
|
|
14
|
+
*
|
|
15
|
+
* Signed references — a block's `previous`, a carrier's payload list — may point at either
|
|
16
|
+
* form, and both are recomputed from the artifact itself so a reference match never rests on
|
|
17
|
+
* a hash the supplier merely claimed.
|
|
18
|
+
*/
|
|
19
|
+
storageHash?: Hash;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* One offense class's verification procedure.
|
|
23
|
+
*
|
|
24
|
+
* Procedures receive artifacts already re-hashed and signature-checked, so each one reasons about
|
|
25
|
+
* what the evidence means rather than re-deriving whose it is.
|
|
26
|
+
*/
|
|
27
|
+
export type OffenseProcedure = (ctx: OffenseVerificationContext, request: SlashRequest, artifacts: ReadonlyMap<Hash, VerifiedArtifact>) => Promise<OffenseVerdict>;
|
|
28
|
+
//# sourceMappingURL=OffenseProcedure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OffenseProcedure.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/model/OffenseProcedure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9D,mEAAmE;AACnE,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,QAAQ,EAAE,IAAI,CAAA;IACd,2BAA2B;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,IAAI,CAAA;CACnB;AAED;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,GAAG,EAAE,0BAA0B,EAC/B,OAAO,EAAE,YAAY,EACrB,SAAS,EAAE,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,KAC3C,OAAO,CAAC,cAAc,CAAC,CAAA"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { Hash, Hex, JsonObject, Promisable } from '@ariestools/sdk';
|
|
2
|
+
import type { AccountBalanceViewer, ChainParams, SignedHydratedBlockWithHashMeta, StakeSnapshotViewerMethods, XL1BlockNumber } from '@xyo-network/xl1-sdk';
|
|
3
|
+
import type { SlashHistoryReader } from './SlashHistoryReader.js';
|
|
4
|
+
/**
|
|
5
|
+
* The verifier's own view of finalized history.
|
|
6
|
+
*
|
|
7
|
+
* Every method may answer `undefined`, and that answer always means the same thing: this verifier
|
|
8
|
+
* cannot see far enough to judge. Callers map it to `indeterminate` rather than guessing, because
|
|
9
|
+
* a verifier that treats "I cannot see it" as "it did not happen" convicts people for its own
|
|
10
|
+
* pruning policy.
|
|
11
|
+
*/
|
|
12
|
+
export interface CanonicalChainReader {
|
|
13
|
+
/** The finalized block at a height, or undefined when it is not resolvable. */
|
|
14
|
+
blockAtHeight(height: XL1BlockNumber): Promisable<SignedHydratedBlockWithHashMeta | undefined>;
|
|
15
|
+
/** A finalized block by hash, or undefined when it is not resolvable. */
|
|
16
|
+
blockByHash(hash: Hash): Promisable<SignedHydratedBlockWithHashMeta | undefined>;
|
|
17
|
+
/** The current finalized head, or undefined when it is not resolvable. */
|
|
18
|
+
finalizedHead(): Promisable<SignedHydratedBlockWithHashMeta | undefined>;
|
|
19
|
+
/**
|
|
20
|
+
* The EVM anchor in force at an XL1 height, taken from the nearest ancestor that carries one.
|
|
21
|
+
*
|
|
22
|
+
* Blocks are not required to carry an anchor below the anchor rules, so the nearest ancestor is
|
|
23
|
+
* the only reading that gives the same answer on every conforming node.
|
|
24
|
+
*/
|
|
25
|
+
validatedAnchorAt(height: XL1BlockNumber): Promisable<number | undefined>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A read-only view of the backing EVM chain.
|
|
29
|
+
*
|
|
30
|
+
* `head()` is deliberately narrow in what it may decide. It answers whether a fact has had time to
|
|
31
|
+
* settle — never what the fact is. A verdict that turned on an unanchored local head would differ
|
|
32
|
+
* between nodes purely by who asked when.
|
|
33
|
+
*/
|
|
34
|
+
export interface EvmView {
|
|
35
|
+
/** The canonical hash at an EVM height, or undefined when it is not resolvable. */
|
|
36
|
+
canonicalHashAt(evmBlock: number): Promisable<Hex | undefined>;
|
|
37
|
+
/** The current EVM head, used only to decide whether something has matured. */
|
|
38
|
+
head(): Promisable<number | undefined>;
|
|
39
|
+
}
|
|
40
|
+
/** Where the report under verification entered the chain. */
|
|
41
|
+
export interface SubmissionContext {
|
|
42
|
+
/** Height of the block carrying the commitment, when the report was committed first. */
|
|
43
|
+
commitCarryingHeight?: XL1BlockNumber;
|
|
44
|
+
/** Height of the block carrying the request. */
|
|
45
|
+
requestCarryingHeight: XL1BlockNumber;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Everything a verification procedure is allowed to consult.
|
|
49
|
+
*
|
|
50
|
+
* This interface is the purity boundary. A procedure gets narrow readers and nothing else — no
|
|
51
|
+
* wall clock, no ambient network, no node-local state — so that two honest verifiers holding the
|
|
52
|
+
* same finalized history reach the same verdict. Slashing is only safe if that holds; a procedure
|
|
53
|
+
* that could read anything ambient would let two nodes convict different people from the same
|
|
54
|
+
* evidence.
|
|
55
|
+
*/
|
|
56
|
+
export interface OffenseVerificationContext {
|
|
57
|
+
/** The artifacts the report cited, keyed by their recomputed data hash. */
|
|
58
|
+
artifacts: ReadonlyMap<Hash, JsonObject>;
|
|
59
|
+
/**
|
|
60
|
+
* Balances as this verifier's canonical history has them, absent when it cannot read them.
|
|
61
|
+
*
|
|
62
|
+
* Only ever consulted against canonical history. Replaying a balance rule over state the
|
|
63
|
+
* reporter supplied would let a report carry its own proof.
|
|
64
|
+
*/
|
|
65
|
+
balances?: AccountBalanceViewer;
|
|
66
|
+
/**
|
|
67
|
+
* The block reward the staking contract allowed at an EVM height, when the register sources
|
|
68
|
+
* rewards from the contract and this verifier can read it.
|
|
69
|
+
*
|
|
70
|
+
* Evaluated at an anchor rather than at a local head, so the answer is the same for everyone.
|
|
71
|
+
*/
|
|
72
|
+
blockRewardAt?: (evmBlock: number) => Promisable<bigint | undefined>;
|
|
73
|
+
/** Offense catalog version the report was filed under. */
|
|
74
|
+
catalogVersion: number;
|
|
75
|
+
/** The verifier's canonical finalized chain. */
|
|
76
|
+
chain: CanonicalChainReader;
|
|
77
|
+
/** The backing EVM chain, absent when this verifier has no EVM view. */
|
|
78
|
+
evm?: EvmView;
|
|
79
|
+
/** Finalized slash traffic, for duplicate and re-litigation checks. */
|
|
80
|
+
history: SlashHistoryReader;
|
|
81
|
+
/** The register version covering the offense height. */
|
|
82
|
+
params: ChainParams;
|
|
83
|
+
/** Stake as measured at an EVM height, absent when unavailable. */
|
|
84
|
+
snapshot?: StakeSnapshotViewerMethods;
|
|
85
|
+
/** Where the report entered the chain. */
|
|
86
|
+
submission: SubmissionContext;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=OffenseVerificationContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OffenseVerificationContext.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/model/OffenseVerificationContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,EAClC,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EACV,oBAAoB,EAAE,WAAW,EAAE,+BAA+B,EAClE,0BAA0B,EAAE,cAAc,EAC3C,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAEjE;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,+EAA+E;IAC/E,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,UAAU,CAAC,+BAA+B,GAAG,SAAS,CAAC,CAAA;IAC9F,yEAAyE;IACzE,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,UAAU,CAAC,+BAA+B,GAAG,SAAS,CAAC,CAAA;IAChF,0EAA0E;IAC1E,aAAa,IAAI,UAAU,CAAC,+BAA+B,GAAG,SAAS,CAAC,CAAA;IACxE;;;;;OAKG;IACH,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CAC1E;AAED;;;;;;GAMG;AACH,MAAM,WAAW,OAAO;IACtB,mFAAmF;IACnF,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC,GAAG,GAAG,SAAS,CAAC,CAAA;IAC9D,+EAA+E;IAC/E,IAAI,IAAI,UAAU,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CACvC;AAED,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IAChC,wFAAwF;IACxF,oBAAoB,CAAC,EAAE,cAAc,CAAA;IACrC,gDAAgD;IAChD,qBAAqB,EAAE,cAAc,CAAA;CACtC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,0BAA0B;IACzC,2EAA2E;IAC3E,SAAS,EAAE,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;IACxC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAA;IAC/B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,UAAU,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACpE,0DAA0D;IAC1D,cAAc,EAAE,MAAM,CAAA;IACtB,gDAAgD;IAChD,KAAK,EAAE,oBAAoB,CAAA;IAC3B,wEAAwE;IACxE,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,uEAAuE;IACvE,OAAO,EAAE,kBAAkB,CAAA;IAC3B,wDAAwD;IACxD,MAAM,EAAE,WAAW,CAAA;IACnB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,0BAA0B,CAAA;IACrC,0CAA0C;IAC1C,UAAU,EAAE,iBAAiB,CAAA;CAC9B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Hash, Promisable } from '@ariestools/sdk';
|
|
2
|
+
import type { SlashAdjudication, SlashChallenge, SlashCommit, SlashRequest, XL1BlockNumber } from '@xyo-network/xl1-sdk';
|
|
3
|
+
import type { OffenseKey } from './offenseKey.js';
|
|
4
|
+
/** A slash payload as it was actually recorded, with where it landed. */
|
|
5
|
+
export interface Finalized<T> {
|
|
6
|
+
/** EVM anchor in force at the carrying block. */
|
|
7
|
+
anchor?: number;
|
|
8
|
+
/** Height of the block that carried it. */
|
|
9
|
+
carryingHeight: XL1BlockNumber;
|
|
10
|
+
/** Hash of the payload itself. */
|
|
11
|
+
hash: Hash;
|
|
12
|
+
/** Position within the carrying block, which breaks ties between same-block entries. */
|
|
13
|
+
index: number;
|
|
14
|
+
/** The recorded payload. */
|
|
15
|
+
payload: T;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Finalized slash traffic, as one verifier can see it.
|
|
19
|
+
*
|
|
20
|
+
* Reads answer from finalized history only. A verifier that counted pending traffic could reach a
|
|
21
|
+
* verdict its peers cannot reproduce, and the whole point of these procedures is that two honest
|
|
22
|
+
* nodes agree.
|
|
23
|
+
*/
|
|
24
|
+
export interface SlashHistoryReader {
|
|
25
|
+
/** The adjudication closing an offense, when one is finalized. */
|
|
26
|
+
adjudicationByKey(key: OffenseKey): Promisable<Finalized<SlashAdjudication> | undefined>;
|
|
27
|
+
/** Challenges filed against a request. */
|
|
28
|
+
challengesForRequest(requestHash: Hash): Promisable<Finalized<SlashChallenge>[]>;
|
|
29
|
+
/** Commitments naming a given report hash. */
|
|
30
|
+
commitsMatching(commitment: Hash): Promisable<Finalized<SlashCommit>[]>;
|
|
31
|
+
/** Requests already recorded for an offense, earliest first. */
|
|
32
|
+
requestsByKey(key: OffenseKey): Promisable<Finalized<SlashRequest>[]>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=SlashHistoryReader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlashHistoryReader.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/model/SlashHistoryReader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,KAAK,EACV,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAC7E,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,yEAAyE;AACzE,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,2CAA2C;IAC3C,cAAc,EAAE,cAAc,CAAA;IAC9B,kCAAkC;IAClC,IAAI,EAAE,IAAI,CAAA;IACV,wFAAwF;IACxF,KAAK,EAAE,MAAM,CAAA;IACb,4BAA4B;IAC5B,OAAO,EAAE,CAAC,CAAA;CACX;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,kEAAkE;IAClE,iBAAiB,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAC,CAAA;IACxF,0CAA0C;IAC1C,oBAAoB,CAAC,WAAW,EAAE,IAAI,GAAG,UAAU,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;IAChF,8CAA8C;IAC9C,eAAe,CAAC,UAAU,EAAE,IAAI,GAAG,UAAU,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;IACvE,gEAAgE;IAChE,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;CACtE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { JsonObject } from '@ariestools/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* What verifying a report concluded.
|
|
4
|
+
*
|
|
5
|
+
* Three outcomes rather than two, and the middle one carries the design. `indeterminate` means the
|
|
6
|
+
* check could not be completed from what was available — a reader was unreachable, history had
|
|
7
|
+
* aged out, an anchor had not matured. Collapsing it into `provably-invalid` would punish an
|
|
8
|
+
* honest reporter for a gap in someone else's data, which is the fastest way to make reporting
|
|
9
|
+
* something nobody sane volunteers for.
|
|
10
|
+
*/
|
|
11
|
+
export declare const VerificationOutcomes: readonly ["verified", "indeterminate", "provably-invalid"];
|
|
12
|
+
/** The conclusion of a verification procedure. */
|
|
13
|
+
export type VerificationOutcome = typeof VerificationOutcomes[number];
|
|
14
|
+
/**
|
|
15
|
+
* The result of verifying one report.
|
|
16
|
+
*
|
|
17
|
+
* The transcript is not decoration. Every procedure is required to be reproducible by anyone
|
|
18
|
+
* holding the same inputs, so it records what was consulted and what was recomputed — that record
|
|
19
|
+
* is what an arbiter publishes, and what lets two nodes that disagree find out which of them is
|
|
20
|
+
* reading different data rather than arguing about conclusions.
|
|
21
|
+
*/
|
|
22
|
+
export interface OffenseVerdict {
|
|
23
|
+
/** The conclusion. */
|
|
24
|
+
outcome: VerificationOutcome;
|
|
25
|
+
/**
|
|
26
|
+
* Set when the verdict rests on absence rather than evidence.
|
|
27
|
+
*
|
|
28
|
+
* A conclusion drawn from not finding something can be overturned by someone who has it, so the
|
|
29
|
+
* adjudication side has to know the difference before it acts.
|
|
30
|
+
*/
|
|
31
|
+
provisional?: boolean;
|
|
32
|
+
/** Why the procedure concluded what it did. */
|
|
33
|
+
reason: string;
|
|
34
|
+
/** Step-by-step record of inputs consulted and values recomputed. */
|
|
35
|
+
transcript: JsonObject;
|
|
36
|
+
}
|
|
37
|
+
/** Builds a verdict, keeping the transcript shape uniform across procedures. */
|
|
38
|
+
export declare function verdict(outcome: VerificationOutcome, reason: string, transcript?: JsonObject, provisional?: boolean): OffenseVerdict;
|
|
39
|
+
//# sourceMappingURL=VerificationOutcome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerificationOutcome.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/model/VerificationOutcome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,4DAA6D,CAAA;AAE9F,kDAAkD;AAClD,MAAM,MAAM,mBAAmB,GAAG,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAA;AAErE;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,sBAAsB;IACtB,OAAO,EAAE,mBAAmB,CAAA;IAC5B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAA;IACd,qEAAqE;IACrE,UAAU,EAAE,UAAU,CAAA;CACvB;AAED,gFAAgF;AAChF,wBAAgB,OAAO,CACrB,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,UAAe,EAC3B,WAAW,CAAC,EAAE,OAAO,GACpB,cAAc,CAQhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { XyoAddress } from '@xyo-network/sdk';
|
|
2
|
+
import type { ChainId, OffenseCode, SlashRequest, XL1BlockNumber } from '@xyo-network/xl1-sdk';
|
|
3
|
+
/**
|
|
4
|
+
* What makes two reports be about the same offense.
|
|
5
|
+
*
|
|
6
|
+
* Duplicate reports are expected — several validators watching the same chain will see the same
|
|
7
|
+
* misconduct — so the system has to recognise them as one thing. Without a canonical key, the same
|
|
8
|
+
* offense could be adjudicated twice and slashed twice.
|
|
9
|
+
*/
|
|
10
|
+
export interface OffenseKey {
|
|
11
|
+
/** Who is accused. */
|
|
12
|
+
accused: XyoAddress;
|
|
13
|
+
/** The canonical height the offense is located at. */
|
|
14
|
+
block: XL1BlockNumber;
|
|
15
|
+
/** The chain it happened on. */
|
|
16
|
+
chain: ChainId;
|
|
17
|
+
/** Which offense class. */
|
|
18
|
+
offense: OffenseCode;
|
|
19
|
+
}
|
|
20
|
+
/** The key a request is filed under. */
|
|
21
|
+
export declare function offenseKeyOf(request: SlashRequest): OffenseKey;
|
|
22
|
+
/**
|
|
23
|
+
* A stable string for the key, for use as a map key.
|
|
24
|
+
*
|
|
25
|
+
* Field order is fixed rather than derived from object iteration, so the same offense produces the
|
|
26
|
+
* same string on every node regardless of how the object was built.
|
|
27
|
+
*/
|
|
28
|
+
export declare function offenseKeyString(key: OffenseKey): string;
|
|
29
|
+
/**
|
|
30
|
+
* Where an offense is located on the chain, which is not always where it was reported.
|
|
31
|
+
*
|
|
32
|
+
* Each class has one canonical height, and it is the height the report's `block` field must carry.
|
|
33
|
+
* Fixing it per class is what stops the same misconduct being filed under several different
|
|
34
|
+
* heights and slashed once for each.
|
|
35
|
+
*
|
|
36
|
+
* - equivocation — the height the two candidates compete at
|
|
37
|
+
* - invalid-block, reward-overmint, false-anchor, ineligible-production — the offending block
|
|
38
|
+
* - invalid-slash-request — the height carrying the request being complained about
|
|
39
|
+
* - false-attestation — the height carrying the attestation
|
|
40
|
+
*/
|
|
41
|
+
export declare function canonicalOffenseHeight(request: SlashRequest): XL1BlockNumber;
|
|
42
|
+
//# sourceMappingURL=offenseKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offenseKey.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/model/offenseKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EACV,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EACnD,MAAM,sBAAsB,CAAA;AAE7B;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,sBAAsB;IACtB,OAAO,EAAE,UAAU,CAAA;IACnB,sDAAsD;IACtD,KAAK,EAAE,cAAc,CAAA;IACrB,gCAAgC;IAChC,KAAK,EAAE,OAAO,CAAA;IACd,2BAA2B;IAC3B,OAAO,EAAE,WAAW,CAAA;CACrB;AAED,wCAAwC;AACxC,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,UAAU,CAO9D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,CAExD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,YAAY,GAAG,cAAc,CAE5E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './preamble.js';
|
|
2
|
+
export * from './verifyEquivocation.js';
|
|
3
|
+
export * from './verifyFalseAnchor.js';
|
|
4
|
+
export * from './verifyFalseAttestation.js';
|
|
5
|
+
export * from './verifyIneligibleProduction.js';
|
|
6
|
+
export * from './verifyInvalidBlock.js';
|
|
7
|
+
export * from './verifyInvalidSlashRequest.js';
|
|
8
|
+
export * from './verifyOffense.js';
|
|
9
|
+
export * from './verifyRewardOvermint.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/slashing/verify/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,yBAAyB,CAAA;AACvC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,oBAAoB,CAAA;AAClC,cAAc,2BAA2B,CAAA"}
|