@aztec/native 0.0.1-commit.b655e406 → 0.0.1-commit.b8a057fa
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/dest/index.d.ts +1 -1
- package/dest/msgpack_channel.d.ts +1 -1
- package/dest/msgpack_channel.d.ts.map +1 -1
- package/dest/msgpack_channel.js +1 -1
- package/dest/native_module.d.ts +1 -10
- package/dest/native_module.d.ts.map +1 -1
- package/dest/native_module.js +6 -22
- package/package.json +8 -10
- package/src/msgpack_channel.ts +1 -1
- package/src/native_module.ts +7 -33
- package/build/amd64-linux/nodejs_module.node +0 -0
- package/build/amd64-macos/nodejs_module.node +0 -0
- package/build/arm64-linux/nodejs_module.node +0 -0
- package/build/arm64-macos/nodejs_module.node +0 -0
package/dest/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from './native_module.js';
|
|
2
2
|
export { type RoundtripDuration, MsgpackChannel } from './msgpack_channel.js';
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLE9BQU8sRUFBRSxLQUFLLGlCQUFpQixFQUFFLGNBQWMsRUFBRSxNQUFNLHNCQUFzQixDQUFDIn0=
|
|
@@ -22,4 +22,4 @@ export declare class MsgpackChannel<M extends number = number, Req extends Messa
|
|
|
22
22
|
}>;
|
|
23
23
|
}
|
|
24
24
|
export {};
|
|
25
|
-
//# sourceMappingURL=
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXNncGFja19jaGFubmVsLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cm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FBQztRQUFDLFFBQVEsRUFBRSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUE7S0FBRSxDQUFDLENBMEQ3RDtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"msgpack_channel.d.ts","sourceRoot":"","sources":["../src/msgpack_channel.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;CAC9D;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAYF,KAAK,WAAW,CAAC,CAAC,SAAS,MAAM,IAAI;KAAG,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI;CAAE,CAAC;AAEjE,qBAAa,cAAc,CACzB,CAAC,SAAS,MAAM,GAAG,MAAM,EACzB,GAAG,SAAS,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG,EAChC,IAAI,SAAS,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG;IAYd,OAAO,CAAC,IAAI;IAV/B,mCAAmC;IACnC,OAAO,CAAC,OAAO,CAKZ;IAEH,OAAO,CAAC,KAAK,CAAK;
|
|
1
|
+
{"version":3,"file":"msgpack_channel.d.ts","sourceRoot":"","sources":["../src/msgpack_channel.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;CAC9D;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAYF,KAAK,WAAW,CAAC,CAAC,SAAS,MAAM,IAAI;KAAG,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI;CAAE,CAAC;AAEjE,qBAAa,cAAc,CACzB,CAAC,SAAS,MAAM,GAAG,MAAM,EACzB,GAAG,SAAS,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG,EAChC,IAAI,SAAS,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG;IAYd,OAAO,CAAC,IAAI;IAV/B,mCAAmC;IACnC,OAAO,CAAC,OAAO,CAKZ;IAEH,OAAO,CAAC,KAAK,CAAK;IAElB,YAA2B,IAAI,EAAE,eAAe,EAAI;IAEvC,WAAW,CAAC,CAAC,SAAS,CAAC,EAClC,OAAO,EAAE,CAAC,EACV,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,GACX,OAAO,CAAC;QAAE,QAAQ,EAAE,iBAAiB,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;KAAE,CAAC,CA0D7D;CACF"}
|
package/dest/msgpack_channel.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import { MessageHeader, TypedMessage } from '@aztec/foundation/message';
|
|
3
3
|
import { Encoder, addExtension } from 'msgpackr';
|
|
4
4
|
import { isAnyArrayBuffer } from 'util/types';
|
package/dest/native_module.d.ts
CHANGED
|
@@ -2,15 +2,6 @@ import type { MessageReceiver } from './msgpack_channel.js';
|
|
|
2
2
|
interface NativeClassCtor {
|
|
3
3
|
new (...args: unknown[]): MessageReceiver;
|
|
4
4
|
}
|
|
5
|
-
export declare const NativeWorldState: NativeClassCtor;
|
|
6
5
|
export declare const NativeLMDBStore: NativeClassCtor;
|
|
7
|
-
/**
|
|
8
|
-
* AVM simulation function that uses pre-collected hints from TypeScript simulation.
|
|
9
|
-
* All contract data and merkle tree hints are included in the AvmCircuitInputs, so no runtime
|
|
10
|
-
* callbacks to TS or WS pointer are needed.
|
|
11
|
-
* @param inputs - Msgpack-serialized AvmCircuitInputs (AvmProvingInputs in C++) buffer
|
|
12
|
-
* @returns Promise resolving to msgpack-serialized simulation results buffer
|
|
13
|
-
*/
|
|
14
|
-
export declare const avmSimulateWithHintedDbs: (inputs: Buffer) => Promise<Buffer>;
|
|
15
6
|
export {};
|
|
16
|
-
//# sourceMappingURL=
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmF0aXZlX21vZHVsZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL25hdGl2ZV9tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSUEsT0FBTyxLQUFLLEVBQUUsZUFBZSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFFNUQsVUFBVSxlQUFlO0lBQ3ZCLEtBQUssR0FBRyxJQUFJLEVBQUUsT0FBTyxFQUFFLEdBQUcsZUFBZSxDQUFDO0NBQzNDO0FBYUQsZUFBTyxNQUFNLGVBQWUsRUFBRSxlQUEyRCxDQUFDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native_module.d.ts","sourceRoot":"","sources":["../src/native_module.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,UAAU,eAAe;IACvB,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC;CAC3C;
|
|
1
|
+
{"version":3,"file":"native_module.d.ts","sourceRoot":"","sources":["../src/native_module.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,UAAU,eAAe;IACvB,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC;CAC3C;AAaD,eAAO,MAAM,eAAe,EAAE,eAA2D,CAAC"}
|
package/dest/native_module.js
CHANGED
|
@@ -1,28 +1,12 @@
|
|
|
1
|
+
import { findNapiBinary } from '@aztec/bb.js';
|
|
1
2
|
import { createRequire } from 'module';
|
|
2
|
-
import { dirname, join } from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
3
|
function loadNativeModule() {
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const platform = process.platform === 'darwin' ? 'macos' : process.platform;
|
|
10
|
-
const variant = `${arch}-${platform}`;
|
|
11
|
-
const modulePath = join(__dirname, '..', 'build', variant, 'nodejs_module.node');
|
|
12
|
-
try {
|
|
13
|
-
const require = createRequire(import.meta.url);
|
|
14
|
-
return require(modulePath);
|
|
15
|
-
} catch (error) {
|
|
16
|
-
throw new Error(`Failed to load native module for ${variant} from ${modulePath}. ` + `Supported: amd64-linux, arm64-linux, amd64-macos, arm64-macos. ` + `Error: ${error}`);
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
5
|
+
const napiPath = findNapiBinary();
|
|
6
|
+
if (!napiPath) {
|
|
7
|
+
throw new Error('NAPI binary not found for current platform.');
|
|
17
8
|
}
|
|
9
|
+
return require(napiPath);
|
|
18
10
|
}
|
|
19
11
|
const nativeModule = loadNativeModule();
|
|
20
|
-
export const NativeWorldState = nativeModule.WorldState;
|
|
21
12
|
export const NativeLMDBStore = nativeModule.LMDBStore;
|
|
22
|
-
/**
|
|
23
|
-
* AVM simulation function that uses pre-collected hints from TypeScript simulation.
|
|
24
|
-
* All contract data and merkle tree hints are included in the AvmCircuitInputs, so no runtime
|
|
25
|
-
* callbacks to TS or WS pointer are needed.
|
|
26
|
-
* @param inputs - Msgpack-serialized AvmCircuitInputs (AvmProvingInputs in C++) buffer
|
|
27
|
-
* @returns Promise resolving to msgpack-serialized simulation results buffer
|
|
28
|
-
*/ export const avmSimulateWithHintedDbs = nativeModule.avmSimulateWithHintedDbs;
|
package/package.json
CHANGED
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/native",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.b8a057fa",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "yarn clean &&
|
|
10
|
-
"build:dev": "tsc
|
|
11
|
-
"build:cpp": "PROJECT=$(pwd); cd $(git rev-parse --show-toplevel)/barretenberg/cpp; cmake --preset ${PRESET:-clang16-pic} && cmake --build --preset ${PRESET:-clang16-pic} --target nodejs_module && cd $PROJECT && yarn generate",
|
|
12
|
-
"clean:cpp": "rm -rf $(git rev-parse --show-toplevel)/barretenberg/cpp/build-pic",
|
|
9
|
+
"build": "yarn clean && ../scripts/tsc.sh",
|
|
10
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
13
11
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
14
|
-
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
15
|
-
"generate": "bash scripts/copy_modules.sh"
|
|
12
|
+
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
16
13
|
},
|
|
17
14
|
"inherits": [
|
|
18
|
-
"../package.common.json"
|
|
19
|
-
"./package.local.json"
|
|
15
|
+
"../package.common.json"
|
|
20
16
|
],
|
|
21
17
|
"dependencies": {
|
|
22
|
-
"@aztec/
|
|
18
|
+
"@aztec/bb.js": "0.0.1-commit.b8a057fa",
|
|
19
|
+
"@aztec/foundation": "0.0.1-commit.b8a057fa",
|
|
23
20
|
"msgpackr": "^1.11.2"
|
|
24
21
|
},
|
|
25
22
|
"devDependencies": {
|
|
26
23
|
"@jest/globals": "^30.0.0",
|
|
27
24
|
"@types/jest": "^30.0.0",
|
|
28
25
|
"@types/node": "^22.15.17",
|
|
26
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
29
27
|
"jest": "^30.0.0",
|
|
30
28
|
"ts-node": "^10.9.1",
|
|
31
29
|
"typescript": "^5.3.3"
|
package/src/msgpack_channel.ts
CHANGED
package/src/native_module.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { findNapiBinary } from '@aztec/bb.js';
|
|
2
|
+
|
|
1
3
|
import { createRequire } from 'module';
|
|
2
|
-
import { dirname, join } from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
4
|
|
|
5
5
|
import type { MessageReceiver } from './msgpack_channel.js';
|
|
6
6
|
|
|
@@ -9,40 +9,14 @@ interface NativeClassCtor {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
function loadNativeModule(): Record<string, NativeClassCtor> {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const arch = process.arch === 'x64' ? 'amd64' : process.arch;
|
|
17
|
-
const platform = process.platform === 'darwin' ? 'macos' : process.platform;
|
|
18
|
-
const variant = `${arch}-${platform}`;
|
|
19
|
-
|
|
20
|
-
const modulePath = join(__dirname, '..', 'build', variant, 'nodejs_module.node');
|
|
21
|
-
|
|
22
|
-
try {
|
|
23
|
-
const require = createRequire(import.meta.url);
|
|
24
|
-
return require(modulePath);
|
|
25
|
-
} catch (error) {
|
|
26
|
-
throw new Error(
|
|
27
|
-
`Failed to load native module for ${variant} from ${modulePath}. ` +
|
|
28
|
-
`Supported: amd64-linux, arm64-linux, amd64-macos, arm64-macos. ` +
|
|
29
|
-
`Error: ${error}`,
|
|
30
|
-
);
|
|
12
|
+
const require = createRequire(import.meta.url);
|
|
13
|
+
const napiPath = findNapiBinary();
|
|
14
|
+
if (!napiPath) {
|
|
15
|
+
throw new Error('NAPI binary not found for current platform.');
|
|
31
16
|
}
|
|
17
|
+
return require(napiPath);
|
|
32
18
|
}
|
|
33
19
|
|
|
34
20
|
const nativeModule: Record<string, NativeClassCtor | Function> = loadNativeModule();
|
|
35
21
|
|
|
36
|
-
export const NativeWorldState: NativeClassCtor = nativeModule.WorldState as NativeClassCtor;
|
|
37
22
|
export const NativeLMDBStore: NativeClassCtor = nativeModule.LMDBStore as NativeClassCtor;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* AVM simulation function that uses pre-collected hints from TypeScript simulation.
|
|
41
|
-
* All contract data and merkle tree hints are included in the AvmCircuitInputs, so no runtime
|
|
42
|
-
* callbacks to TS or WS pointer are needed.
|
|
43
|
-
* @param inputs - Msgpack-serialized AvmCircuitInputs (AvmProvingInputs in C++) buffer
|
|
44
|
-
* @returns Promise resolving to msgpack-serialized simulation results buffer
|
|
45
|
-
*/
|
|
46
|
-
export const avmSimulateWithHintedDbs: (inputs: Buffer) => Promise<Buffer> = nativeModule.avmSimulateWithHintedDbs as (
|
|
47
|
-
inputs: Buffer,
|
|
48
|
-
) => Promise<Buffer>;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|