Skip to content

Commit

Permalink
Use binary CID encoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
lthibault committed Aug 14, 2023
1 parent 4cbf557 commit 8998673
Show file tree
Hide file tree
Showing 9 changed files with 193 additions and 180 deletions.
12 changes: 6 additions & 6 deletions api/process.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Executor {
# be available at the process bootContext.
#
# The Process capability is associated to the created process.
execCached @1 (cid :Text, ppid :UInt32, bctx :BootContext) -> (process :Process);
execCached @1 (cid :Data, ppid :UInt32, bctx :BootContext) -> (process :Process);
# Same as Exec, but the bytecode is directly from the BytecodeRegistry.
# Provides a significant performance improvement for medium to large
# WASM streams.
Expand All @@ -24,11 +24,11 @@ interface Executor {
interface BytecodeCache {
# BytecodeCache is used to store WASM byte code. May be implemented with
# anchors or any other means.
put @0 (bytecode :Data) -> (cid :Text);
put @0 (bytecode :Data) -> (cid :Data);
# Put stores the bytecode and returns the cid of the submitted bytecode.
get @1 (cid :Text) -> (bytecode :Data);
get @1 (cid :Data) -> (bytecode :Data);
# Get returns the bytecode matching a cid if there's a match, null otherwise.
has @2 (cid :Text) -> (has :Bool);
has @2 (cid :Data) -> (has :Bool);
# Has returns true if a bytecode identified by the cid has been previously stored.
}

Expand All @@ -45,13 +45,13 @@ interface BootContext {
# passed by the parent process.
pid @0 () -> (pid :UInt32);
# PID of the process.
cid @1 () -> (cid :Text);
cid @1 () -> (cid :Data);
# CID of the process bytecode.
args @2 () -> (args :List(Text));
# CLI arguments.
caps @3 () -> (caps :List(Capability));
# Capabilities.

setPid @4 (pid :UInt32) -> ();
setCid @5 (cid :Text) -> ();
setCid @5 (cid :Data) -> ();
}
255 changes: 112 additions & 143 deletions api/process/process.capnp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8998673

Please sign in to comment.