Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f9797cd
Moved tasks to better folders
rpanic Mar 2, 2026
efcbfff
Granularized compile tasks
rpanic Mar 2, 2026
1b7ce8a
Fixed bug when settlement is not configured
rpanic Mar 2, 2026
2fdb569
Added missing export
rpanic Mar 3, 2026
1ef6bb2
Made startup flow serial because of sideloaded blockprover vk
rpanic Mar 3, 2026
b5f0786
Added childvkservice setup for settlement compile task
rpanic Mar 3, 2026
0e18960
linting
rpanic Mar 3, 2026
1bcf36e
Made Compile modules definable per protocol module
rpanic Mar 10, 2026
18e1cf2
Made STProof sideloaded
rpanic Mar 10, 2026
7c93047
Made TransactionProof sideloaded in BlockProver
rpanic Mar 10, 2026
be3a79a
Fixed bug in localtaskqueue for quick sequential tasks
rpanic Mar 10, 2026
972a93f
Changed task resolving to inject alias
rpanic Mar 10, 2026
d1e391c
Linting
rpanic Mar 10, 2026
f0427c8
Made all compile tasks be emitted by dependency factories
rpanic Mar 10, 2026
ceaa45f
Fixed task typing
rpanic Mar 10, 2026
4060dc1
Fixed missing @task for IndexBlockTask
rpanic Mar 10, 2026
754bfd3
Merge branch 'feature/task-alias' into feature/compile-task-factories
rpanic Mar 10, 2026
f884e46
Added missing tasks to index.ts
rpanic Mar 10, 2026
266c2d9
Linting
rpanic Mar 10, 2026
fe0bacd
Fixed unset compile registry
rpanic Mar 11, 2026
2c97256
Added protocol constant print function
rpanic Mar 11, 2026
10e6cb6
Fixed printAllConstants
rpanic Mar 12, 2026
f385dfc
Fixed env import order issue in CLI
rpanic Mar 17, 2026
11af687
Added trace logs to reloadAccount
rpanic Mar 17, 2026
64a3617
Fixed deploy script configuration
rpanic Mar 17, 2026
279ef0f
Added nonce fetching for deploy script
rpanic Mar 18, 2026
af176cb
Added retry option to bull queue
rpanic Mar 18, 2026
b65f71e
Made zkProgram getter async and added dynamic computation of proof types
rpanic Mar 20, 2026
28caef8
Fixed non-awaiting toJson in serializers
rpanic Mar 20, 2026
3036196
Made startup faster by disabling feature flag computation for proofs …
rpanic Mar 20, 2026
527c305
Removed dormant log
rpanic Mar 20, 2026
9342a93
Reenabled verifyIf to get rid of last prover bug
rpanic Mar 23, 2026
32b8201
Added runtime root for bridge compile task (bcs seed for sideloading …
rpanic Mar 23, 2026
faec50f
Upgraded o1js
rpanic Feb 25, 2026
325a540
Added native backend to worker-proven test
rpanic Feb 25, 2026
11392b1
Upgraded native prover version
rpanic Mar 24, 2026
8e86645
Removed unnecessary cache dir property
rpanic Mar 24, 2026
b2dee71
Made missing block result be handled more gracefully
rpanic Mar 24, 2026
c25556e
Default console tracer interval increase
rpanic Mar 24, 2026
0f4a1c6
Linting
rpanic Mar 25, 2026
58204e2
Merge branch 'fix/sideloaded-feature-flags' into feature/o1js-native-2
rpanic Mar 25, 2026
69fe1c5
Proven.test.ts native prover backend
rpanic Mar 25, 2026
b83050e
Fix BlockProver test
rpanic Mar 25, 2026
7a31276
Merge branch 'fix/sideloaded-feature-flags' into feature/o1js-native-2
rpanic Mar 25, 2026
5532606
Merge branch 'feature/o1js-native-2' into fix/block-result-recomputation
rpanic Mar 25, 2026
dc8c6ba
Fixed test
rpanic Mar 25, 2026
e583090
Separated tree from leaf store for sequencer
rpanic Mar 25, 2026
dd49e61
Adapted persistence package with tree store changes
rpanic Mar 25, 2026
b7ee47c
Fixed build errors
rpanic Mar 25, 2026
f03d01c
Increased test timeout stprover-emit-sts.test
rpanic Mar 25, 2026
2ef8644
Implemented atomicity separation
rpanic Mar 25, 2026
01ede5f
Changed interface of mergeIntoParent a bit
rpanic Mar 26, 2026
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
531 changes: 60 additions & 471 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"@proto-kit/module": "*",
"@proto-kit/protocol": "*",
"@proto-kit/sequencer": "*",
"o1js": "^2.10.0",
"o1js": "2.10.0-dev.6d3a3",
"@o1js/native": "2.10.0-dev.6d3a3",
"tsyringe": "^4.10.0"
},
"devDependencies": {
Expand Down
10 changes: 8 additions & 2 deletions packages/api/src/graphql/modules/LinkedMerkleWitnessResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from "@proto-kit/common";
import {
AsyncLinkedLeafStore,
AsyncMerkleTreeStore,
CachedLinkedLeafStore,
} from "@proto-kit/sequencer";

Expand Down Expand Up @@ -42,7 +43,9 @@ export class LinkedMerkleWitnessDTO {
export class LinkedMerkleWitnessResolver extends GraphqlModule<object> {
public constructor(
@inject("AsyncLinkedLeafStore")
private readonly treeStore: AsyncLinkedLeafStore
private readonly leafStore: AsyncLinkedLeafStore,
@inject("AsyncTreeStore")
private readonly treeStore: AsyncMerkleTreeStore
) {
super();
}
Expand All @@ -52,7 +55,10 @@ export class LinkedMerkleWitnessResolver extends GraphqlModule<object> {
"Allows retrieval of merkle witnesses corresponding to a specific path in the appchain's state tree. These proves are generally retrieved from the current 'proven' state",
})
public async witness(@Arg("path") path: string) {
const syncStore = await CachedLinkedLeafStore.new(this.treeStore);
const syncStore = await CachedLinkedLeafStore.new(
this.leafStore,
this.treeStore
);

const tree = new LinkedMerkleTree(syncStore.treeStore, syncStore);
await syncStore.preloadKey(BigInt(path));
Expand Down
10 changes: 8 additions & 2 deletions packages/api/src/graphql/modules/MerkleWitnessResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from "@proto-kit/common";
import {
AsyncLinkedLeafStore,
AsyncMerkleTreeStore,
CachedLinkedLeafStore,
} from "@proto-kit/sequencer";

Expand Down Expand Up @@ -92,7 +93,9 @@ export class LinkedTreeWitnessDTO {
export class MerkleWitnessResolver extends GraphqlModule<object> {
public constructor(
@inject("AsyncLinkedLeafStore")
private readonly treeStore: AsyncLinkedLeafStore
private readonly leafStore: AsyncLinkedLeafStore,
@inject("AsyncTreeStore")
private readonly treeStore: AsyncMerkleTreeStore
) {
super();
}
Expand All @@ -102,7 +105,10 @@ export class MerkleWitnessResolver extends GraphqlModule<object> {
"Allows retrieval of merkle witnesses corresponding to a specific path in the appchain's state tree. These proves are generally retrieved from the current 'proven' state",
})
public async witness(@Arg("path") path: string) {
const syncStore = await CachedLinkedLeafStore.new(this.treeStore);
const syncStore = await CachedLinkedLeafStore.new(
this.leafStore,
this.treeStore
);
await syncStore.preloadKey(BigInt(path));

const tree = new LinkedMerkleTree(syncStore.treeStore, syncStore);
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"@proto-kit/sequencer": "*",
"@proto-kit/stack": "*",
"@proto-kit/indexer": "*",
"o1js": "^2.10.0",
"o1js": "2.10.0-dev.6d3a3",
"@o1js/native": "2.10.0-dev.6d3a3",
"tsyringe": "^4.10.0"
},
"devDependencies": {
Expand Down
76 changes: 65 additions & 11 deletions packages/cli/src/scripts/settlement/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import "reflect-metadata";
import { container } from "tsyringe";
import type { Environment } from "@proto-kit/stack";

import {
loadEnvironmentVariables,
Expand All @@ -11,14 +10,28 @@ import { loadUserModules } from "../../utils/loadUserModules";

export default async function (options: LoadEnvOptions) {
try {
const { Provable, PublicKey } = await import("o1js");
loadEnvironmentVariables(options);
const { Provable, PublicKey, PrivateKey } = await import("o1js");
const { Runtime } = await import("@proto-kit/module");
const { Protocol } = await import("@proto-kit/protocol");
const { AppChain, Sequencer, SettlementModule, InMemoryDatabase } =
await import("@proto-kit/sequencer");
const {
AppChain,
Sequencer,
SettlementModule,
InMemoryDatabase,
BatchProducerModule,
BridgingModule,
ConstantFeeStrategy,
InMemoryMinaSigner,
MinaBaseLayer,
PrivateMempool,
LocalTaskQueue,
LocalTaskWorkerModule,
VanillaTaskWorkerModules,
SequencerStartupModule,
} = await import("@proto-kit/sequencer");

const { DefaultModules, DefaultConfigs } = await import("@proto-kit/stack");
loadEnvironmentVariables(options);
const { DefaultConfigs } = await import("@proto-kit/stack");
const { runtime, protocol } = await loadUserModules();
const appChain = AppChain.from({
Runtime: Runtime.from(runtime.modules),
Expand All @@ -28,7 +41,18 @@ export default async function (options: LoadEnvOptions) {
}),
Sequencer: Sequencer.from({
Database: InMemoryDatabase,
...DefaultModules.settlementScript(),
BaseLayer: MinaBaseLayer,
FeeStrategy: ConstantFeeStrategy,
BatchProducerModule,
SettlementModule,
SettlementSigner: InMemoryMinaSigner,
BridgingModule,
Mempool: PrivateMempool,
TaskQueue: LocalTaskQueue,
LocalTaskWorker: LocalTaskWorkerModule.from(
VanillaTaskWorkerModules.allTasks()
),
SequencerStartupModule,
}),
});

Expand All @@ -40,16 +64,46 @@ export default async function (options: LoadEnvOptions) {
},
Sequencer: {
...DefaultConfigs.inMemoryDatabase(),
...DefaultConfigs.settlementScript({
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
preset: options.env as Environment,
}),
BaseLayer: {
network: {
// eslint-disable-next-line max-len
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions,@typescript-eslint/no-unsafe-assignment
type: process.env.MINA_NETWORK as any,
graphql: process.env.MINA_NODE_GRAPHQL!,
archive: process.env.MINA_ARCHIVE_GRAPHQL!,
accountManager: process.env.MINA_ACCOUNT_MANAGER!,
},
},
SettlementSigner: {
feepayer: PrivateKey.fromBase58(
process.env.PROTOKIT_SEQUENCER_PRIVATE_KEY!
),
contractKeys: [
PrivateKey.fromBase58(
process.env.PROTOKIT_SETTLEMENT_CONTRACT_PRIVATE_KEY!
),
PrivateKey.fromBase58(
process.env.PROTOKIT_DISPATCHER_CONTRACT_PRIVATE_KEY!
),
PrivateKey.fromBase58(
process.env.PROTOKIT_MINA_BRIDGE_CONTRACT_PRIVATE_KEY!
),
],
},
FeeStrategy: {},
BatchProducerModule: {},
SettlementModule: {
addresses: undefined,
},
BridgingModule: {
addresses: undefined,
},
SequencerStartupModule: {},
TaskQueue: {
simulatedDuration: 0,
},
LocalTaskWorker: VanillaTaskWorkerModules.defaultConfig(),
Mempool: {},
},
});

Expand Down
3 changes: 2 additions & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"typescript-memoize": "^1.1.1"
},
"peerDependencies": {
"o1js": "^2.10.0",
"o1js": "2.10.0-dev.6d3a3",
"@o1js/native": "2.10.0-dev.6d3a3",
"tsyringe": "^4.10.0"
},
"devDependencies": {
Expand Down
2 changes: 0 additions & 2 deletions packages/common/src/cache/ProxyCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export class ProxyCache implements O1Cache {

debug = false;

cacheDirectory = this.realCache.cacheDirectory;

public read(header: CacheHeader): Uint8Array | undefined {
return this.realCache.read(header);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ export class ChildVerificationKeyService {
}
return artifact.verificationKey;
}

public getAsConstant(name: string) {
const vk = this.getVerificationKey(name);
if (!vk.hash.isConstant()) {
throw new Error("Sanity check - vk hash has to be constant");
}
return vk;
}
}
7 changes: 7 additions & 0 deletions packages/common/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,10 @@ export function assertDefined<T>(
throw new Error(msg ?? "Value is undefined");
}
}

export function takeFirst<T>(arr: T[]): T {
if (arr.length === 0) {
throw new Error("takeFirst called with empty array");
}
return arr[0];
}
27 changes: 27 additions & 0 deletions packages/common/src/zkProgrammable/FeatureFlagsExtension.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { FeatureFlags } from "o1js";

function combineFeatureFlag(a: boolean | undefined, b: boolean | undefined) {
if (a === true || b === true) {
return true;
} else if (a === undefined || b === undefined) {
return undefined;
} else {
return false;
}
}

export function combineFeatureFlags(
a: FeatureFlags,
b: FeatureFlags
): FeatureFlags {
return {
xor: combineFeatureFlag(a.xor, b.xor),
rot: combineFeatureFlag(a.rot, b.rot),
lookup: combineFeatureFlag(a.lookup, b.lookup),
foreignFieldAdd: combineFeatureFlag(a.foreignFieldAdd, b.foreignFieldAdd),
foreignFieldMul: combineFeatureFlag(a.foreignFieldMul, b.foreignFieldMul),
rangeCheck0: combineFeatureFlag(a.rangeCheck0, b.rangeCheck0),
rangeCheck1: combineFeatureFlag(a.rangeCheck1, b.rangeCheck1),
runtimeTables: combineFeatureFlag(a.runtimeTables, b.runtimeTables),
};
}
Loading
Loading