Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
davibauer authored and 1Mateus committed Feb 27, 2024
1 parent 2f2f0ba commit 9218e5d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 21 deletions.
3 changes: 1 addition & 2 deletions packages/gramine/bazk-build/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
/node.manifest.sgx
/node.sig
/bin
challenge
curl
challenge
2 changes: 1 addition & 1 deletion packages/gramine/bazk-build/bazk.manifest.template
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ path = "/app"
uri = "file:app"

[sgx]
debug = false
debug = true
nonpie_binary = true
enclave_size = "4G"
max_threads = 16
Expand Down
Binary file added packages/gramine/bazk-build/curl
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/gramine/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# TODO: move this to another repos
cp -r dist bazk-build/app
cp -L $(which curl) bazk-build/
# cp -L $(which curl) bazk-build/

# Run Docker without TTY in a non-interactive environment
sudo docker run \
Expand Down
3 changes: 3 additions & 0 deletions packages/gramine/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ async function main(args?: any) {
try {
console.log("[Enclave] Running command...: ", commandfileName, fileArgs);


console.log('HEY BRO')
const { stdout, stderr } = await execFile(commandfileName, fileArgs);

console.log("[Enclave] Command executed");
Expand All @@ -186,6 +188,7 @@ async function main(args?: any) {
console.log("[Enclave] Command executed successfully");
console.log("[Enclave] Getting input file name...");

console.log('getMetadatas')
const metadataArray = await getMetadatas(
commandfileName,
power,
Expand Down
28 changes: 11 additions & 17 deletions packages/gramine/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
export const getPhase = (name: string) => {
export const getPhase = (command: string) => {
if (
[
'prepare_phase2',
'new_constrained',
'compute_constrained',
'verify_transform_constrained',
].includes(name)
command.includes("new_constrained") ||
command.includes("compute_constrained") ||
command.includes("verify_transform_constrained") ||
command.includes("compute_constrained") ||
command.includes("prepare_phase2")
) {
return 1;
}

if (
[
'new',
'contribute',
'verify_contribution',
]
} else if (
command.includes("new") ||
command.includes("contribute") ||
command.includes("verify_contribution")
) {
return 2
return 2;
}

return 0;
}

0 comments on commit 9218e5d

Please sign in to comment.