@typeberry/lib 0.5.0-2b5df1a → 0.5.0-3211f3e
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.cjs +463 -319
- package/index.d.ts +112 -51
- package/index.js +463 -319
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1960,6 +1960,8 @@ declare class TruncatedHashDictionary<T extends OpaqueHash, V> {
|
|
|
1960
1960
|
set(key: T | TruncatedHash, value: V): void;
|
|
1961
1961
|
/** Remove a value that matches the key on `TRUNCATED_HASH_SIZE`. */
|
|
1962
1962
|
delete(key: T | TruncatedHash): void;
|
|
1963
|
+
/** Iterator over keys of the dictionary. */
|
|
1964
|
+
keys(): Iterator<TruncatedHash, any, any> & Iterable<TruncatedHash>;
|
|
1963
1965
|
/** Iterator over values of the dictionary. */
|
|
1964
1966
|
values(): Iterator<V, any, any> & Iterable<V>;
|
|
1965
1967
|
/** Iterator over entries of the dictionary (with truncated keys) */
|
|
@@ -2005,21 +2007,43 @@ declare namespace index$v {
|
|
|
2005
2007
|
}
|
|
2006
2008
|
|
|
2007
2009
|
declare namespace bandersnatch_d_exports {
|
|
2008
|
-
export { batch_verify_tickets, __wbg_init$2 as default, derive_public_key, initSync$2 as initSync, ring_commitment, verify_seal };
|
|
2010
|
+
export { batch_verify_tickets, __wbg_init$2 as default, derive_public_key, generate_seal, initSync$2 as initSync, ring_commitment, verify_seal, vrf_output_hash };
|
|
2009
2011
|
export type { InitInput$2 as InitInput, InitOutput$2 as InitOutput, SyncInitInput$2 as SyncInitInput };
|
|
2010
2012
|
}
|
|
2011
2013
|
/* tslint:disable */
|
|
2012
2014
|
/* eslint-disable */
|
|
2013
2015
|
/**
|
|
2014
|
-
*
|
|
2016
|
+
* Compute VRF output hash from a secret seed and input data.
|
|
2017
|
+
*
|
|
2018
|
+
* This function derives a deterministic VRF output hash without generating a proof.
|
|
2019
|
+
* Unlike `generate_seal`, this produces only the output hash, not a verifiable signature.
|
|
2020
|
+
*
|
|
2021
|
+
* # Arguments
|
|
2022
|
+
* * `secret_seed` - Seed used to derive the secret key
|
|
2023
|
+
* * `input` - VRF input data to be hashed
|
|
2024
|
+
*
|
|
2025
|
+
* # Returns
|
|
2026
|
+
* A byte vector with the following format:
|
|
2027
|
+
* - On success (33 bytes):
|
|
2028
|
+
* - Byte 0: Status code `0` (RESULT_OK)
|
|
2029
|
+
* - Bytes 1-32: VRF output hash (32 bytes)
|
|
2030
|
+
* - On error (1 byte):
|
|
2031
|
+
* - Byte 0: Status code `1` (RESULT_ERR)
|
|
2032
|
+
*
|
|
2033
|
+
* Returns an error if the input cannot be converted to a valid VRF input point.
|
|
2015
2034
|
*/
|
|
2016
|
-
declare function
|
|
2035
|
+
declare function vrf_output_hash(secret_seed: Uint8Array, input: Uint8Array): Uint8Array;
|
|
2017
2036
|
/**
|
|
2018
|
-
*
|
|
2037
|
+
* Verify multiple tickets at once as defined in:
|
|
2038
|
+
* https://graypaper.fluffylabs.dev/#/68eaa1f/0f3e000f3e00?v=0.6.4
|
|
2019
2039
|
*
|
|
2020
|
-
*
|
|
2040
|
+
* NOTE: the aux_data of VRF function is empty!
|
|
2021
2041
|
*/
|
|
2022
|
-
declare function
|
|
2042
|
+
declare function batch_verify_tickets(ring_size: number, commitment: Uint8Array, tickets_data: Uint8Array, vrf_input_data_len: number): Uint8Array;
|
|
2043
|
+
/**
|
|
2044
|
+
* Generate ring commitment given concatenation of ring keys.
|
|
2045
|
+
*/
|
|
2046
|
+
declare function ring_commitment(keys: Uint8Array): Uint8Array;
|
|
2023
2047
|
/**
|
|
2024
2048
|
* Seal verification as defined in:
|
|
2025
2049
|
* https://graypaper.fluffylabs.dev/#/68eaa1f/0eff000eff00?v=0.6.4
|
|
@@ -2028,19 +2052,41 @@ declare function derive_public_key(seed: Uint8Array): Uint8Array;
|
|
|
2028
2052
|
*/
|
|
2029
2053
|
declare function verify_seal(signer_key: Uint8Array, seal_data: Uint8Array, payload: Uint8Array, aux_data: Uint8Array): Uint8Array;
|
|
2030
2054
|
/**
|
|
2031
|
-
*
|
|
2032
|
-
* https://graypaper.fluffylabs.dev/#/68eaa1f/0f3e000f3e00?v=0.6.4
|
|
2055
|
+
* Generate seal that is verifiable using `verify_seal` function.
|
|
2033
2056
|
*
|
|
2034
|
-
*
|
|
2057
|
+
* # Arguments
|
|
2058
|
+
* * `secret_seed` - Seed used to derive the secret key
|
|
2059
|
+
* * `input` - VRF input data
|
|
2060
|
+
* * `aux_data` - Auxiliary data for the VRF proof
|
|
2061
|
+
*
|
|
2062
|
+
* # Returns
|
|
2063
|
+
* A byte vector with the following format:
|
|
2064
|
+
* - On success (97 bytes):
|
|
2065
|
+
* - Byte 0: Status code `0` (RESULT_OK)
|
|
2066
|
+
* - Bytes 1-32: Serialized VRF output (32 bytes, compressed) NOTE: not output hash!
|
|
2067
|
+
* - Bytes 33-96: Serialized IETF VRF proof (64 bytes, compressed)
|
|
2068
|
+
* - On error (1 byte):
|
|
2069
|
+
* - Byte 0: Status code `1` (RESULT_ERR)
|
|
2070
|
+
*
|
|
2071
|
+
* Returns an error if the input cannot be converted to a valid VRF input point
|
|
2072
|
+
* or if serialization of the output or proof fails.
|
|
2035
2073
|
*/
|
|
2036
|
-
declare function
|
|
2074
|
+
declare function generate_seal(secret_seed: Uint8Array, input: Uint8Array, aux_data: Uint8Array): Uint8Array;
|
|
2075
|
+
/**
|
|
2076
|
+
* Derive Private and Public Key from Seed
|
|
2077
|
+
*
|
|
2078
|
+
* returns: `Vec<u8>` containing the exit (1 byte) status followed by the (32 bytes) public key
|
|
2079
|
+
*/
|
|
2080
|
+
declare function derive_public_key(seed: Uint8Array): Uint8Array;
|
|
2037
2081
|
type InitInput$2 = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
2038
2082
|
interface InitOutput$2 {
|
|
2039
2083
|
readonly memory: WebAssembly.Memory;
|
|
2040
|
-
readonly
|
|
2084
|
+
readonly batch_verify_tickets: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
2041
2085
|
readonly derive_public_key: (a: number, b: number) => [number, number];
|
|
2086
|
+
readonly generate_seal: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
2087
|
+
readonly ring_commitment: (a: number, b: number) => [number, number];
|
|
2042
2088
|
readonly verify_seal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
|
|
2043
|
-
readonly
|
|
2089
|
+
readonly vrf_output_hash: (a: number, b: number, c: number, d: number) => [number, number];
|
|
2044
2090
|
readonly __wbindgen_export_0: WebAssembly.Table;
|
|
2045
2091
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
2046
2092
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
@@ -2723,35 +2769,35 @@ declare class Header extends WithDebug {
|
|
|
2723
2769
|
*
|
|
2724
2770
|
* In case of the genesis block, the hash will be zero.
|
|
2725
2771
|
*/
|
|
2726
|
-
parentHeaderHash: HeaderHash;
|
|
2772
|
+
readonly parentHeaderHash: HeaderHash;
|
|
2727
2773
|
/** `H_r`: The state trie root hash before executing that block. */
|
|
2728
|
-
priorStateRoot: StateRootHash;
|
|
2774
|
+
readonly priorStateRoot: StateRootHash;
|
|
2729
2775
|
/** `H_x`: The hash of block extrinsic. */
|
|
2730
|
-
extrinsicHash: ExtrinsicHash;
|
|
2776
|
+
readonly extrinsicHash: ExtrinsicHash;
|
|
2731
2777
|
/** `H_t`: JAM time-slot index. */
|
|
2732
|
-
timeSlotIndex: TimeSlot;
|
|
2778
|
+
readonly timeSlotIndex: TimeSlot;
|
|
2733
2779
|
/**
|
|
2734
2780
|
* `H_e`: Key and entropy relevant to the following epoch in case the ticket
|
|
2735
2781
|
* contest does not complete adequately.
|
|
2736
2782
|
*/
|
|
2737
|
-
epochMarker: EpochMarker | null;
|
|
2783
|
+
readonly epochMarker: EpochMarker | null;
|
|
2738
2784
|
/**
|
|
2739
2785
|
* `H_w`: Winning tickets provides the series of 600 slot sealing "tickets"
|
|
2740
2786
|
* for the next epoch.
|
|
2741
2787
|
*/
|
|
2742
|
-
ticketsMarker: TicketsMarker | null;
|
|
2788
|
+
readonly ticketsMarker: TicketsMarker | null;
|
|
2743
2789
|
/** `H_i`: Block author's index in the current validator set. */
|
|
2744
|
-
bandersnatchBlockAuthorIndex: ValidatorIndex;
|
|
2790
|
+
readonly bandersnatchBlockAuthorIndex: ValidatorIndex;
|
|
2745
2791
|
/** `H_v`: Entropy-yielding VRF signature. */
|
|
2746
|
-
entropySource: BandersnatchVrfSignature;
|
|
2792
|
+
readonly entropySource: BandersnatchVrfSignature;
|
|
2747
2793
|
/** `H_o`: Sequence of keys of newly misbehaving validators. */
|
|
2748
|
-
offendersMarker: Ed25519Key[];
|
|
2794
|
+
readonly offendersMarker: Ed25519Key[];
|
|
2749
2795
|
/**
|
|
2750
2796
|
* `H_s`: Block seal.
|
|
2751
2797
|
*
|
|
2752
2798
|
* https://graypaper.fluffylabs.dev/#/579bd12/0d0c010d1101
|
|
2753
2799
|
*/
|
|
2754
|
-
seal: BandersnatchVrfSignature;
|
|
2800
|
+
readonly seal: BandersnatchVrfSignature;
|
|
2755
2801
|
private constructor();
|
|
2756
2802
|
/** Create an empty header with some dummy values. */
|
|
2757
2803
|
static empty(): Header;
|
|
@@ -3557,7 +3603,7 @@ declare namespace workReport {
|
|
|
3557
3603
|
* Since GP defines that value explicitly as "two or three",
|
|
3558
3604
|
* we do that as well.
|
|
3559
3605
|
*
|
|
3560
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
3606
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/152b01152d01?v=0.7.2
|
|
3561
3607
|
*/
|
|
3562
3608
|
type REQUIRED_CREDENTIALS = 2 | 3;
|
|
3563
3609
|
declare const REQUIRED_CREDENTIALS_RANGE: number[];
|
|
@@ -3577,7 +3623,7 @@ declare class Credential extends WithDebug {
|
|
|
3577
3623
|
/**
|
|
3578
3624
|
* Tuple of work-report, a credential and it's corresponding timeslot.
|
|
3579
3625
|
*
|
|
3580
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
3626
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/15df00150301?v=0.7.2
|
|
3581
3627
|
*/
|
|
3582
3628
|
declare class ReportGuarantee extends WithDebug {
|
|
3583
3629
|
/** The work-report being guaranteed. */
|
|
@@ -3589,7 +3635,7 @@ declare class ReportGuarantee extends WithDebug {
|
|
|
3589
3635
|
* validator index and a signature.
|
|
3590
3636
|
* Credentials must be ordered by their validator index.
|
|
3591
3637
|
*
|
|
3592
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
3638
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/152b01152d01?v=0.7.2
|
|
3593
3639
|
*/
|
|
3594
3640
|
readonly credentials: KnownSizeArray<Credential, `${REQUIRED_CREDENTIALS}`>;
|
|
3595
3641
|
static Codec: Descriptor<ReportGuarantee, ViewOf<ReportGuarantee, {
|
|
@@ -3648,7 +3694,7 @@ declare const GuaranteesExtrinsicBounds = "[0..CoresCount)";
|
|
|
3648
3694
|
* Each core index (within work-report) must be unique and guarantees
|
|
3649
3695
|
* must be in ascending order of this.
|
|
3650
3696
|
*
|
|
3651
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
3697
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/15d10015d400?v=0.7.2
|
|
3652
3698
|
*/
|
|
3653
3699
|
type GuaranteesExtrinsic = KnownSizeArray<ReportGuarantee, typeof GuaranteesExtrinsicBounds>;
|
|
3654
3700
|
declare const guaranteesExtrinsicCodec: Descriptor<readonly ReportGuarantee[] & WithOpaque<"[0..CoresCount)">, SequenceView<ReportGuarantee, ViewOf<ReportGuarantee, {
|
|
@@ -4264,10 +4310,8 @@ declare class JipChainSpec extends WithDebug {
|
|
|
4264
4310
|
|
|
4265
4311
|
/** Block authorship options. */
|
|
4266
4312
|
declare class AuthorshipOptions {
|
|
4267
|
-
/** Use fake seal verification instead of running bandersnatch. */
|
|
4268
|
-
readonly omitSealVerification: boolean;
|
|
4269
4313
|
static fromJson: FromJsonWithParser<unknown, AuthorshipOptions>;
|
|
4270
|
-
static new(
|
|
4314
|
+
static new(): AuthorshipOptions;
|
|
4271
4315
|
private constructor();
|
|
4272
4316
|
}
|
|
4273
4317
|
|
|
@@ -6195,7 +6239,7 @@ declare function serializeStateUpdate(spec: ChainSpec, blake2b: Blake2b, update:
|
|
|
6195
6239
|
* State entries may be wrapped into `SerializedState` to access the contained values.
|
|
6196
6240
|
*/
|
|
6197
6241
|
declare class StateEntries {
|
|
6198
|
-
private readonly
|
|
6242
|
+
private readonly dictionary;
|
|
6199
6243
|
static Codec: Descriptor<StateEntries, StateEntries>;
|
|
6200
6244
|
/** Turn in-memory state into it's serialized form. */
|
|
6201
6245
|
static serializeInMemory(spec: ChainSpec, blake2b: Blake2b, state: InMemoryState): StateEntries;
|
|
@@ -6216,6 +6260,12 @@ declare class StateEntries {
|
|
|
6216
6260
|
private constructor();
|
|
6217
6261
|
/** When comparing, we can safely ignore `trieCache` and just use entries. */
|
|
6218
6262
|
[TEST_COMPARE_USING](): any;
|
|
6263
|
+
/** Iterator over entries */
|
|
6264
|
+
entries(): Generator<[TruncatedHash, BytesBlob]>;
|
|
6265
|
+
/** Iterator over entries keys */
|
|
6266
|
+
keys(): Generator<TruncatedHash>;
|
|
6267
|
+
/** Iterator over entries values */
|
|
6268
|
+
values(): Generator<BytesBlob>;
|
|
6219
6269
|
/** Dump state entries to JSON string (format compatible with stf vectors). */
|
|
6220
6270
|
toString(): string;
|
|
6221
6271
|
[Symbol.iterator](): Generator<[TruncatedHash, BytesBlob], any, any>;
|
|
@@ -7220,12 +7270,12 @@ declare class DirectWorkerConfig<TParams = void, TBlocks = BlocksDb, TStates = S
|
|
|
7220
7270
|
readonly workerParams: TParams;
|
|
7221
7271
|
private readonly blocksDb;
|
|
7222
7272
|
private readonly statesDb;
|
|
7223
|
-
static new<T, B, S>({ nodeName, chainSpec, blocksDb, statesDb, params, }: {
|
|
7273
|
+
static new<T, B, S>({ nodeName, chainSpec, blocksDb, statesDb, workerParams: params, }: {
|
|
7224
7274
|
nodeName: string;
|
|
7225
7275
|
chainSpec: ChainSpec;
|
|
7226
7276
|
blocksDb: B;
|
|
7227
7277
|
statesDb: S;
|
|
7228
|
-
|
|
7278
|
+
workerParams: T;
|
|
7229
7279
|
}): DirectWorkerConfig<T, B, S>;
|
|
7230
7280
|
private constructor();
|
|
7231
7281
|
openDatabase(_options?: {
|
|
@@ -9165,6 +9215,8 @@ type Input = {
|
|
|
9165
9215
|
* https://graypaper.fluffylabs.dev/#/cc517d7/18dd0018dd00?v=0.6.5
|
|
9166
9216
|
*/
|
|
9167
9217
|
transferStatistics: Map<ServiceId, CountAndGasUsed>;
|
|
9218
|
+
reporters: readonly Ed25519Key[];
|
|
9219
|
+
currentValidatorData: State["currentValidatorData"];
|
|
9168
9220
|
};
|
|
9169
9221
|
type CountAndGasUsed = {
|
|
9170
9222
|
count: U32;
|
|
@@ -9231,14 +9283,19 @@ type AccumulateResult = {
|
|
|
9231
9283
|
accumulationOutputLog: SortedArray<AccumulationOutput>;
|
|
9232
9284
|
};
|
|
9233
9285
|
|
|
9286
|
+
type AccumulateOptions = {
|
|
9287
|
+
pvm: PvmBackend;
|
|
9288
|
+
accumulateSequentially: boolean;
|
|
9289
|
+
};
|
|
9290
|
+
|
|
9234
9291
|
declare const ACCUMULATION_ERROR = "duplicate service created";
|
|
9235
9292
|
type ACCUMULATION_ERROR = typeof ACCUMULATION_ERROR;
|
|
9236
9293
|
declare class Accumulate {
|
|
9237
9294
|
readonly chainSpec: ChainSpec;
|
|
9238
9295
|
readonly blake2b: Blake2b;
|
|
9239
9296
|
readonly state: AccumulateState;
|
|
9240
|
-
readonly
|
|
9241
|
-
constructor(chainSpec: ChainSpec, blake2b: Blake2b, state: AccumulateState,
|
|
9297
|
+
readonly options: AccumulateOptions;
|
|
9298
|
+
constructor(chainSpec: ChainSpec, blake2b: Blake2b, state: AccumulateState, options: AccumulateOptions);
|
|
9242
9299
|
/**
|
|
9243
9300
|
* Returns an index that determines how many WorkReports can be processed before exceeding a given gasLimit.
|
|
9244
9301
|
*
|
|
@@ -9677,38 +9734,43 @@ interface HeaderChain {
|
|
|
9677
9734
|
* by validators).
|
|
9678
9735
|
*
|
|
9679
9736
|
* After enough assurances the work-report is considered available,
|
|
9680
|
-
* and the work
|
|
9737
|
+
* and the work-digests transform the state of their associated
|
|
9681
9738
|
* service by virtue of accumulation, covered in section 12.
|
|
9682
9739
|
* The report may also be timed-out, implying it may be replaced
|
|
9683
9740
|
* by another report without accumulation.
|
|
9684
9741
|
*
|
|
9685
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
9742
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/138801138d01?v=0.7.2
|
|
9686
9743
|
*/
|
|
9687
9744
|
type ReportsInput = {
|
|
9688
9745
|
/**
|
|
9689
9746
|
* A work-package, is transformed by validators acting as
|
|
9690
9747
|
* guarantors into its corresponding work-report, which
|
|
9691
|
-
* similarly comprises several work
|
|
9748
|
+
* similarly comprises several work-digests and then
|
|
9692
9749
|
* presented on-chain within the guarantees extrinsic.
|
|
9693
9750
|
*
|
|
9694
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
9751
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/138001138401?v=0.7.2
|
|
9695
9752
|
*/
|
|
9696
9753
|
guarantees: GuaranteesExtrinsicView;
|
|
9697
9754
|
/** Current time slot, excerpted from block header. */
|
|
9698
9755
|
slot: TimeSlot;
|
|
9699
9756
|
/** `eta_prime`: New entropy, after potential epoch transition. */
|
|
9700
9757
|
newEntropy: SafroleStateUpdate["entropy"];
|
|
9701
|
-
/**
|
|
9758
|
+
/**
|
|
9759
|
+
* β† - Partial update of recent blocks.
|
|
9760
|
+
*
|
|
9761
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/0f56020f6b02?v=0.7.2
|
|
9762
|
+
*/
|
|
9702
9763
|
recentBlocksPartialUpdate: RecentHistoryStateUpdate["recentBlocks"];
|
|
9703
9764
|
/**
|
|
9704
9765
|
* ρ‡ - Availability assignment resulting from assurances transition
|
|
9705
|
-
*
|
|
9766
|
+
*
|
|
9767
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/141302144402?v=0.7.2
|
|
9706
9768
|
*/
|
|
9707
9769
|
assurancesAvailAssignment: AssurancesStateUpdate["availabilityAssignment"];
|
|
9708
9770
|
/**
|
|
9709
9771
|
* ψ′O - Ed25519 keys of validators that were proven to judge incorrectly.
|
|
9710
9772
|
*
|
|
9711
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
9773
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/134201134201?v=0.7.2
|
|
9712
9774
|
*/
|
|
9713
9775
|
offenders: HashSet<Ed25519Key>;
|
|
9714
9776
|
};
|
|
@@ -9730,7 +9792,7 @@ type ReportsOutput = {
|
|
|
9730
9792
|
* This dictionary has the same number of items as in the input guarantees extrinsic.
|
|
9731
9793
|
*/
|
|
9732
9794
|
reported: HashDictionary<WorkPackageHash, WorkPackageInfo>;
|
|
9733
|
-
/** A set `
|
|
9795
|
+
/** A set `M` of work package reporters. */
|
|
9734
9796
|
reporters: KnownSizeArray<Ed25519Key, "Guarantees * Credentials (at most `cores*3`)">;
|
|
9735
9797
|
};
|
|
9736
9798
|
declare class Reports {
|
|
@@ -9749,7 +9811,7 @@ declare class Reports {
|
|
|
9749
9811
|
* Get the guarantor assignment (both core and validator data)
|
|
9750
9812
|
* depending on the rotation.
|
|
9751
9813
|
*
|
|
9752
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
9814
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/15df0115df01?v=0.7.2
|
|
9753
9815
|
*/
|
|
9754
9816
|
getGuarantorAssignment(headerTimeSlot: TimeSlot, guaranteeTimeSlot: TimeSlot, newEntropy: SafroleStateUpdate["entropy"]): Result<PerValidator<GuarantorAssignment>, ReportsError>;
|
|
9755
9817
|
}
|
|
@@ -9800,11 +9862,11 @@ declare class OnChain {
|
|
|
9800
9862
|
private readonly authorization;
|
|
9801
9863
|
private readonly statistics;
|
|
9802
9864
|
private isReadyForNextEpoch;
|
|
9803
|
-
constructor(chainSpec: ChainSpec, state: State & WithStateView, hasher: TransitionHasher,
|
|
9865
|
+
constructor(chainSpec: ChainSpec, state: State & WithStateView, hasher: TransitionHasher, options: AccumulateOptions, headerChain: HeaderChain);
|
|
9804
9866
|
/** Pre-populate things worth caching for the next epoch. */
|
|
9805
9867
|
prepareForNextEpoch(): Promise<void>;
|
|
9806
9868
|
private verifySeal;
|
|
9807
|
-
transition(block: BlockView, headerHash: HeaderHash
|
|
9869
|
+
transition(block: BlockView, headerHash: HeaderHash): Promise<Result<Ok, StfError>>;
|
|
9808
9870
|
private getUsedAuthorizerHashes;
|
|
9809
9871
|
}
|
|
9810
9872
|
|
|
@@ -9988,6 +10050,7 @@ type index$7_ACCUMULATION_ERROR = ACCUMULATION_ERROR;
|
|
|
9988
10050
|
type index$7_Accumulate = Accumulate;
|
|
9989
10051
|
declare const index$7_Accumulate: typeof Accumulate;
|
|
9990
10052
|
type index$7_AccumulateInput = AccumulateInput;
|
|
10053
|
+
type index$7_AccumulateOptions = AccumulateOptions;
|
|
9991
10054
|
type index$7_AccumulateResult = AccumulateResult;
|
|
9992
10055
|
type index$7_AccumulateRoot = AccumulateRoot;
|
|
9993
10056
|
type index$7_AccumulateState = AccumulateState;
|
|
@@ -10062,7 +10125,7 @@ declare const index$7_copyAndUpdateState: typeof copyAndUpdateState;
|
|
|
10062
10125
|
declare const index$7_stfError: typeof stfError;
|
|
10063
10126
|
declare namespace index$7 {
|
|
10064
10127
|
export { index$7_Accumulate as Accumulate, index$7_Assurances as Assurances, index$7_AssurancesError as AssurancesError, index$7_Authorization as Authorization, index$7_BlockVerifier as BlockVerifier, index$7_BlockVerifierError as BlockVerifierError, index$7_DbHeaderChain as DbHeaderChain, index$7_DeferredTransfers as DeferredTransfers, index$7_DeferredTransfersErrorCode as DeferredTransfersErrorCode, index$7_Disputes as Disputes, index$7_GAS_TO_INVOKE_WORK_REPORT as GAS_TO_INVOKE_WORK_REPORT, index$7_OnChain as OnChain, index$7_Preimages as Preimages, index$7_PreimagesErrorCode as PreimagesErrorCode, index$7_REPORT_TIMEOUT_GRACE_PERIOD as REPORT_TIMEOUT_GRACE_PERIOD, index$7_RecentHistory as RecentHistory, index$7_Reports as Reports, index$7_ReportsError as ReportsError, index$7_Statistics as Statistics, index$7_StfErrorKind as StfErrorKind, index$7_TransitionHasher as TransitionHasher, index$7_copyAndUpdateState as copyAndUpdateState, index$8 as externalities, index$7_stfError as stfError };
|
|
10065
|
-
export type { index$7_ACCUMULATION_ERROR as ACCUMULATION_ERROR, index$7_AccumulateInput as AccumulateInput, index$7_AccumulateResult as AccumulateResult, index$7_AccumulateRoot as AccumulateRoot, index$7_AccumulateState as AccumulateState, index$7_AccumulateStateUpdate as AccumulateStateUpdate, index$7_AssurancesInput as AssurancesInput, index$7_AssurancesState as AssurancesState, index$7_AssurancesStateUpdate as AssurancesStateUpdate, index$7_AuthorizationInput as AuthorizationInput, index$7_AuthorizationState as AuthorizationState, index$7_AuthorizationStateUpdate as AuthorizationStateUpdate, index$7_CountAndGasUsed as CountAndGasUsed, index$7_DeferredTransfersResult as DeferredTransfersResult, index$7_DeferredTransfersState as DeferredTransfersState, index$7_DisputesState as DisputesState, index$7_DisputesStateUpdate as DisputesStateUpdate, index$7_HeaderChain as HeaderChain, index$7_Input as Input, index$7_Ok as Ok, index$7_PreimagesInput as PreimagesInput, index$7_PreimagesState as PreimagesState, index$7_PreimagesStateUpdate as PreimagesStateUpdate, index$7_RecentHistoryInput as RecentHistoryInput, index$7_RecentHistoryPartialInput as RecentHistoryPartialInput, index$7_RecentHistoryState as RecentHistoryState, index$7_RecentHistoryStateUpdate as RecentHistoryStateUpdate, index$7_ReportsInput as ReportsInput, index$7_ReportsOutput as ReportsOutput, index$7_ReportsState as ReportsState, index$7_ReportsStateUpdate as ReportsStateUpdate, index$7_StatisticsState as StatisticsState, index$7_StatisticsStateUpdate as StatisticsStateUpdate, index$7_StfError as StfError };
|
|
10128
|
+
export type { index$7_ACCUMULATION_ERROR as ACCUMULATION_ERROR, index$7_AccumulateInput as AccumulateInput, index$7_AccumulateOptions as AccumulateOptions, index$7_AccumulateResult as AccumulateResult, index$7_AccumulateRoot as AccumulateRoot, index$7_AccumulateState as AccumulateState, index$7_AccumulateStateUpdate as AccumulateStateUpdate, index$7_AssurancesInput as AssurancesInput, index$7_AssurancesState as AssurancesState, index$7_AssurancesStateUpdate as AssurancesStateUpdate, index$7_AuthorizationInput as AuthorizationInput, index$7_AuthorizationState as AuthorizationState, index$7_AuthorizationStateUpdate as AuthorizationStateUpdate, index$7_CountAndGasUsed as CountAndGasUsed, index$7_DeferredTransfersResult as DeferredTransfersResult, index$7_DeferredTransfersState as DeferredTransfersState, index$7_DisputesState as DisputesState, index$7_DisputesStateUpdate as DisputesStateUpdate, index$7_HeaderChain as HeaderChain, index$7_Input as Input, index$7_Ok as Ok, index$7_PreimagesInput as PreimagesInput, index$7_PreimagesState as PreimagesState, index$7_PreimagesStateUpdate as PreimagesStateUpdate, index$7_RecentHistoryInput as RecentHistoryInput, index$7_RecentHistoryPartialInput as RecentHistoryPartialInput, index$7_RecentHistoryState as RecentHistoryState, index$7_RecentHistoryStateUpdate as RecentHistoryStateUpdate, index$7_ReportsInput as ReportsInput, index$7_ReportsOutput as ReportsOutput, index$7_ReportsState as ReportsState, index$7_ReportsStateUpdate as ReportsStateUpdate, index$7_StatisticsState as StatisticsState, index$7_StatisticsStateUpdate as StatisticsStateUpdate, index$7_StfError as StfError };
|
|
10066
10129
|
}
|
|
10067
10130
|
|
|
10068
10131
|
declare enum ImporterErrorKind {
|
|
@@ -10084,8 +10147,8 @@ declare class Importer {
|
|
|
10084
10147
|
constructor(spec: ChainSpec, pvm: PvmBackend, hasher: TransitionHasher, logger: Logger, blocks: BlocksDb, states: StatesDb<SerializedState<LeafDb>>);
|
|
10085
10148
|
/** Do some extra work for preparation for the next epoch. */
|
|
10086
10149
|
prepareForNextEpoch(): Promise<void>;
|
|
10087
|
-
importBlockWithStateRoot(block: BlockView
|
|
10088
|
-
importBlock(block: BlockView
|
|
10150
|
+
importBlockWithStateRoot(block: BlockView): Promise<Result<StateRootHash, ImporterError>>;
|
|
10151
|
+
importBlock(block: BlockView): Promise<Result<WithHash<HeaderHash, HeaderView>, ImporterError>>;
|
|
10089
10152
|
private importBlockInternal;
|
|
10090
10153
|
getBestStateRootHash(): (OpaqueHash & WithOpaque<"StateRootHash">) | null;
|
|
10091
10154
|
getBestBlockHash(): OpaqueHash & WithOpaque<"HeaderHash">;
|
|
@@ -10432,13 +10495,11 @@ declare const protocol: LousyProtocol<{
|
|
|
10432
10495
|
type ImporterInternal = Internal<typeof protocol>;
|
|
10433
10496
|
type ImporterApi = Api<typeof protocol>;
|
|
10434
10497
|
declare class ImporterConfig {
|
|
10435
|
-
readonly omitSealVerification: boolean;
|
|
10436
10498
|
readonly pvm: PvmBackend;
|
|
10437
10499
|
static Codec: Descriptor<ImporterConfig, ViewOf<ImporterConfig, {
|
|
10438
|
-
omitSealVerification: Descriptor<boolean, boolean>;
|
|
10439
10500
|
pvm: Descriptor<PvmBackend, U8>;
|
|
10440
10501
|
}>>;
|
|
10441
|
-
static create({
|
|
10502
|
+
static create({ pvm }: CodecRecord<ImporterConfig>): ImporterConfig;
|
|
10442
10503
|
private constructor();
|
|
10443
10504
|
}
|
|
10444
10505
|
|