Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2a20579
added execution for proof-less transactions
Roee-87 Nov 6, 2025
268f8fc
fixed build errors
Roee-87 Nov 6, 2025
c27246a
added docstring to devnode_execute
Roee-87 Nov 6, 2025
9c8566a
added flag to ExecuteOptions for devnode transactions
Roee-87 Nov 6, 2025
9ccf673
cleanup
Roee-87 Nov 6, 2025
cbbaef5
added program to process in devnode_execute
Roee-87 Nov 6, 2025
df6b0f9
added evaluation check for devnode execution
Roee-87 Nov 6, 2025
256cc22
fixed indentations
Roee-87 Nov 7, 2025
48e053f
ran cargo fmt
Roee-87 Nov 7, 2025
f4dda32
added code for devnode deployments
Roee-87 Nov 14, 2025
e3f56da
set edition to 0 for devnode deploy
Roee-87 Nov 14, 2025
ffe8043
added method for fetching program edition
Roee-87 Nov 19, 2025
aea94c2
added code for generating deployment txn without certificate
Roee-87 Nov 19, 2025
c30da85
ran cargo fmt
Roee-87 Nov 19, 2025
b83918f
revert changes to index.js
Roee-87 Nov 20, 2025
60d724d
removed snarkvm dev features from Cargo.toml
Roee-87 Nov 24, 2025
dadb68e
added consts for devnode vkey and cert
Roee-87 Nov 24, 2025
8e77c2d
updated snarkvm rev
Roee-87 Nov 24, 2025
1fdc0f3
refactored assert! in devnode deploy
Roee-87 Nov 24, 2025
12a137d
added devnode upgrade
Roee-87 Nov 24, 2025
1abc681
refactored to include separate execution and deployment methods for d…
Roee-87 Nov 24, 2025
9044cff
ran cargo fmt
Roee-87 Nov 24, 2025
3204a23
updated devnode deploy
Roee-87 Nov 24, 2025
635ca62
pulled in latest main
Roee-87 Nov 24, 2025
031da5f
Delete .env
Roee-87 Nov 24, 2025
d98b7e6
Delete create-leo-app/template-node/.env
Roee-87 Nov 24, 2025
9994ac8
added devnode upgrade to program manager and updated docs
Roee-87 Nov 24, 2025
91e536b
updated build devnode upgrade method
Roee-87 Nov 24, 2025
2ecc9a1
fixed docstrings
Roee-87 Nov 25, 2025
98e4baf
fixed docstrings
Roee-87 Nov 25, 2025
fba72b9
added create-leo-app example
Roee-87 Nov 25, 2025
b9f68eb
fixed typo
Roee-87 Nov 25, 2025
5e14c26
updated readme
Roee-87 Nov 25, 2025
8be8621
replaced log! with log
Roee-87 Nov 25, 2025
f75dabe
regenerated docs
Roee-87 Nov 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 75 additions & 52 deletions sdk/src/program-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ interface ExecuteOptions {
program?: string | Program;
imports?: ProgramImports;
edition?: number,
skipProof?: boolean,
}

/**
Expand Down Expand Up @@ -580,6 +581,12 @@ class ProgramManager {
let programName = options.programName;
let imports = options.imports;
let edition = options.edition;
let skipProof = options.skipProof;

// Skip proof defaults to false.
if (typeof skipProof === "undefined") {
skipProof = false;
}

// Ensure the function exists on the network
if (program === undefined) {
Expand Down Expand Up @@ -640,32 +647,6 @@ class ProgramManager {
);
}

// Get the fee proving and verifying keys from the key provider
let feeKeys;
try {
feeKeys = privateFee
? <FunctionKeyPair>await this.keyProvider.feePrivateKeys()
: <FunctionKeyPair>await this.keyProvider.feePublicKeys();
} catch (e: any) {
logAndThrow(
`Error finding fee keys. Key finder response: '${e.message}'. Please ensure your key provider is configured correctly.`,
);
}
const [feeProvingKey, feeVerifyingKey] = feeKeys;

// If the function proving and verifying keys are not provided, attempt to find them using the key provider
if (!provingKey || !verifyingKey) {
try {
[provingKey, verifyingKey] = <FunctionKeyPair>(
await this.keyProvider.functionKeys(keySearchParams)
);
} catch (e) {
console.log(
`Function keys not found. Key finder response: '${e}'. The function keys will be synthesized`,
);
}
}

// Resolve the program imports if they exist
const numberOfImports = Program.fromString(program).getImports().length;
if (numberOfImports > 0 && !imports) {
Expand All @@ -679,35 +660,77 @@ class ProgramManager {
);
}
}

if (offlineQuery && !this.inclusionKeysLoaded) {
if (skipProof === true) {
console.log("program is: {}", program);
// Build a transaction without a proof
return await WasmProgramManager.buildDevnodeExecutionTransaction(
executionPrivateKey,
program,
functionName,
inputs,
priorityFee,
feeRecord,
this.host,
imports,
offlineQuery,
edition
);
} else {
// Get the fee proving and verifying keys from the key provider
let feeKeys;
try {
const inclusionKeys = await this.keyProvider.inclusionKeys();
WasmProgramManager.loadInclusionProver(inclusionKeys[0])
this.inclusionKeysLoaded = true;
console.log("Successfully loaded inclusion key");
} catch {
logAndThrow(`Inclusion key bytes not loaded, please ensure the program manager is initialized with a KeyProvider that includes the inclusion key.`)
feeKeys = privateFee
? <FunctionKeyPair>await this.keyProvider.feePrivateKeys()
: <FunctionKeyPair>await this.keyProvider.feePublicKeys();
} catch (e: any) {
logAndThrow(
`Error finding fee keys. Key finder response: '${e.message}'. Please ensure your key provider is configured correctly.`,
);
}
const [feeProvingKey, feeVerifyingKey] = feeKeys;

// If the function proving and verifying keys are not provided, attempt to find them using the key provider
if (!provingKey || !verifyingKey) {
try {
[provingKey, verifyingKey] = <FunctionKeyPair>(
await this.keyProvider.functionKeys(keySearchParams)
);
} catch (e) {
console.log(
`Function keys not found. Key finder response: '${e}'. The function keys will be synthesized`,
);
}
}
}

// Build an execution transaction
return await WasmProgramManager.buildExecutionTransaction(
executionPrivateKey,
program,
functionName,
inputs,
priorityFee,
feeRecord,
this.host,
imports,
provingKey,
verifyingKey,
feeProvingKey,
feeVerifyingKey,
offlineQuery,
edition
);
if (offlineQuery && !this.inclusionKeysLoaded) {
try {
const inclusionKeys = await this.keyProvider.inclusionKeys();
WasmProgramManager.loadInclusionProver(inclusionKeys[0])
this.inclusionKeysLoaded = true;
console.log("Successfully loaded inclusion key");
} catch {
logAndThrow(`Inclusion key bytes not loaded, please ensure the program manager is initialized with a KeyProvider that includes the inclusion key.`)
}
}

// Build an execution transaction
return await WasmProgramManager.buildExecutionTransaction(
executionPrivateKey,
program,
functionName,
inputs,
priorityFee,
feeRecord,
this.host,
imports,
provingKey,
verifyingKey,
feeProvingKey,
feeVerifyingKey,
offlineQuery,
edition
);
}
}

/**
Expand Down
Loading
Loading