@typeberry/lib 0.5.4 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/package.json +1 -1
  2. package/packages/core/json-parser/descriptors.d.ts.map +1 -1
  3. package/packages/core/json-parser/descriptors.js +3 -0
  4. package/packages/core/json-parser/index.test.js +30 -0
  5. package/packages/core/networking/package.json +1 -1
  6. package/packages/core/telemetry/package.json +1 -1
  7. package/packages/core/utils/compatibility.d.ts +0 -1
  8. package/packages/core/utils/compatibility.d.ts.map +1 -1
  9. package/packages/core/utils/compatibility.js +1 -2
  10. package/packages/core/utils/compatibility.test.js +6 -10
  11. package/packages/jam/block/index.d.ts +11 -11
  12. package/packages/jam/block/index.d.ts.map +1 -1
  13. package/packages/jam/block/index.js +11 -11
  14. package/packages/jam/block-json/block.d.ts +25 -25
  15. package/packages/jam/database-lmdb/states.test.js +3 -5
  16. package/packages/jam/fuzz-proto/v1/types.d.ts +1 -1
  17. package/packages/jam/jam-host-calls/accumulate/bless.d.ts.map +1 -1
  18. package/packages/jam/jam-host-calls/accumulate/bless.js +6 -10
  19. package/packages/jam/jam-host-calls/accumulate/bless.test.js +32 -72
  20. package/packages/jam/jam-host-calls/accumulate/new.d.ts.map +1 -1
  21. package/packages/jam/jam-host-calls/accumulate/new.js +2 -4
  22. package/packages/jam/jam-host-calls/accumulate/new.test.js +4 -5
  23. package/packages/jam/jam-host-calls/general/fetch.d.ts +1 -57
  24. package/packages/jam/jam-host-calls/general/fetch.d.ts.map +1 -1
  25. package/packages/jam/jam-host-calls/general/fetch.js +6 -29
  26. package/packages/jam/jam-host-calls/general/fetch.test.js +2 -58
  27. package/packages/jam/jamnp-s/protocol/ce-133-work-package-submission.d.ts +4 -4
  28. package/packages/jam/jamnp-s/protocol/ce-135-work-report-distribution.d.ts +13 -13
  29. package/packages/jam/jamnp-s/protocol/up-0-block-announcement.d.ts +1 -1
  30. package/packages/jam/node/package.json +1 -1
  31. package/packages/jam/node/reader.d.ts +25 -25
  32. package/packages/jam/node/workers.d.ts +183 -183
  33. package/packages/jam/state/accumulation-queue.d.ts +26 -26
  34. package/packages/jam/state/assurances.d.ts +26 -26
  35. package/packages/jam/state/privileged-services.d.ts +1 -1
  36. package/packages/jam/state/privileged-services.d.ts.map +1 -1
  37. package/packages/jam/state/privileged-services.js +1 -6
  38. package/packages/jam/state/service.d.ts +1 -1
  39. package/packages/jam/state/service.d.ts.map +1 -1
  40. package/packages/jam/state/statistics.d.ts +0 -8
  41. package/packages/jam/state/statistics.d.ts.map +1 -1
  42. package/packages/jam/state/statistics.js +14 -44
  43. package/packages/jam/state/statistics.test.js +1 -8
  44. package/packages/jam/state/test.utils.d.ts +1 -1
  45. package/packages/jam/state/test.utils.d.ts.map +1 -1
  46. package/packages/jam/state/test.utils.js +4 -22
  47. package/packages/jam/state-json/accounts.d.ts +10 -0
  48. package/packages/jam/state-json/accounts.d.ts.map +1 -1
  49. package/packages/jam/state-json/accounts.js +47 -19
  50. package/packages/jam/state-json/dump.d.ts.map +1 -1
  51. package/packages/jam/state-json/dump.js +5 -9
  52. package/packages/jam/state-json/dump.test.js +2 -10
  53. package/packages/jam/state-json/statistics.d.ts +1 -1
  54. package/packages/jam/state-json/statistics.d.ts.map +1 -1
  55. package/packages/jam/state-json/statistics.js +1 -13
  56. package/packages/jam/state-merkleization/in-memory-state-codec.d.ts +29 -31
  57. package/packages/jam/state-merkleization/in-memory-state-codec.d.ts.map +1 -1
  58. package/packages/jam/state-merkleization/serialize.d.ts +4 -4
  59. package/packages/jam/state-merkleization/serialize.d.ts.map +1 -1
  60. package/packages/jam/state-merkleization/serialize.js +5 -8
  61. package/packages/jam/state-merkleization/serialized-state-view.d.ts.map +1 -1
  62. package/packages/jam/state-merkleization/state-entries.test.js +1 -7
  63. package/packages/jam/state-vectors/index.d.ts +75 -75
  64. package/packages/jam/transition/accumulate/accumulate-state.d.ts +1 -2
  65. package/packages/jam/transition/accumulate/accumulate-state.d.ts.map +1 -1
  66. package/packages/jam/transition/accumulate/accumulate-utils.d.ts.map +1 -1
  67. package/packages/jam/transition/accumulate/accumulate-utils.js +2 -6
  68. package/packages/jam/transition/accumulate/accumulate-utils.test.js +2 -4
  69. package/packages/jam/transition/accumulate/accumulate.d.ts.map +1 -1
  70. package/packages/jam/transition/accumulate/accumulate.js +11 -20
  71. package/packages/jam/transition/accumulate/index.d.ts +0 -1
  72. package/packages/jam/transition/accumulate/index.d.ts.map +1 -1
  73. package/packages/jam/transition/accumulate/index.js +0 -1
  74. package/packages/jam/transition/accumulate/operand.d.ts +7 -7
  75. package/packages/jam/transition/chain-stf.d.ts +3 -5
  76. package/packages/jam/transition/chain-stf.d.ts.map +1 -1
  77. package/packages/jam/transition/chain-stf.js +5 -29
  78. package/packages/jam/transition/disputes/disputes.test.data2.d.ts +3 -3
  79. package/packages/jam/transition/disputes/disputes.test.data2.d.ts.map +1 -1
  80. package/packages/jam/transition/externalities/accumulate-externalities.d.ts.map +1 -1
  81. package/packages/jam/transition/externalities/accumulate-externalities.js +22 -49
  82. package/packages/jam/transition/externalities/accumulate-externalities.test.js +8 -72
  83. package/packages/jam/transition/externalities/fetch-externalities.d.ts +3 -22
  84. package/packages/jam/transition/externalities/fetch-externalities.d.ts.map +1 -1
  85. package/packages/jam/transition/externalities/fetch-externalities.js +3 -55
  86. package/packages/jam/transition/externalities/fetch-externalities.test.js +199 -112
  87. package/packages/jam/transition/statistics.d.ts +0 -7
  88. package/packages/jam/transition/statistics.d.ts.map +1 -1
  89. package/packages/jam/transition/statistics.js +2 -11
  90. package/packages/jam/transition/statistics.test.js +0 -40
  91. package/packages/workers/block-authorship/generator.test.d.ts +2 -0
  92. package/packages/workers/block-authorship/generator.test.d.ts.map +1 -0
  93. package/packages/workers/block-authorship/generator.test.js +200 -0
  94. package/packages/workers/block-authorship/package.json +1 -1
  95. package/packages/workers/block-authorship/protocol.d.ts +50 -50
  96. package/packages/workers/importer/package.json +1 -1
  97. package/packages/workers/importer/protocol.d.ts +54 -54
  98. package/packages/workers/jam-network/protocol.d.ts +79 -79
  99. package/packages/jam/transition/accumulate/deferred-transfers.d.ts +0 -36
  100. package/packages/jam/transition/accumulate/deferred-transfers.d.ts.map +0 -1
  101. package/packages/jam/transition/accumulate/deferred-transfers.js +0 -94
@@ -3,7 +3,7 @@ import { describe, it } from "node:test";
3
3
  import { tryAsServiceGas, tryAsServiceId } from "#@typeberry/block";
4
4
  import { codec, Encoder } from "#@typeberry/codec";
5
5
  import { tinyChainSpec } from "#@typeberry/config";
6
- import { MAX_VALUE_U32, MAX_VALUE_U64, tryAsU64 } from "#@typeberry/numbers";
6
+ import { MAX_VALUE_U64, tryAsU64 } from "#@typeberry/numbers";
7
7
  import { HostCallMemory, HostCallRegisters, PvmExecution } from "#@typeberry/pvm-host-calls";
8
8
  import { tryAsGas } from "#@typeberry/pvm-interface";
9
9
  import { gasCounter } from "#@typeberry/pvm-interpreter/gas.js";
@@ -11,7 +11,7 @@ import { MemoryBuilder, tryAsMemoryIndex } from "#@typeberry/pvm-interpreter/mem
11
11
  import { PAGE_SIZE } from "#@typeberry/pvm-interpreter/memory/memory-consts.js";
12
12
  import { tryAsSbrkIndex } from "#@typeberry/pvm-interpreter/memory/memory-index.js";
13
13
  import { codecPerCore, tryAsPerCore } from "#@typeberry/state";
14
- import { Compatibility, deepEqual, GpVersion, Result } from "#@typeberry/utils";
14
+ import { deepEqual, Result } from "#@typeberry/utils";
15
15
  import { UpdatePrivilegesError } from "../externalities/partial-state.js";
16
16
  import { PartialStateMock } from "../externalities/partial-state-mock.js";
17
17
  import { HostCallResult } from "../general/results.js";
@@ -23,8 +23,8 @@ const MANAGER_REG = 7;
23
23
  const AUTHORIZATION_REG = 8;
24
24
  const VALIDATOR_REG = 9;
25
25
  const REGISTRAR_REG = 10;
26
- const DICTIONARY_START = Compatibility.isGreaterOrEqual(GpVersion.V0_7_1) ? 11 : 10;
27
- const DICTIONARY_COUNT = Compatibility.isGreaterOrEqual(GpVersion.V0_7_1) ? 12 : 11;
26
+ const DICTIONARY_START = 11;
27
+ const DICTIONARY_COUNT = 12;
28
28
  function prepareServiceGasMap() {
29
29
  const entries = [];
30
30
  entries.push([tryAsServiceId(10_000), tryAsServiceGas(15_000)]);
@@ -68,7 +68,6 @@ function prepareRegsAndMemory(entries, authorizerData, { skipDictionary = false,
68
68
  };
69
69
  }
70
70
  describe("HostCalls: Bless", () => {
71
- const itPost071 = Compatibility.isGreaterOrEqual(GpVersion.V0_7_1) ? it : it.skip;
72
71
  it("should set new privileged services and auto-accumulate services", async () => {
73
72
  const accumulate = new PartialStateMock();
74
73
  const serviceId = tryAsServiceId(10_000);
@@ -81,28 +80,15 @@ describe("HostCalls: Bless", () => {
81
80
  // then
82
81
  assert.deepStrictEqual(result, undefined);
83
82
  assert.deepStrictEqual(registers.get(RESULT_REG), HostCallResult.OK);
84
- if (Compatibility.isGreaterOrEqual(GpVersion.V0_7_1)) {
85
- deepEqual(accumulate.privilegedServices, [
86
- [
87
- tryAsServiceId(5),
88
- tryAsPerCore([tryAsServiceId(10), tryAsServiceId(15)], tinyChainSpec),
89
- tryAsServiceId(20),
90
- tryAsServiceId(42),
91
- new Map(entries),
92
- ],
93
- ]);
94
- }
95
- else {
96
- deepEqual(accumulate.privilegedServices, [
97
- [
98
- tryAsServiceId(5),
99
- tryAsPerCore([tryAsServiceId(10), tryAsServiceId(15)], tinyChainSpec),
100
- tryAsServiceId(20),
101
- tryAsServiceId(MAX_VALUE_U32),
102
- new Map(entries),
103
- ],
104
- ]);
105
- }
83
+ deepEqual(accumulate.privilegedServices, [
84
+ [
85
+ tryAsServiceId(5),
86
+ tryAsPerCore([tryAsServiceId(10), tryAsServiceId(15)], tinyChainSpec),
87
+ tryAsServiceId(20),
88
+ tryAsServiceId(42),
89
+ new Map(entries),
90
+ ],
91
+ ]);
106
92
  });
107
93
  it("should return panic when dictionary is not readable", async () => {
108
94
  const accumulate = new PartialStateMock();
@@ -143,28 +129,15 @@ describe("HostCalls: Bless", () => {
143
129
  // then
144
130
  assert.deepStrictEqual(result, undefined);
145
131
  assert.deepStrictEqual(registers.get(RESULT_REG), HostCallResult.OK);
146
- if (Compatibility.isGreaterOrEqual(GpVersion.V0_7_1)) {
147
- deepEqual(accumulate.privilegedServices, [
148
- [
149
- tryAsServiceId(5),
150
- tryAsPerCore([tryAsServiceId(10), tryAsServiceId(15)], tinyChainSpec),
151
- tryAsServiceId(20),
152
- tryAsServiceId(42),
153
- new Map(entries),
154
- ],
155
- ]);
156
- }
157
- else {
158
- deepEqual(accumulate.privilegedServices, [
159
- [
160
- tryAsServiceId(5),
161
- tryAsPerCore([tryAsServiceId(10), tryAsServiceId(15)], tinyChainSpec),
162
- tryAsServiceId(20),
163
- tryAsServiceId(MAX_VALUE_U32),
164
- new Map(entries),
165
- ],
166
- ]);
167
- }
132
+ deepEqual(accumulate.privilegedServices, [
133
+ [
134
+ tryAsServiceId(5),
135
+ tryAsPerCore([tryAsServiceId(10), tryAsServiceId(15)], tinyChainSpec),
136
+ tryAsServiceId(20),
137
+ tryAsServiceId(42),
138
+ new Map(entries),
139
+ ],
140
+ ]);
168
141
  });
169
142
  it("should auto-accumulate services when dictionary contains duplicates", async () => {
170
143
  const accumulate = new PartialStateMock();
@@ -179,28 +152,15 @@ describe("HostCalls: Bless", () => {
179
152
  // then
180
153
  assert.deepStrictEqual(result, undefined);
181
154
  assert.deepStrictEqual(registers.get(RESULT_REG), HostCallResult.OK);
182
- if (Compatibility.isGreaterOrEqual(GpVersion.V0_7_1)) {
183
- deepEqual(accumulate.privilegedServices, [
184
- [
185
- tryAsServiceId(5),
186
- tryAsPerCore([tryAsServiceId(10), tryAsServiceId(15)], tinyChainSpec),
187
- tryAsServiceId(20),
188
- tryAsServiceId(42),
189
- new Map(entries),
190
- ],
191
- ]);
192
- }
193
- else {
194
- deepEqual(accumulate.privilegedServices, [
195
- [
196
- tryAsServiceId(5),
197
- tryAsPerCore([tryAsServiceId(10), tryAsServiceId(15)], tinyChainSpec),
198
- tryAsServiceId(20),
199
- tryAsServiceId(MAX_VALUE_U32),
200
- new Map(entries),
201
- ],
202
- ]);
203
- }
155
+ deepEqual(accumulate.privilegedServices, [
156
+ [
157
+ tryAsServiceId(5),
158
+ tryAsPerCore([tryAsServiceId(10), tryAsServiceId(15)], tinyChainSpec),
159
+ tryAsServiceId(20),
160
+ tryAsServiceId(42),
161
+ new Map(entries),
162
+ ],
163
+ ]);
204
164
  });
205
165
  it("should return HUH when service is unprivileged", async () => {
206
166
  const accumulate = new PartialStateMock();
@@ -247,7 +207,7 @@ describe("HostCalls: Bless", () => {
247
207
  assert.deepStrictEqual(registers.get(RESULT_REG), HostCallResult.WHO);
248
208
  assert.deepStrictEqual(accumulate.privilegedServices, []);
249
209
  });
250
- itPost071("should return WHO if given registrar is invalid", async () => {
210
+ it("should return WHO if given registrar is invalid", async () => {
251
211
  const accumulate = new PartialStateMock();
252
212
  accumulate.privilegedServicesResponse = Result.error(UpdatePrivilegesError.InvalidServiceId, () => "Test: invalid registrar service ID for bless");
253
213
  const serviceId = tryAsServiceId(11_000);
@@ -1 +1 @@
1
- {"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../../../../../packages/jam/jam-host-calls/accumulate/new.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,kBAAkB,CAAC;AAInE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACpG,OAAO,EAAE,YAAY,EAAsC,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,KAAK,WAAW,EAAiB,MAAM,0BAA0B,CAAC;AAE3E,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAMvF;;;;GAIG;AACH,qBAAa,GAAI,YAAW,eAAe;aAQvB,gBAAgB,EAAE,SAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,YAAY;IAR/B,KAAK,iIAA0B;IAC/B,YAAY,4HAAqB;IACjC,eAAe,uEAE8B;gBAG3B,gBAAgB,EAAE,SAAS,EAC1B,YAAY,EAAE,YAAY;IAGvC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,GAAG,YAAY,CAAC;CA0DrH"}
1
+ {"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../../../../../packages/jam/jam-host-calls/accumulate/new.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,kBAAkB,CAAC;AAInE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACpG,OAAO,EAAE,YAAY,EAAsC,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,KAAK,WAAW,EAAiB,MAAM,0BAA0B,CAAC;AAE3E,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAMvF;;;;GAIG;AACH,qBAAa,GAAI,YAAW,eAAe;aAMvB,gBAAgB,EAAE,SAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,YAAY;IAN/B,KAAK,iIAA0B;IAC/B,YAAY,4HAAqB;IACjC,eAAe,uEAAgD;gBAG7C,gBAAgB,EAAE,SAAS,EAC1B,YAAY,EAAE,YAAY;IAGvC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,GAAG,YAAY,CAAC;CA0DrH"}
@@ -4,7 +4,7 @@ import { HASH_SIZE } from "#@typeberry/hash";
4
4
  import { tryAsU64 } from "#@typeberry/numbers";
5
5
  import { PvmExecution, traceRegisters, tryAsHostCallIndex } from "#@typeberry/pvm-host-calls";
6
6
  import { tryAsSmallGas } from "#@typeberry/pvm-interface";
7
- import { assertNever, Compatibility, GpVersion, resultToString } from "#@typeberry/utils";
7
+ import { assertNever, resultToString } from "#@typeberry/utils";
8
8
  import { NewServiceError } from "../externalities/partial-state.js";
9
9
  import { HostCallResult } from "../general/results.js";
10
10
  import { logger } from "../logger.js";
@@ -19,9 +19,7 @@ export class New {
19
19
  partialState;
20
20
  index = tryAsHostCallIndex(18);
21
21
  basicGasCost = tryAsSmallGas(10);
22
- tracedRegisters = Compatibility.isGreaterOrEqual(GpVersion.V0_7_1)
23
- ? traceRegisters(IN_OUT_REG, 8, 9, 10, 11, 12)
24
- : traceRegisters(IN_OUT_REG, 8, 9, 10, 11);
22
+ tracedRegisters = traceRegisters(IN_OUT_REG, 8, 9, 10, 11, 12);
25
23
  constructor(currentServiceId, partialState) {
26
24
  this.currentServiceId = currentServiceId;
27
25
  this.partialState = partialState;
@@ -10,7 +10,7 @@ import { gasCounter } from "#@typeberry/pvm-interpreter/gas.js";
10
10
  import { MemoryBuilder, tryAsMemoryIndex } from "#@typeberry/pvm-interpreter/memory/index.js";
11
11
  import { tryAsSbrkIndex } from "#@typeberry/pvm-interpreter/memory/memory-index.js";
12
12
  import { PAGE_SIZE } from "#@typeberry/pvm-interpreter/spi-decoder/memory-conts.js";
13
- import { Compatibility, GpVersion, Result } from "#@typeberry/utils";
13
+ import { Result } from "#@typeberry/utils";
14
14
  import { NewServiceError } from "../externalities/partial-state.js";
15
15
  import { PartialStateMock } from "../externalities/partial-state-mock.js";
16
16
  import { HostCallResult } from "../general/results.js";
@@ -46,7 +46,6 @@ wantedServiceId = tryAsU64(2 ** 32 - 1), { skipCodeHash = false } = {}) {
46
46
  };
47
47
  }
48
48
  describe("HostCalls: New", () => {
49
- const itPost071 = Compatibility.isGreaterOrEqual(GpVersion.V0_7_1) ? it : it.skip;
50
49
  it("should create a new service", async () => {
51
50
  const accumulate = new PartialStateMock();
52
51
  const serviceId = tryAsServiceId(10_000);
@@ -98,7 +97,7 @@ describe("HostCalls: New", () => {
98
97
  assert.deepStrictEqual(registers.get(RESULT_REG), HostCallResult.HUH);
99
98
  assert.deepStrictEqual(accumulate.newServiceCalled.length, 1);
100
99
  });
101
- itPost071("should create a new service with selected id", async () => {
100
+ it("should create a new service with selected id", async () => {
102
101
  const accumulate = new PartialStateMock();
103
102
  const serviceId = tryAsServiceId(10); // service has registrar privilege
104
103
  const n = new New(serviceId, accumulate);
@@ -113,7 +112,7 @@ describe("HostCalls: New", () => {
113
112
  [Bytes.fill(HASH_SIZE, 0x69), 4096n, 2n ** 40n, 2n ** 50n, gratisStorage, 42n],
114
113
  ]);
115
114
  });
116
- itPost071("should create a new service with random id", async () => {
115
+ it("should create a new service with random id", async () => {
117
116
  const accumulate = new PartialStateMock();
118
117
  const serviceId = tryAsServiceId(10_000); // service does not have registrar privilege
119
118
  const n = new New(serviceId, accumulate);
@@ -128,7 +127,7 @@ describe("HostCalls: New", () => {
128
127
  [Bytes.fill(HASH_SIZE, 0x69), 4096n, 2n ** 40n, 2n ** 50n, gratisStorage, 42n],
129
128
  ]);
130
129
  });
131
- itPost071("should fail when trying to set selected id, but service already exists", async () => {
130
+ it("should fail when trying to set selected id, but service already exists", async () => {
132
131
  const accumulate = new PartialStateMock();
133
132
  const serviceId = tryAsServiceId(10);
134
133
  const n = new New(serviceId, accumulate);
@@ -142,19 +142,6 @@ export interface IFetchExternalities {
142
142
  * https://graypaper.fluffylabs.dev/#/9a08063/32f00132f001?v=0.6.6
143
143
  */
144
144
  workItemPayload(workItem: U64): BytesBlob | null;
145
- /**
146
- * Get all accumulation operands (work results?).
147
- *
148
- * Is Authorized: <empty>
149
- * Refine: <empty>
150
- * Accumulate: `E(↕o)`
151
- * On Transfer: <empty>
152
- *
153
- * @deprecated since 0.7.1
154
- *
155
- * https://graypaper.fluffylabs.dev/#/9a08063/32fb0132fb01?v=0.6.6
156
- */
157
- allOperands(): BytesBlob | null;
158
145
  /**
159
146
  * Get all accumulation operands (work results?) and transfers.
160
147
  *
@@ -165,19 +152,6 @@ export interface IFetchExternalities {
165
152
  * https://graypaper.fluffylabs.dev/#/ab2cdbd/314c03314c03?v=0.7.2
166
153
  */
167
154
  allTransfersAndOperands(): BytesBlob | null;
168
- /**
169
- * Get one selected accumulation operand.
170
- *
171
- * Is Authorized: <empty>
172
- * Refine: <empty>
173
- * Accumulate: `E(o[omega_11])`
174
- * On Transfer: <empty>
175
- *
176
- * @deprecated 0.7.1
177
- *
178
- * https://graypaper.fluffylabs.dev/#/9a08063/320202320202?v=0.6.6
179
- */
180
- oneOperand(operandIndex: U64): BytesBlob | null;
181
155
  /**
182
156
  * Get one selected accumulation operand or transfer.
183
157
  *
@@ -188,32 +162,6 @@ export interface IFetchExternalities {
188
162
  * https://graypaper.fluffylabs.dev/#/ab2cdbd/315503315503?v=0.7.2
189
163
  */
190
164
  oneTransferOrOperand(index: U64): BytesBlob | null;
191
- /**
192
- * Inspect all incoming transfers.
193
- *
194
- * Is Authorized: <empty>
195
- * Refine: <empty>
196
- * Accumulate: <empty>
197
- * On Transfer: `E(↕t)`
198
- *
199
- * @deprecated 0.7.1
200
- *
201
- * https://graypaper.fluffylabs.dev/#/9a08063/320c02320c02?v=0.6.6
202
- */
203
- allTransfers(): BytesBlob | null;
204
- /**
205
- * Inspect one particular incoming transfers.
206
- *
207
- * Is Authorized: <empty>
208
- * Refine: <empty>
209
- * Accumulate: <empty>
210
- * On Transfer: `E(t[omega_11])`
211
- *
212
- * @deprecated 0.7.1
213
- *
214
- * https://graypaper.fluffylabs.dev/#/9a08063/321302321302?v=0.6.6
215
- */
216
- oneTransfer(transferIndex: U64): BytesBlob | null;
217
165
  }
218
166
  /**
219
167
  * https://graypaper.fluffylabs.dev/#/7e6ff6a/324000324000?v=0.6.7
@@ -243,11 +191,7 @@ export declare enum FetchKind {
243
191
  AllWorkItems = 11,
244
192
  OneWorkItem = 12,
245
193
  WorkItemPayload = 13,
246
- LegacyAllOperands = 14,
247
194
  AllTransfersAndOperands = 14,
248
- LegacyOneOperand = 15,
249
- OneTransferOrOperand = 15,
250
- LegacyAllTransfers = 16,
251
- LegacyOneTransfer = 17
195
+ OneTransferOrOperand = 15
252
196
  }
253
197
  //# sourceMappingURL=fetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../../../packages/jam/jam-host-calls/general/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAA8B,KAAK,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACpG,OAAO,EAAE,YAAY,EAAsC,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,KAAK,WAAW,EAAiB,MAAM,0BAA0B,CAAC;AAM3E,sBAAsB;AACtB,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,SAAS,IAAI,SAAS,CAAC;IAEvB;;;;;;;;;OASG;IACH,OAAO,IAAI,SAAS,GAAG,IAAI,CAAC;IAE5B;;;;;;;;;;OAUG;IACH,eAAe,IAAI,SAAS,GAAG,IAAI,CAAC;IAEpC;;;;;;;;;;;OAWG;IACH,iBAAiB,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC;IAEtE;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC;IAEnE;;;;;;;;;OASG;IACH,WAAW,IAAI,SAAS,GAAG,IAAI,CAAC;IAEhC;;;;;;;;;;OAUG;IACH,UAAU,IAAI,SAAS,GAAG,IAAI,CAAC;IAE/B;;;;;;;;;OASG;IACH,kBAAkB,IAAI,SAAS,GAAG,IAAI,CAAC;IAEvC;;;;;;;;;OAS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W,IAAI;IACf,UAAU,IAAI;IACd,kBAAkB,IAAI;IACtB,aAAa,KAAK;IAClB,YAAY,KAAK;IACjB,WAAW,KAAK;IAChB,eAAe,KAAK;IACpB,uBAAuB,KAAK;IAC5B,oBAAoB,KAAK;CAC1B"}
@@ -1,7 +1,6 @@
1
1
  import { minU64, tryAsU64 } from "#@typeberry/numbers";
2
2
  import { PvmExecution, traceRegisters, tryAsHostCallIndex } from "#@typeberry/pvm-host-calls";
3
3
  import { tryAsSmallGas } from "#@typeberry/pvm-interface";
4
- import { Compatibility, GpVersion } from "#@typeberry/utils";
5
4
  import { logger } from "../logger.js";
6
5
  import { clampU64ToU32 } from "../utils.js";
7
6
  import { HostCallResult } from "./results.js";
@@ -94,30 +93,12 @@ export class Fetch {
94
93
  const workItem = regs.get(11);
95
94
  return this.fetch.workItemPayload(workItem);
96
95
  }
97
- if (Compatibility.isGreaterOrEqual(GpVersion.V0_7_1)) {
98
- if (kind === FetchKind.AllTransfersAndOperands) {
99
- return this.fetch.allTransfersAndOperands();
100
- }
101
- if (kind === FetchKind.OneTransferOrOperand) {
102
- const index = regs.get(11);
103
- return this.fetch.oneTransferOrOperand(index);
104
- }
105
- }
106
- else {
107
- if (kind === FetchKind.LegacyAllOperands) {
108
- return this.fetch.allOperands();
109
- }
110
- if (kind === FetchKind.LegacyOneOperand) {
111
- const index = regs.get(11);
112
- return this.fetch.oneOperand(index);
113
- }
114
- if (kind === FetchKind.LegacyAllTransfers) {
115
- return this.fetch.allTransfers();
116
- }
117
- if (kind === FetchKind.LegacyOneTransfer) {
118
- const index = regs.get(11);
119
- return this.fetch.oneTransfer(index);
120
- }
96
+ if (kind === FetchKind.AllTransfersAndOperands) {
97
+ return this.fetch.allTransfersAndOperands();
98
+ }
99
+ if (kind === FetchKind.OneTransferOrOperand) {
100
+ const index = regs.get(11);
101
+ return this.fetch.oneTransferOrOperand(index);
121
102
  }
122
103
  return null;
123
104
  }
@@ -138,10 +119,6 @@ export var FetchKind;
138
119
  FetchKind[FetchKind["AllWorkItems"] = 11] = "AllWorkItems";
139
120
  FetchKind[FetchKind["OneWorkItem"] = 12] = "OneWorkItem";
140
121
  FetchKind[FetchKind["WorkItemPayload"] = 13] = "WorkItemPayload";
141
- FetchKind[FetchKind["LegacyAllOperands"] = 14] = "LegacyAllOperands";
142
122
  FetchKind[FetchKind["AllTransfersAndOperands"] = 14] = "AllTransfersAndOperands";
143
- FetchKind[FetchKind["LegacyOneOperand"] = 15] = "LegacyOneOperand";
144
123
  FetchKind[FetchKind["OneTransferOrOperand"] = 15] = "OneTransferOrOperand";
145
- FetchKind[FetchKind["LegacyAllTransfers"] = 16] = "LegacyAllTransfers";
146
- FetchKind[FetchKind["LegacyOneTransfer"] = 17] = "LegacyOneTransfer";
147
124
  })(FetchKind || (FetchKind = {}));
@@ -7,14 +7,12 @@ import { HostCallMemory, HostCallRegisters, PvmExecution } from "#@typeberry/pvm
7
7
  import { tryAsGas } from "#@typeberry/pvm-interface";
8
8
  import { gasCounter, MemoryBuilder, tryAsMemoryIndex, tryAsSbrkIndex } from "#@typeberry/pvm-interpreter";
9
9
  import { PAGE_SIZE } from "#@typeberry/pvm-interpreter/memory/memory-consts.js";
10
- import { Compatibility, GpVersion } from "#@typeberry/utils";
11
10
  import { emptyRegistersBuffer } from "../utils.js";
12
11
  import { Fetch, FetchKind } from "./fetch.js";
13
12
  import { HostCallResult } from "./results.js";
14
13
  describe("Fetch", () => {
15
14
  const IN_OUT_REG = 7;
16
15
  const gas = gasCounter(tryAsGas(0));
17
- const [itPre071, itPost071] = Compatibility.isGreaterOrEqual(GpVersion.V0_7_1) ? [it.skip, it] : [it, it.skip];
18
16
  it("should return PvmExecution.Panic if memory write fails", async () => {
19
17
  const currentServiceId = tryAsServiceId(10_000);
20
18
  const blob = BytesBlob.blobFromNumbers([1, 2, 3]);
@@ -277,61 +275,7 @@ describe("Fetch", () => {
277
275
  assert.deepStrictEqual(readBack(), blob.raw);
278
276
  assert.deepStrictEqual(fetchMock.workItemPayloadData, [[workItem]]);
279
277
  });
280
- itPre071("should fetch all operands and write result to memory", async () => {
281
- const currentServiceId = tryAsServiceId(10_000);
282
- const blob = BytesBlob.blobFromNumbers([101, 102, 103]);
283
- const fetchMock = new FetchMock();
284
- fetchMock.allOperandsResponse = blob;
285
- const { registers, memory, readBack, expectedLength } = prepareRegsAndMemory(blob, FetchKind.LegacyAllOperands);
286
- const fetch = new Fetch(currentServiceId, fetchMock);
287
- const result = await fetch.execute(gas, registers, memory);
288
- assert.strictEqual(result, undefined);
289
- assert.deepStrictEqual(registers.get(IN_OUT_REG), expectedLength);
290
- assert.deepStrictEqual(readBack(), blob.raw);
291
- });
292
- itPre071("should fetch one operand and write result to memory", async () => {
293
- const currentServiceId = tryAsServiceId(10_000);
294
- const blob = BytesBlob.blobFromNumbers([115, 116, 117]);
295
- const fetchMock = new FetchMock();
296
- const index = tryAsU64(9);
297
- fetchMock.oneOperandResponses.set(index.toString(), blob);
298
- const { registers, memory, readBack, expectedLength } = prepareRegsAndMemory(blob, FetchKind.LegacyOneOperand);
299
- registers.set(11, index);
300
- const fetch = new Fetch(currentServiceId, fetchMock);
301
- const result = await fetch.execute(gas, registers, memory);
302
- assert.strictEqual(result, undefined);
303
- assert.deepStrictEqual(registers.get(IN_OUT_REG), expectedLength);
304
- assert.deepStrictEqual(readBack(), blob.raw);
305
- assert.deepStrictEqual(fetchMock.oneOperandData, [[index]]);
306
- });
307
- itPre071("should fetch all transfers and write result to memory", async () => {
308
- const currentServiceId = tryAsServiceId(10_000);
309
- const blob = BytesBlob.blobFromNumbers([130, 131, 132]);
310
- const fetchMock = new FetchMock();
311
- fetchMock.allTransfersResponse = blob;
312
- const { registers, memory, readBack, expectedLength } = prepareRegsAndMemory(blob, FetchKind.LegacyAllTransfers);
313
- const fetch = new Fetch(currentServiceId, fetchMock);
314
- const result = await fetch.execute(gas, registers, memory);
315
- assert.strictEqual(result, undefined);
316
- assert.deepStrictEqual(registers.get(IN_OUT_REG), expectedLength);
317
- assert.deepStrictEqual(readBack(), blob.raw);
318
- });
319
- itPre071("should fetch one transfer and write result to memory", async () => {
320
- const currentServiceId = tryAsServiceId(10_000);
321
- const blob = BytesBlob.blobFromNumbers([140, 141, 142]);
322
- const fetchMock = new FetchMock();
323
- const index = tryAsU64(2);
324
- fetchMock.oneTransferResponses.set(index.toString(), blob);
325
- const { registers, memory, readBack, expectedLength } = prepareRegsAndMemory(blob, FetchKind.LegacyOneTransfer);
326
- registers.set(11, index);
327
- const fetch = new Fetch(currentServiceId, fetchMock);
328
- const result = await fetch.execute(gas, registers, memory);
329
- assert.strictEqual(result, undefined);
330
- assert.deepStrictEqual(registers.get(IN_OUT_REG), expectedLength);
331
- assert.deepStrictEqual(readBack(), blob.raw);
332
- assert.deepStrictEqual(fetchMock.oneTransferData, [[index]]);
333
- });
334
- itPost071("should fetch all transfers and operands and write result to memory", async () => {
278
+ it("should fetch all transfers and operands and write result to memory", async () => {
335
279
  const currentServiceId = tryAsServiceId(10_000);
336
280
  const blob = BytesBlob.blobFromNumbers([101, 102, 103]);
337
281
  const fetchMock = new FetchMock();
@@ -343,7 +287,7 @@ describe("Fetch", () => {
343
287
  assert.deepStrictEqual(registers.get(IN_OUT_REG), expectedLength);
344
288
  assert.deepStrictEqual(readBack(), blob.raw);
345
289
  });
346
- itPost071("should fetch one operand or transfer and write result to memory", async () => {
290
+ it("should fetch one operand or transfer and write result to memory", async () => {
347
291
  const currentServiceId = tryAsServiceId(10_000);
348
292
  const blob = BytesBlob.blobFromNumbers([115, 116, 117]);
349
293
  const fetchMock = new FetchMock();
@@ -21,7 +21,7 @@ export declare class CoreWorkPackage extends WithDebug {
21
21
  workPackage: import("@typeberry/codec").Descriptor<WorkPackage, import("@typeberry/codec").ViewOf<WorkPackage, {
22
22
  authCodeHost: import("@typeberry/codec").Descriptor<number & import("@typeberry/numbers").WithBytesRepresentation<4> & import("@typeberry/utils").WithOpaque<"ServiceId[u32]">, import("@typeberry/bytes").Bytes<4>>;
23
23
  authCodeHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"CodeHash">, import("@typeberry/bytes").Bytes<32>>;
24
- context: import("@typeberry/codec").Descriptor<import("@typeberry/block/refine-context.js").RefineContext, import("@typeberry/codec").ViewOf<import("@typeberry/block/refine-context.js").RefineContext, {
24
+ context: import("@typeberry/codec").Descriptor<import("@typeberry/block").RefineContext, import("@typeberry/codec").ViewOf<import("@typeberry/block").RefineContext, {
25
25
  anchor: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"HeaderHash">, import("@typeberry/bytes").Bytes<32>>;
26
26
  stateRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"StateRootHash">, import("@typeberry/bytes").Bytes<32>>;
27
27
  beefyRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"BeefyHash">, import("@typeberry/bytes").Bytes<32>>;
@@ -31,18 +31,18 @@ export declare class CoreWorkPackage extends WithDebug {
31
31
  }>>;
32
32
  authorization: import("@typeberry/codec").Descriptor<BytesBlob, BytesBlob>;
33
33
  parametrization: import("@typeberry/codec").Descriptor<BytesBlob, BytesBlob>;
34
- items: import("@typeberry/codec").Descriptor<import("@typeberry/collections").FixedSizeArray<import("@typeberry/block/work-item.js").WorkItem, import("@typeberry/numbers").U8>, import("@typeberry/codec").SequenceView<import("@typeberry/block/work-item.js").WorkItem, import("@typeberry/codec").ViewOf<import("@typeberry/block/work-item.js").WorkItem, {
34
+ items: import("@typeberry/codec").Descriptor<import("@typeberry/collections").FixedSizeArray<import("@typeberry/block").WorkItem, import("@typeberry/numbers").U8>, import("@typeberry/codec").SequenceView<import("@typeberry/block").WorkItem, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkItem, {
35
35
  service: import("@typeberry/codec").Descriptor<number & import("@typeberry/numbers").WithBytesRepresentation<4> & import("@typeberry/utils").WithOpaque<"ServiceId[u32]">, import("@typeberry/bytes").Bytes<4>>;
36
36
  codeHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"CodeHash">, import("@typeberry/bytes").Bytes<32>>;
37
37
  refineGasLimit: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/bytes").Bytes<8>>;
38
38
  accumulateGasLimit: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/bytes").Bytes<8>>;
39
39
  exportCount: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U16, import("@typeberry/bytes").Bytes<2>>;
40
40
  payload: import("@typeberry/codec").Descriptor<BytesBlob, BytesBlob>;
41
- importSegments: import("@typeberry/codec").Descriptor<readonly import("@typeberry/block/work-item.js").ImportSpec[] & import("@typeberry/utils").WithOpaque<"Less than 2048">, import("@typeberry/codec").SequenceView<import("@typeberry/block/work-item.js").ImportSpec, import("@typeberry/codec").ViewOf<import("@typeberry/block/work-item.js").ImportSpec, {
41
+ importSegments: import("@typeberry/codec").Descriptor<readonly import("@typeberry/block").ImportSpec[] & import("@typeberry/utils").WithOpaque<"Less than 2048">, import("@typeberry/codec").SequenceView<import("@typeberry/block").ImportSpec, import("@typeberry/codec").ViewOf<import("@typeberry/block").ImportSpec, {
42
42
  treeRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32>, import("@typeberry/bytes").Bytes<32>>;
43
43
  index: import("@typeberry/codec").Descriptor<number & import("@typeberry/numbers").WithBytesRepresentation<2> & import("@typeberry/utils").WithOpaque<"Segment Index [U16]">, import("@typeberry/bytes").Bytes<2>>;
44
44
  }>>>;
45
- extrinsic: import("@typeberry/codec").Descriptor<import("@typeberry/block/work-item.js").WorkItemExtrinsicSpec[], import("@typeberry/codec").SequenceView<import("@typeberry/block/work-item.js").WorkItemExtrinsicSpec, import("@typeberry/codec").ViewOf<import("@typeberry/block/work-item.js").WorkItemExtrinsicSpec, {
45
+ extrinsic: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkItemExtrinsicSpec[], import("@typeberry/codec").SequenceView<import("@typeberry/block").WorkItemExtrinsicSpec, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkItemExtrinsicSpec, {
46
46
  hash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"ExtrinsicHash">, import("@typeberry/bytes").Bytes<32>>;
47
47
  len: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/bytes").Bytes<4>>;
48
48
  }>>>;
@@ -21,14 +21,14 @@ export declare class GuaranteedWorkReport extends WithDebug {
21
21
  readonly signatures: KnownSizeArray<Credential, "[0..ValidatorsCount)">;
22
22
  static Codec: import("@typeberry/codec").Descriptor<GuaranteedWorkReport, import("@typeberry/codec").ViewOf<GuaranteedWorkReport, {
23
23
  report: import("@typeberry/codec").Descriptor<WorkReport, import("@typeberry/codec").ViewOf<WorkReport, {
24
- workPackageSpec: import("@typeberry/codec").Descriptor<import("@typeberry/block/work-report.js").WorkPackageSpec, import("@typeberry/codec").ViewOf<import("@typeberry/block/work-report.js").WorkPackageSpec, {
24
+ workPackageSpec: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkPackageSpec, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkPackageSpec, {
25
25
  hash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"WorkPackageHash">, import("@typeberry/bytes").Bytes<32>>;
26
26
  length: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/bytes").Bytes<4>>;
27
27
  erasureRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32>, import("@typeberry/bytes").Bytes<32>>;
28
28
  exportsRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"ExportsRootHash">, import("@typeberry/bytes").Bytes<32>>;
29
29
  exportsCount: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U16, import("@typeberry/bytes").Bytes<2>>;
30
30
  }>>;
31
- context: import("@typeberry/codec").Descriptor<import("@typeberry/block/refine-context.js").RefineContext, import("@typeberry/codec").ViewOf<import("@typeberry/block/refine-context.js").RefineContext, {
31
+ context: import("@typeberry/codec").Descriptor<import("@typeberry/block").RefineContext, import("@typeberry/codec").ViewOf<import("@typeberry/block").RefineContext, {
32
32
  anchor: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"HeaderHash">, import("@typeberry/bytes").Bytes<32>>;
33
33
  stateRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"StateRootHash">, import("@typeberry/bytes").Bytes<32>>;
34
34
  beefyRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"BeefyHash">, import("@typeberry/bytes").Bytes<32>>;
@@ -40,32 +40,32 @@ export declare class GuaranteedWorkReport extends WithDebug {
40
40
  authorizerHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"AuthorizerHash">, import("@typeberry/bytes").Bytes<32>>;
41
41
  authorizationGasUsed: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/numbers").U64>;
42
42
  authorizationOutput: import("@typeberry/codec").Descriptor<BytesBlob, BytesBlob>;
43
- segmentRootLookup: import("@typeberry/codec").Descriptor<readonly import("@typeberry/block/refine-context.js").WorkPackageInfo[], import("@typeberry/codec").SequenceView<import("@typeberry/block/refine-context.js").WorkPackageInfo, import("@typeberry/codec").ViewOf<import("@typeberry/block/refine-context.js").WorkPackageInfo, {
43
+ segmentRootLookup: import("@typeberry/codec").Descriptor<readonly import("@typeberry/block").WorkPackageInfo[], import("@typeberry/codec").SequenceView<import("@typeberry/block").WorkPackageInfo, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkPackageInfo, {
44
44
  workPackageHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"WorkPackageHash">, import("@typeberry/bytes").Bytes<32>>;
45
45
  segmentTreeRoot: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"ExportsRootHash">, import("@typeberry/bytes").Bytes<32>>;
46
46
  }>>>;
47
- results: import("@typeberry/codec").Descriptor<import("@typeberry/collections").FixedSizeArray<import("@typeberry/block/work-result.js").WorkResult, import("@typeberry/numbers").U8>, import("@typeberry/codec").SequenceView<import("@typeberry/block/work-result.js").WorkResult, import("@typeberry/codec").ViewOf<import("@typeberry/block/work-result.js").WorkResult, {
47
+ results: import("@typeberry/codec").Descriptor<import("@typeberry/collections").FixedSizeArray<import("@typeberry/block").WorkResult, import("@typeberry/numbers").U8>, import("@typeberry/codec").SequenceView<import("@typeberry/block").WorkResult, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkResult, {
48
48
  serviceId: import("@typeberry/codec").Descriptor<number & import("@typeberry/numbers").WithBytesRepresentation<4> & import("@typeberry/utils").WithOpaque<"ServiceId[u32]">, import("@typeberry/bytes").Bytes<4>>;
49
49
  codeHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32> & import("@typeberry/utils").WithOpaque<"CodeHash">, import("@typeberry/bytes").Bytes<32>>;
50
50
  payloadHash: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32>, import("@typeberry/bytes").Bytes<32>>;
51
51
  gas: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/bytes").Bytes<8>>;
52
- result: import("@typeberry/codec").Descriptor<import("@typeberry/block/work-result.js").WorkExecResult, {
53
- kind: import("@typeberry/block/work-result.js").WorkExecResultKind.ok;
52
+ result: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkExecResult, {
53
+ kind: import("@typeberry/block").WorkExecResultKind.ok;
54
54
  okBlob: BytesBlob;
55
55
  } | {
56
- kind: import("@typeberry/block/work-result.js").WorkExecResultKind.outOfGas;
56
+ kind: import("@typeberry/block").WorkExecResultKind.outOfGas;
57
57
  } | {
58
- kind: import("@typeberry/block/work-result.js").WorkExecResultKind.panic;
58
+ kind: import("@typeberry/block").WorkExecResultKind.panic;
59
59
  } | {
60
- kind: import("@typeberry/block/work-result.js").WorkExecResultKind.incorrectNumberOfExports;
60
+ kind: import("@typeberry/block").WorkExecResultKind.incorrectNumberOfExports;
61
61
  } | {
62
- kind: import("@typeberry/block/work-result.js").WorkExecResultKind.digestTooBig;
62
+ kind: import("@typeberry/block").WorkExecResultKind.digestTooBig;
63
63
  } | {
64
- kind: import("@typeberry/block/work-result.js").WorkExecResultKind.badCode;
64
+ kind: import("@typeberry/block").WorkExecResultKind.badCode;
65
65
  } | {
66
- kind: import("@typeberry/block/work-result.js").WorkExecResultKind.codeOversize;
66
+ kind: import("@typeberry/block").WorkExecResultKind.codeOversize;
67
67
  }>;
68
- load: import("@typeberry/codec").Descriptor<import("@typeberry/block/work-result.js").WorkRefineLoad, import("@typeberry/codec").ViewOf<import("@typeberry/block/work-result.js").WorkRefineLoad, {
68
+ load: import("@typeberry/codec").Descriptor<import("@typeberry/block").WorkRefineLoad, import("@typeberry/codec").ViewOf<import("@typeberry/block").WorkRefineLoad, {
69
69
  gasUsed: import("@typeberry/codec").Descriptor<bigint & import("@typeberry/numbers").WithBytesRepresentation<8> & import("@typeberry/utils").WithOpaque<"ServiceGas[u64]">, import("@typeberry/numbers").U64>;
70
70
  importedSegments: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/numbers").U32>;
71
71
  extrinsicCount: import("@typeberry/codec").Descriptor<import("@typeberry/numbers").U32, import("@typeberry/numbers").U32>;
@@ -67,7 +67,7 @@ export declare class Announcement extends WithDebug {
67
67
  }>>>;
68
68
  }> | null>;
69
69
  ticketsMarker: import("@typeberry/codec").Descriptor<import("@typeberry/block").TicketsMarker | null, import("@typeberry/codec").ViewOf<import("@typeberry/block").TicketsMarker, {
70
- tickets: import("@typeberry/codec").Descriptor<readonly import("@typeberry/block/tickets.js").Ticket[] & import("@typeberry/utils").WithOpaque<"EpochLength">, import("@typeberry/codec").SequenceView<import("@typeberry/block/tickets.js").Ticket, import("@typeberry/codec").ViewOf<import("@typeberry/block/tickets.js").Ticket, {
70
+ tickets: import("@typeberry/codec").Descriptor<readonly import("@typeberry/block").Ticket[] & import("@typeberry/utils").WithOpaque<"EpochLength">, import("@typeberry/codec").SequenceView<import("@typeberry/block").Ticket, import("@typeberry/codec").ViewOf<import("@typeberry/block").Ticket, {
71
71
  id: import("@typeberry/codec").Descriptor<import("@typeberry/bytes").Bytes<32>, import("@typeberry/bytes").Bytes<32>>;
72
72
  attempt: import("@typeberry/codec").Descriptor<number & import("@typeberry/numbers").WithBytesRepresentation<1> & import("@typeberry/utils").WithOpaque<"TicketAttempt[0|1|2]">, import("@typeberry/numbers").U8>;
73
73
  }>>>;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typeberry/node",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "The main typeberry node.",
5
5
  "main": "index.ts",
6
6
  "dependencies": {