@corpus-core/colibri-stateless 2.0.5 → 3.0.0
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/c4w.js +1 -1
- package/c4w.wasm +0 -0
- package/chains.d.ts +2 -10
- package/chains.generated.d.ts +10 -0
- package/chains.generated.js +97 -0
- package/chains.js +2 -79
- package/cjs/chains.generated.js +100 -0
- package/cjs/chains.js +6 -83
- package/cjs/index.js +11 -1
- package/cjs/runtime_node.js +1 -0
- package/cjs/runtime_wasm.js +3 -0
- package/cjs/transactionVerifier.js +462 -51
- package/cjs/wasm.js +2 -1
- package/cjs/wasm_cjs.js +2 -1
- package/cjs/wasm_shared.js +9 -0
- package/index.d.ts +6 -1
- package/index.js +10 -1
- package/package.json +3 -2
- package/prebuilds/darwin-arm64/colibri_native.node +0 -0
- package/prebuilds/darwin-x64/colibri_native.node +0 -0
- package/prebuilds/linux-arm64/colibri_native.node +0 -0
- package/prebuilds/linux-x64/colibri_native.node +0 -0
- package/prebuilds/win32-x64/colibri_native.node +0 -0
- package/runtime.d.ts +1 -0
- package/runtime_node.js +1 -0
- package/runtime_wasm.js +3 -0
- package/transactionVerifier.d.ts +21 -14
- package/transactionVerifier.js +461 -51
- package/types.d.ts +8 -0
- package/wasm.d.ts +1 -0
- package/wasm.js +1 -0
- package/wasm_cjs.d.ts +1 -0
- package/wasm_cjs.js +1 -0
- package/wasm_shared.d.ts +2 -0
- package/wasm_shared.js +9 -0
package/wasm_cjs.js
CHANGED
|
@@ -56,6 +56,7 @@ export const loadC4WModule = api.loadC4WModule;
|
|
|
56
56
|
export const getC4w = api.getC4w;
|
|
57
57
|
export const get_prover_config_hex = api.get_prover_config_hex;
|
|
58
58
|
export const set_trusted_checkpoint = api.set_trusted_checkpoint;
|
|
59
|
+
export const reset_caches = api.reset_caches;
|
|
59
60
|
export const decode_proof = api.decode_proof;
|
|
60
61
|
/**
|
|
61
62
|
* Returns the directory of the compiled module. Used in Node to locate
|
package/wasm_shared.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export interface C4W {
|
|
|
37
37
|
_c4w_execute_rpc_ctx: (ctx: number) => number;
|
|
38
38
|
_c4w_free_rpc_ctx: (ctx: number) => void;
|
|
39
39
|
_c4w_set_checkpoint: (chainId: bigint, checkpoint: number) => void;
|
|
40
|
+
_c4w_reset_caches: () => void;
|
|
40
41
|
_c4w_rpc_ctx_set_witness_keys: (ctx: number, keys: number) => void;
|
|
41
42
|
_c4w_rpc_ctx_set_proxy_urls: (ctx: number, rpc_urls: number, beacon_urls: number) => void;
|
|
42
43
|
_c4w_rpc_ctx_set_min_latest_block_ts: (ctx: number, ts: bigint) => void;
|
|
@@ -74,5 +75,6 @@ export declare function createC4wApi(options: {
|
|
|
74
75
|
getC4w: () => Promise<C4W>;
|
|
75
76
|
get_prover_config_hex: (chainId: number) => Promise<string>;
|
|
76
77
|
set_trusted_checkpoint: (chainId: number, checkpoint: string) => Promise<void>;
|
|
78
|
+
reset_caches: () => Promise<void>;
|
|
77
79
|
decode_proof: (proof: Uint8Array) => Promise<any>;
|
|
78
80
|
};
|
package/wasm_shared.js
CHANGED
|
@@ -246,6 +246,14 @@ export function createC4wApi(options) {
|
|
|
246
246
|
c4w._c4w_set_checkpoint(BigInt(chainId), as_char_ptr(checkpoint, c4w, free_buffers));
|
|
247
247
|
free_buffers.forEach(ptr => c4w._free(ptr));
|
|
248
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* Clears in-process prover/verifier caches (header tags, EL headers, PAP
|
|
251
|
+
* tx cache, prover cache). Persistent storage is left to the host.
|
|
252
|
+
*/
|
|
253
|
+
async function reset_caches() {
|
|
254
|
+
const c4w = await getC4w();
|
|
255
|
+
c4w._c4w_reset_caches();
|
|
256
|
+
}
|
|
249
257
|
async function decode_proof(proof) {
|
|
250
258
|
const c4w = await getC4w();
|
|
251
259
|
const ptr = copy_to_c(proof, c4w);
|
|
@@ -261,6 +269,7 @@ export function createC4wApi(options) {
|
|
|
261
269
|
getC4w,
|
|
262
270
|
get_prover_config_hex,
|
|
263
271
|
set_trusted_checkpoint,
|
|
272
|
+
reset_caches,
|
|
264
273
|
decode_proof,
|
|
265
274
|
};
|
|
266
275
|
}
|