@typeberry/lib 0.0.1-3d2303d → 0.0.1-4d4d1b9
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/index.d.ts +42 -11
- package/index.js +28 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -4939,6 +4939,8 @@ declare class ChainSpec extends WithDebug {
|
|
|
4939
4939
|
readonly maxBlockGas: U64;
|
|
4940
4940
|
/** `G_R`: The gas allocated to invoke a work-package’s Refine logic. */
|
|
4941
4941
|
readonly maxRefineGas: U64;
|
|
4942
|
+
/** `L`: The maximum age in timeslots of the lookup anchor. */
|
|
4943
|
+
readonly maxLookupAnchorAge: U32;
|
|
4942
4944
|
|
|
4943
4945
|
constructor(data: Omit<ChainSpec, "validatorsSuperMajority" | "thirdOfValidators" | "erasureCodedPieceSize">) {
|
|
4944
4946
|
super();
|
|
@@ -4958,6 +4960,7 @@ declare class ChainSpec extends WithDebug {
|
|
|
4958
4960
|
this.erasureCodedPieceSize = tryAsU32(EC_SEGMENT_SIZE / data.numberECPiecesPerSegment);
|
|
4959
4961
|
this.maxBlockGas = data.maxBlockGas;
|
|
4960
4962
|
this.maxRefineGas = data.maxRefineGas;
|
|
4963
|
+
this.maxLookupAnchorAge = data.maxLookupAnchorAge;
|
|
4961
4964
|
}
|
|
4962
4965
|
}
|
|
4963
4966
|
|
|
@@ -4976,6 +4979,8 @@ declare const tinyChainSpec = new ChainSpec({
|
|
|
4976
4979
|
preimageExpungePeriod: tryAsU32(32),
|
|
4977
4980
|
maxBlockGas: tryAsU64(20_000_000),
|
|
4978
4981
|
maxRefineGas: tryAsU64(1_000_000_000),
|
|
4982
|
+
// https://github.com/davxy/jam-conformance/pull/47/files#diff-27e26142b3a96e407dab40d388b63d553f5d9cdb66dec58cd93e63dd434f9e45R260
|
|
4983
|
+
maxLookupAnchorAge: tryAsU32(24),
|
|
4979
4984
|
});
|
|
4980
4985
|
|
|
4981
4986
|
/**
|
|
@@ -4995,6 +5000,7 @@ declare const fullChainSpec = new ChainSpec({
|
|
|
4995
5000
|
preimageExpungePeriod: tryAsU32(19_200),
|
|
4996
5001
|
maxBlockGas: tryAsU64(3_500_000_000),
|
|
4997
5002
|
maxRefineGas: tryAsU64(5_000_000_000),
|
|
5003
|
+
maxLookupAnchorAge: tryAsU32(14_400),
|
|
4998
5004
|
});
|
|
4999
5005
|
|
|
5000
5006
|
/**
|
|
@@ -6542,6 +6548,22 @@ declare class ValidatorKeys extends WithDebug {
|
|
|
6542
6548
|
}
|
|
6543
6549
|
}
|
|
6544
6550
|
|
|
6551
|
+
declare class TicketsMarker extends WithDebug {
|
|
6552
|
+
static Codec = codec.Class(TicketsMarker, {
|
|
6553
|
+
tickets: codecPerEpochBlock(Ticket.Codec),
|
|
6554
|
+
});
|
|
6555
|
+
|
|
6556
|
+
static create({ tickets }: CodecRecord<TicketsMarker>) {
|
|
6557
|
+
return new TicketsMarker(tickets);
|
|
6558
|
+
}
|
|
6559
|
+
|
|
6560
|
+
private constructor(public readonly tickets: PerEpochBlock<Ticket>) {
|
|
6561
|
+
super();
|
|
6562
|
+
}
|
|
6563
|
+
}
|
|
6564
|
+
|
|
6565
|
+
type TicketsMarkerView = DescribedBy<typeof TicketsMarker.Codec.View>;
|
|
6566
|
+
|
|
6545
6567
|
/**
|
|
6546
6568
|
* For the first block in a new epoch, the epoch marker is set
|
|
6547
6569
|
* and contains the epoch randomness and validator keys
|
|
@@ -6572,6 +6594,8 @@ declare class EpochMarker extends WithDebug {
|
|
|
6572
6594
|
}
|
|
6573
6595
|
}
|
|
6574
6596
|
|
|
6597
|
+
type EpochMarkerView = DescribedBy<typeof EpochMarker.Codec.View>;
|
|
6598
|
+
|
|
6575
6599
|
/**
|
|
6576
6600
|
* Return an encoded header without the seal components.
|
|
6577
6601
|
*
|
|
@@ -6594,7 +6618,7 @@ declare const legacyDescriptor = {
|
|
|
6594
6618
|
extrinsicHash: codec.bytes(HASH_SIZE).asOpaque<ExtrinsicHash>(),
|
|
6595
6619
|
timeSlotIndex: codec.u32.asOpaque<TimeSlot>(),
|
|
6596
6620
|
epochMarker: codec.optional(EpochMarker.Codec),
|
|
6597
|
-
ticketsMarker: codec.optional(
|
|
6621
|
+
ticketsMarker: codec.optional(TicketsMarker.Codec),
|
|
6598
6622
|
offendersMarker: codec.sequenceVarLen(codec.bytes(ED25519_KEY_BYTES).asOpaque<Ed25519Key>()),
|
|
6599
6623
|
bandersnatchBlockAuthorIndex: codec.u16.asOpaque<ValidatorIndex>(),
|
|
6600
6624
|
entropySource: codec.bytes(BANDERSNATCH_VRF_SIGNATURE_BYTES).asOpaque<BandersnatchVrfSignature>(),
|
|
@@ -6617,7 +6641,7 @@ declare class Header extends WithDebug {
|
|
|
6617
6641
|
extrinsicHash: codec.bytes(HASH_SIZE).asOpaque<ExtrinsicHash>(),
|
|
6618
6642
|
timeSlotIndex: codec.u32.asOpaque<TimeSlot>(),
|
|
6619
6643
|
epochMarker: codec.optional(EpochMarker.Codec),
|
|
6620
|
-
ticketsMarker: codec.optional(
|
|
6644
|
+
ticketsMarker: codec.optional(TicketsMarker.Codec),
|
|
6621
6645
|
bandersnatchBlockAuthorIndex: codec.u16.asOpaque<ValidatorIndex>(),
|
|
6622
6646
|
entropySource: codec.bytes(BANDERSNATCH_VRF_SIGNATURE_BYTES).asOpaque<BandersnatchVrfSignature>(),
|
|
6623
6647
|
offendersMarker: codec.sequenceVarLen(codec.bytes(ED25519_KEY_BYTES).asOpaque<Ed25519Key>()),
|
|
@@ -6650,7 +6674,7 @@ declare class Header extends WithDebug {
|
|
|
6650
6674
|
* `H_w`: Winning tickets provides the series of 600 slot sealing "tickets"
|
|
6651
6675
|
* for the next epoch.
|
|
6652
6676
|
*/
|
|
6653
|
-
public ticketsMarker:
|
|
6677
|
+
public ticketsMarker: TicketsMarker | null = null;
|
|
6654
6678
|
/** `H_i`: Block author's index in the current validator set. */
|
|
6655
6679
|
public bandersnatchBlockAuthorIndex: ValidatorIndex = tryAsValidatorIndex(0);
|
|
6656
6680
|
/** `H_v`: Entropy-yielding VRF signature. */
|
|
@@ -6835,6 +6859,7 @@ type index$j_EntropyHash = EntropyHash;
|
|
|
6835
6859
|
type index$j_Epoch = Epoch;
|
|
6836
6860
|
type index$j_EpochMarker = EpochMarker;
|
|
6837
6861
|
declare const index$j_EpochMarker: typeof EpochMarker;
|
|
6862
|
+
type index$j_EpochMarkerView = EpochMarkerView;
|
|
6838
6863
|
type index$j_Extrinsic = Extrinsic;
|
|
6839
6864
|
declare const index$j_Extrinsic: typeof Extrinsic;
|
|
6840
6865
|
type index$j_ExtrinsicHash = ExtrinsicHash;
|
|
@@ -6854,6 +6879,9 @@ type index$j_SegmentIndex = SegmentIndex;
|
|
|
6854
6879
|
type index$j_ServiceGas = ServiceGas;
|
|
6855
6880
|
type index$j_ServiceId = ServiceId;
|
|
6856
6881
|
type index$j_StateRootHash = StateRootHash;
|
|
6882
|
+
type index$j_TicketsMarker = TicketsMarker;
|
|
6883
|
+
declare const index$j_TicketsMarker: typeof TicketsMarker;
|
|
6884
|
+
type index$j_TicketsMarkerView = TicketsMarkerView;
|
|
6857
6885
|
type index$j_TimeSlot = TimeSlot;
|
|
6858
6886
|
type index$j_ValidatorIndex = ValidatorIndex;
|
|
6859
6887
|
type index$j_ValidatorKeys = ValidatorKeys;
|
|
@@ -6886,8 +6914,8 @@ declare const index$j_workPackage: typeof workPackage;
|
|
|
6886
6914
|
declare const index$j_workReport: typeof workReport;
|
|
6887
6915
|
declare const index$j_workResult: typeof workResult;
|
|
6888
6916
|
declare namespace index$j {
|
|
6889
|
-
export { index$j_Block as Block, index$j_EpochMarker as EpochMarker, index$j_Extrinsic as Extrinsic, index$j_Header as Header, index$j_HeaderViewWithHash as HeaderViewWithHash, index$j_MAX_NUMBER_OF_SEGMENTS as MAX_NUMBER_OF_SEGMENTS, index$j_ValidatorKeys as ValidatorKeys, index$j_W_E as W_E, index$j_W_S as W_S, index$j_assurances as assurances, index$j_codecPerEpochBlock as codecPerEpochBlock, index$j_codecPerValidator as codecPerValidator, codec as codecUtils, index$j_disputes as disputes, index$j_encodeUnsealedHeader as encodeUnsealedHeader, index$j_guarantees as guarantees, index$j_headerViewWithHashCodec as headerViewWithHashCodec, index$j_legacyDescriptor as legacyDescriptor, index$j_preimage as preimage, index$j_refineContext as refineContext, index$j_tickets as tickets, index$j_tryAsCoreIndex as tryAsCoreIndex, index$j_tryAsEpoch as tryAsEpoch, index$j_tryAsPerEpochBlock as tryAsPerEpochBlock, index$j_tryAsPerValidator as tryAsPerValidator, index$j_tryAsSegmentIndex as tryAsSegmentIndex, index$j_tryAsServiceGas as tryAsServiceGas, index$j_tryAsServiceId as tryAsServiceId, index$j_tryAsTimeSlot as tryAsTimeSlot, index$j_tryAsValidatorIndex as tryAsValidatorIndex, index$j_workItem as workItem, index$j_workPackage as workPackage, index$j_workReport as workReport, index$j_workResult as workResult };
|
|
6890
|
-
export type { index$j_BlockView as BlockView, index$j_CodeHash as CodeHash, index$j_CoreIndex as CoreIndex, index$j_EntropyHash as EntropyHash, index$j_Epoch as Epoch, index$j_ExtrinsicHash as ExtrinsicHash, index$j_ExtrinsicView as ExtrinsicView, index$j_HeaderHash as HeaderHash, index$j_HeaderView as HeaderView, index$j_PerEpochBlock as PerEpochBlock, index$j_PerValidator as PerValidator, index$j_SEGMENT_BYTES as SEGMENT_BYTES, index$j_Segment as Segment, index$j_SegmentIndex as SegmentIndex, index$j_ServiceGas as ServiceGas, index$j_ServiceId as ServiceId, index$j_StateRootHash as StateRootHash, index$j_TimeSlot as TimeSlot, index$j_ValidatorIndex as ValidatorIndex, index$j_WorkReportHash as WorkReportHash };
|
|
6917
|
+
export { index$j_Block as Block, index$j_EpochMarker as EpochMarker, index$j_Extrinsic as Extrinsic, index$j_Header as Header, index$j_HeaderViewWithHash as HeaderViewWithHash, index$j_MAX_NUMBER_OF_SEGMENTS as MAX_NUMBER_OF_SEGMENTS, index$j_TicketsMarker as TicketsMarker, index$j_ValidatorKeys as ValidatorKeys, index$j_W_E as W_E, index$j_W_S as W_S, index$j_assurances as assurances, index$j_codecPerEpochBlock as codecPerEpochBlock, index$j_codecPerValidator as codecPerValidator, codec as codecUtils, index$j_disputes as disputes, index$j_encodeUnsealedHeader as encodeUnsealedHeader, index$j_guarantees as guarantees, index$j_headerViewWithHashCodec as headerViewWithHashCodec, index$j_legacyDescriptor as legacyDescriptor, index$j_preimage as preimage, index$j_refineContext as refineContext, index$j_tickets as tickets, index$j_tryAsCoreIndex as tryAsCoreIndex, index$j_tryAsEpoch as tryAsEpoch, index$j_tryAsPerEpochBlock as tryAsPerEpochBlock, index$j_tryAsPerValidator as tryAsPerValidator, index$j_tryAsSegmentIndex as tryAsSegmentIndex, index$j_tryAsServiceGas as tryAsServiceGas, index$j_tryAsServiceId as tryAsServiceId, index$j_tryAsTimeSlot as tryAsTimeSlot, index$j_tryAsValidatorIndex as tryAsValidatorIndex, index$j_workItem as workItem, index$j_workPackage as workPackage, index$j_workReport as workReport, index$j_workResult as workResult };
|
|
6918
|
+
export type { index$j_BlockView as BlockView, index$j_CodeHash as CodeHash, index$j_CoreIndex as CoreIndex, index$j_EntropyHash as EntropyHash, index$j_Epoch as Epoch, index$j_EpochMarkerView as EpochMarkerView, index$j_ExtrinsicHash as ExtrinsicHash, index$j_ExtrinsicView as ExtrinsicView, index$j_HeaderHash as HeaderHash, index$j_HeaderView as HeaderView, index$j_PerEpochBlock as PerEpochBlock, index$j_PerValidator as PerValidator, index$j_SEGMENT_BYTES as SEGMENT_BYTES, index$j_Segment as Segment, index$j_SegmentIndex as SegmentIndex, index$j_ServiceGas as ServiceGas, index$j_ServiceId as ServiceId, index$j_StateRootHash as StateRootHash, index$j_TicketsMarkerView as TicketsMarkerView, index$j_TimeSlot as TimeSlot, index$j_ValidatorIndex as ValidatorIndex, index$j_WorkReportHash as WorkReportHash };
|
|
6891
6919
|
}
|
|
6892
6920
|
|
|
6893
6921
|
/** A type that can be read from a JSON-parsed object. */
|
|
@@ -7629,7 +7657,7 @@ declare const epochMark = json.object<JsonEpochMarker, EpochMarker>(
|
|
|
7629
7657
|
(x) => EpochMarker.create({ entropy: x.entropy, ticketsEntropy: x.tickets_entropy, validators: x.validators }),
|
|
7630
7658
|
);
|
|
7631
7659
|
|
|
7632
|
-
declare const
|
|
7660
|
+
declare const ticket = json.object<Ticket>(
|
|
7633
7661
|
{
|
|
7634
7662
|
id: fromJson.bytes32(),
|
|
7635
7663
|
attempt: fromJson.ticketAttempt,
|
|
@@ -7643,7 +7671,7 @@ type JsonHeader = {
|
|
|
7643
7671
|
extrinsic_hash: ExtrinsicHash;
|
|
7644
7672
|
slot: TimeSlot;
|
|
7645
7673
|
epoch_mark?: EpochMarker;
|
|
7646
|
-
tickets_mark?:
|
|
7674
|
+
tickets_mark?: Ticket[];
|
|
7647
7675
|
offenders_mark: Ed25519Key[];
|
|
7648
7676
|
author_index: ValidatorIndex;
|
|
7649
7677
|
entropy_source: BandersnatchVrfSignature;
|
|
@@ -7657,7 +7685,7 @@ declare const headerFromJson = json.object<JsonHeader, Header>(
|
|
|
7657
7685
|
extrinsic_hash: fromJson.bytes32(),
|
|
7658
7686
|
slot: "number",
|
|
7659
7687
|
epoch_mark: json.optional(epochMark),
|
|
7660
|
-
tickets_mark: json.optional
|
|
7688
|
+
tickets_mark: json.optional(json.array(ticket)),
|
|
7661
7689
|
offenders_mark: json.array(fromJson.bytes32<Ed25519Key>()),
|
|
7662
7690
|
author_index: "number",
|
|
7663
7691
|
entropy_source: bandersnatchVrfSignature,
|
|
@@ -7681,7 +7709,10 @@ declare const headerFromJson = json.object<JsonHeader, Header>(
|
|
|
7681
7709
|
header.extrinsicHash = extrinsic_hash;
|
|
7682
7710
|
header.timeSlotIndex = slot;
|
|
7683
7711
|
header.epochMarker = epoch_mark ?? null;
|
|
7684
|
-
header.ticketsMarker =
|
|
7712
|
+
header.ticketsMarker =
|
|
7713
|
+
tickets_mark === undefined || tickets_mark === null
|
|
7714
|
+
? null
|
|
7715
|
+
: TicketsMarker.create({ tickets: asOpaqueType(tickets_mark) });
|
|
7685
7716
|
header.offendersMarker = offenders_mark;
|
|
7686
7717
|
header.bandersnatchBlockAuthorIndex = author_index;
|
|
7687
7718
|
header.entropySource = entropy_source;
|
|
@@ -7731,9 +7762,9 @@ declare const index$h_preimagesExtrinsicFromJson: typeof preimagesExtrinsicFromJ
|
|
|
7731
7762
|
declare const index$h_refineContextFromJson: typeof refineContextFromJson;
|
|
7732
7763
|
declare const index$h_reportGuaranteeFromJson: typeof reportGuaranteeFromJson;
|
|
7733
7764
|
declare const index$h_segmentRootLookupItemFromJson: typeof segmentRootLookupItemFromJson;
|
|
7765
|
+
declare const index$h_ticket: typeof ticket;
|
|
7734
7766
|
declare const index$h_ticketEnvelopeFromJson: typeof ticketEnvelopeFromJson;
|
|
7735
7767
|
declare const index$h_ticketsExtrinsicFromJson: typeof ticketsExtrinsicFromJson;
|
|
7736
|
-
declare const index$h_ticketsMark: typeof ticketsMark;
|
|
7737
7768
|
declare const index$h_validatorKeysFromJson: typeof validatorKeysFromJson;
|
|
7738
7769
|
declare const index$h_validatorSignatureFromJson: typeof validatorSignatureFromJson;
|
|
7739
7770
|
declare const index$h_verdictFromJson: typeof verdictFromJson;
|
|
@@ -7743,7 +7774,7 @@ declare const index$h_workRefineLoadFromJson: typeof workRefineLoadFromJson;
|
|
|
7743
7774
|
declare const index$h_workReportFromJson: typeof workReportFromJson;
|
|
7744
7775
|
declare const index$h_workResultFromJson: typeof workResultFromJson;
|
|
7745
7776
|
declare namespace index$h {
|
|
7746
|
-
export { index$h_bandersnatchVrfSignature as bandersnatchVrfSignature, index$h_blockFromJson as blockFromJson, index$h_culpritFromJson as culpritFromJson, index$h_disputesExtrinsicFromJson as disputesExtrinsicFromJson, index$h_epochMark as epochMark, index$h_faultFromJson as faultFromJson, index$h_fromJson as fromJson, index$h_getAssurancesExtrinsicFromJson as getAssurancesExtrinsicFromJson, index$h_getAvailabilityAssuranceFromJson as getAvailabilityAssuranceFromJson, index$h_getExtrinsicFromJson as getExtrinsicFromJson, index$h_guaranteesExtrinsicFromJson as guaranteesExtrinsicFromJson, index$h_headerFromJson as headerFromJson, index$h_judgementFromJson as judgementFromJson, index$h_preimageFromJson as preimageFromJson, index$h_preimagesExtrinsicFromJson as preimagesExtrinsicFromJson, index$h_refineContextFromJson as refineContextFromJson, index$h_reportGuaranteeFromJson as reportGuaranteeFromJson, index$h_segmentRootLookupItemFromJson as segmentRootLookupItemFromJson, index$
|
|
7777
|
+
export { index$h_bandersnatchVrfSignature as bandersnatchVrfSignature, index$h_blockFromJson as blockFromJson, index$h_culpritFromJson as culpritFromJson, index$h_disputesExtrinsicFromJson as disputesExtrinsicFromJson, index$h_epochMark as epochMark, index$h_faultFromJson as faultFromJson, index$h_fromJson as fromJson, index$h_getAssurancesExtrinsicFromJson as getAssurancesExtrinsicFromJson, index$h_getAvailabilityAssuranceFromJson as getAvailabilityAssuranceFromJson, index$h_getExtrinsicFromJson as getExtrinsicFromJson, index$h_guaranteesExtrinsicFromJson as guaranteesExtrinsicFromJson, index$h_headerFromJson as headerFromJson, index$h_judgementFromJson as judgementFromJson, index$h_preimageFromJson as preimageFromJson, index$h_preimagesExtrinsicFromJson as preimagesExtrinsicFromJson, index$h_refineContextFromJson as refineContextFromJson, index$h_reportGuaranteeFromJson as reportGuaranteeFromJson, index$h_segmentRootLookupItemFromJson as segmentRootLookupItemFromJson, index$h_ticket as ticket, index$h_ticketEnvelopeFromJson as ticketEnvelopeFromJson, index$h_ticketsExtrinsicFromJson as ticketsExtrinsicFromJson, index$h_validatorKeysFromJson as validatorKeysFromJson, index$h_validatorSignatureFromJson as validatorSignatureFromJson, index$h_verdictFromJson as verdictFromJson, index$h_workExecResultFromJson as workExecResultFromJson, index$h_workPackageSpecFromJson as workPackageSpecFromJson, index$h_workRefineLoadFromJson as workRefineLoadFromJson, index$h_workReportFromJson as workReportFromJson, index$h_workResultFromJson as workResultFromJson };
|
|
7747
7778
|
export type { index$h_CamelToSnake as CamelToSnake, index$h_JsonCulprit as JsonCulprit, index$h_JsonEpochMarker as JsonEpochMarker, index$h_JsonFault as JsonFault, index$h_JsonHeader as JsonHeader, index$h_JsonJudgement as JsonJudgement, index$h_JsonObject as JsonObject, index$h_JsonRefineContext as JsonRefineContext, index$h_JsonReportGuarantee as JsonReportGuarantee, index$h_JsonVerdict as JsonVerdict, index$h_JsonWorkExecResult as JsonWorkExecResult, index$h_JsonWorkRefineLoad as JsonWorkRefineLoad, index$h_JsonWorkReport as JsonWorkReport, index$h_JsonWorkResult as JsonWorkResult };
|
|
7748
7779
|
}
|
|
7749
7780
|
|
package/index.js
CHANGED
|
@@ -5641,6 +5641,8 @@ class ChainSpec extends WithDebug {
|
|
|
5641
5641
|
maxBlockGas;
|
|
5642
5642
|
/** `G_R`: The gas allocated to invoke a work-package’s Refine logic. */
|
|
5643
5643
|
maxRefineGas;
|
|
5644
|
+
/** `L`: The maximum age in timeslots of the lookup anchor. */
|
|
5645
|
+
maxLookupAnchorAge;
|
|
5644
5646
|
constructor(data) {
|
|
5645
5647
|
super();
|
|
5646
5648
|
this.validatorsCount = data.validatorsCount;
|
|
@@ -5658,6 +5660,7 @@ class ChainSpec extends WithDebug {
|
|
|
5658
5660
|
this.erasureCodedPieceSize = tryAsU32(EC_SEGMENT_SIZE / data.numberECPiecesPerSegment);
|
|
5659
5661
|
this.maxBlockGas = data.maxBlockGas;
|
|
5660
5662
|
this.maxRefineGas = data.maxRefineGas;
|
|
5663
|
+
this.maxLookupAnchorAge = data.maxLookupAnchorAge;
|
|
5661
5664
|
}
|
|
5662
5665
|
}
|
|
5663
5666
|
/** Set of values for "tiny" chain as defined in JAM test vectors. */
|
|
@@ -5675,6 +5678,8 @@ const tinyChainSpec = new ChainSpec({
|
|
|
5675
5678
|
preimageExpungePeriod: tryAsU32(32),
|
|
5676
5679
|
maxBlockGas: tryAsU64(20_000_000),
|
|
5677
5680
|
maxRefineGas: tryAsU64(1_000_000_000),
|
|
5681
|
+
// https://github.com/davxy/jam-conformance/pull/47/files#diff-27e26142b3a96e407dab40d388b63d553f5d9cdb66dec58cd93e63dd434f9e45R260
|
|
5682
|
+
maxLookupAnchorAge: tryAsU32(24),
|
|
5678
5683
|
});
|
|
5679
5684
|
/**
|
|
5680
5685
|
* Set of values for "full" chain as defined in JAM test vectors.
|
|
@@ -5693,6 +5698,7 @@ const fullChainSpec = new ChainSpec({
|
|
|
5693
5698
|
preimageExpungePeriod: tryAsU32(19_200),
|
|
5694
5699
|
maxBlockGas: tryAsU64(3_500_000_000),
|
|
5695
5700
|
maxRefineGas: tryAsU64(5_000_000_000),
|
|
5701
|
+
maxLookupAnchorAge: tryAsU32(14_400),
|
|
5696
5702
|
});
|
|
5697
5703
|
|
|
5698
5704
|
/**
|
|
@@ -6938,6 +6944,19 @@ class ValidatorKeys extends WithDebug {
|
|
|
6938
6944
|
this.ed25519 = ed25519;
|
|
6939
6945
|
}
|
|
6940
6946
|
}
|
|
6947
|
+
class TicketsMarker extends WithDebug {
|
|
6948
|
+
tickets;
|
|
6949
|
+
static Codec = codec$1.Class(TicketsMarker, {
|
|
6950
|
+
tickets: codecPerEpochBlock(Ticket.Codec),
|
|
6951
|
+
});
|
|
6952
|
+
static create({ tickets }) {
|
|
6953
|
+
return new TicketsMarker(tickets);
|
|
6954
|
+
}
|
|
6955
|
+
constructor(tickets) {
|
|
6956
|
+
super();
|
|
6957
|
+
this.tickets = tickets;
|
|
6958
|
+
}
|
|
6959
|
+
}
|
|
6941
6960
|
/**
|
|
6942
6961
|
* For the first block in a new epoch, the epoch marker is set
|
|
6943
6962
|
* and contains the epoch randomness and validator keys
|
|
@@ -6991,7 +7010,7 @@ const legacyDescriptor = {
|
|
|
6991
7010
|
extrinsicHash: codec$1.bytes(HASH_SIZE).asOpaque(),
|
|
6992
7011
|
timeSlotIndex: codec$1.u32.asOpaque(),
|
|
6993
7012
|
epochMarker: codec$1.optional(EpochMarker.Codec),
|
|
6994
|
-
ticketsMarker: codec$1.optional(
|
|
7013
|
+
ticketsMarker: codec$1.optional(TicketsMarker.Codec),
|
|
6995
7014
|
offendersMarker: codec$1.sequenceVarLen(codec$1.bytes(ED25519_KEY_BYTES).asOpaque()),
|
|
6996
7015
|
bandersnatchBlockAuthorIndex: codec$1.u16.asOpaque(),
|
|
6997
7016
|
entropySource: codec$1.bytes(BANDERSNATCH_VRF_SIGNATURE_BYTES).asOpaque(),
|
|
@@ -7011,7 +7030,7 @@ class Header extends WithDebug {
|
|
|
7011
7030
|
extrinsicHash: codec$1.bytes(HASH_SIZE).asOpaque(),
|
|
7012
7031
|
timeSlotIndex: codec$1.u32.asOpaque(),
|
|
7013
7032
|
epochMarker: codec$1.optional(EpochMarker.Codec),
|
|
7014
|
-
ticketsMarker: codec$1.optional(
|
|
7033
|
+
ticketsMarker: codec$1.optional(TicketsMarker.Codec),
|
|
7015
7034
|
bandersnatchBlockAuthorIndex: codec$1.u16.asOpaque(),
|
|
7016
7035
|
entropySource: codec$1.bytes(BANDERSNATCH_VRF_SIGNATURE_BYTES).asOpaque(),
|
|
7017
7036
|
offendersMarker: codec$1.sequenceVarLen(codec$1.bytes(ED25519_KEY_BYTES).asOpaque()),
|
|
@@ -7206,6 +7225,7 @@ var index$j = /*#__PURE__*/Object.freeze({
|
|
|
7206
7225
|
Header: Header,
|
|
7207
7226
|
MAX_NUMBER_OF_SEGMENTS: MAX_NUMBER_OF_SEGMENTS,
|
|
7208
7227
|
SEGMENT_BYTES: SEGMENT_BYTES,
|
|
7228
|
+
TicketsMarker: TicketsMarker,
|
|
7209
7229
|
ValidatorKeys: ValidatorKeys,
|
|
7210
7230
|
assurances: assurances,
|
|
7211
7231
|
codecPerEpochBlock: codecPerEpochBlock,
|
|
@@ -7684,7 +7704,7 @@ const epochMark = json.object({
|
|
|
7684
7704
|
tickets_entropy: fromJson.bytes32(),
|
|
7685
7705
|
validators: json.array(validatorKeysFromJson),
|
|
7686
7706
|
}, (x) => EpochMarker.create({ entropy: x.entropy, ticketsEntropy: x.tickets_entropy, validators: x.validators }));
|
|
7687
|
-
const
|
|
7707
|
+
const ticket = json.object({
|
|
7688
7708
|
id: fromJson.bytes32(),
|
|
7689
7709
|
attempt: fromJson.ticketAttempt,
|
|
7690
7710
|
}, (x) => Ticket.create({ id: x.id, attempt: x.attempt }));
|
|
@@ -7694,7 +7714,7 @@ const headerFromJson = json.object({
|
|
|
7694
7714
|
extrinsic_hash: fromJson.bytes32(),
|
|
7695
7715
|
slot: "number",
|
|
7696
7716
|
epoch_mark: json.optional(epochMark),
|
|
7697
|
-
tickets_mark: json.optional(json.array(
|
|
7717
|
+
tickets_mark: json.optional(json.array(ticket)),
|
|
7698
7718
|
offenders_mark: json.array(fromJson.bytes32()),
|
|
7699
7719
|
author_index: "number",
|
|
7700
7720
|
entropy_source: bandersnatchVrfSignature,
|
|
@@ -7706,7 +7726,10 @@ const headerFromJson = json.object({
|
|
|
7706
7726
|
header.extrinsicHash = extrinsic_hash;
|
|
7707
7727
|
header.timeSlotIndex = slot;
|
|
7708
7728
|
header.epochMarker = epoch_mark ?? null;
|
|
7709
|
-
header.ticketsMarker =
|
|
7729
|
+
header.ticketsMarker =
|
|
7730
|
+
tickets_mark === undefined || tickets_mark === null
|
|
7731
|
+
? null
|
|
7732
|
+
: TicketsMarker.create({ tickets: asOpaqueType(tickets_mark) });
|
|
7710
7733
|
header.offendersMarker = offenders_mark;
|
|
7711
7734
|
header.bandersnatchBlockAuthorIndex = author_index;
|
|
7712
7735
|
header.entropySource = entropy_source;
|