Skip to content

Commit

Permalink
submit sharp job (#125)
Browse files Browse the repository at this point in the history
Resolves #17
  • Loading branch information
tcoratger authored Dec 1, 2024
1 parent a021ac8 commit 1f430e4
Show file tree
Hide file tree
Showing 8 changed files with 411 additions and 15 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
HYPOTHESIS_PROFILE=dev
ATLANTIC_API_KEY=
45 changes: 45 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ rand = "0.8.5"
thiserror = "1.0"
url = "2.5"
reqwest = { version = "0.12", features = ["multipart"] }
mockito = "1"
18 changes: 18 additions & 0 deletions cairo/programs/fibonacci.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
func main() {
// Call fib(1, 1, 10).
let result: felt = fib(1, 1, 10);

// Make sure the 10th Fibonacci number is 144.
assert result = 144;
ret;
}

func fib(first_element, second_element, n) -> (res: felt) {
jmp fib_body if n != 0;
tempvar result = second_element;
return (second_element,);

fib_body:
tempvar y = first_element + second_element;
return fib(second_element, y, n - 1);
}
260 changes: 260 additions & 0 deletions cairo/programs/fibonacci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
{
"attributes": [],
"builtins": [],
"compiler_version": "0.13.2",
"data": [
"0x40780017fff7fff",
"0x0",
"0x1104800180018000",
"0x4",
"0x10780017fff7fff",
"0x0",
"0x480680017fff8000",
"0x1",
"0x480680017fff8000",
"0x1",
"0x480680017fff8000",
"0xa",
"0x1104800180018000",
"0x5",
"0x400680017fff7fff",
"0x90",
"0x208b7fff7fff7ffe",
"0x20780017fff7ffd",
"0x5",
"0x480a7ffc7fff8000",
"0x480a7ffc7fff8000",
"0x208b7fff7fff7ffe",
"0x482a7ffc7ffb8000",
"0x480a7ffc7fff8000",
"0x48127ffe7fff8000",
"0x482680017ffd8000",
"0x800000000000011000000000000000000000000000000000000000000000000",
"0x1104800180018000",
"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff7",
"0x208b7fff7fff7ffe"
],
"debug_info": null,
"hints": {},
"identifiers": {
"__main__.__end__": {
"pc": 4,
"type": "label"
},
"__main__.__start__": {
"pc": 0,
"type": "label"
},
"__main__.fib": {
"decorators": [],
"pc": 17,
"type": "function"
},
"__main__.fib.Args": {
"full_name": "__main__.fib.Args",
"members": {
"first_element": {
"cairo_type": "felt",
"offset": 0
},
"n": {
"cairo_type": "felt",
"offset": 2
},
"second_element": {
"cairo_type": "felt",
"offset": 1
}
},
"size": 3,
"type": "struct"
},
"__main__.fib.ImplicitArgs": {
"full_name": "__main__.fib.ImplicitArgs",
"members": {},
"size": 0,
"type": "struct"
},
"__main__.fib.Return": {
"cairo_type": "(res: felt)",
"type": "type_definition"
},
"__main__.fib.SIZEOF_LOCALS": {
"type": "const",
"value": 0
},
"__main__.fib.fib_body": {
"pc": 22,
"type": "label"
},
"__main__.fib.first_element": {
"cairo_type": "felt",
"full_name": "__main__.fib.first_element",
"references": [
{
"ap_tracking_data": {
"group": 4,
"offset": 0
},
"pc": 17,
"value": "[cast(fp + (-5), felt*)]"
}
],
"type": "reference"
},
"__main__.fib.n": {
"cairo_type": "felt",
"full_name": "__main__.fib.n",
"references": [
{
"ap_tracking_data": {
"group": 4,
"offset": 0
},
"pc": 17,
"value": "[cast(fp + (-3), felt*)]"
}
],
"type": "reference"
},
"__main__.fib.result": {
"cairo_type": "felt",
"full_name": "__main__.fib.result",
"references": [
{
"ap_tracking_data": {
"group": 4,
"offset": 1
},
"pc": 20,
"value": "[cast(ap + (-1), felt*)]"
}
],
"type": "reference"
},
"__main__.fib.second_element": {
"cairo_type": "felt",
"full_name": "__main__.fib.second_element",
"references": [
{
"ap_tracking_data": {
"group": 4,
"offset": 0
},
"pc": 17,
"value": "[cast(fp + (-4), felt*)]"
}
],
"type": "reference"
},
"__main__.fib.y": {
"cairo_type": "felt",
"full_name": "__main__.fib.y",
"references": [
{
"ap_tracking_data": {
"group": 4,
"offset": 1
},
"pc": 23,
"value": "[cast(ap + (-1), felt*)]"
}
],
"type": "reference"
},
"__main__.main": {
"decorators": [],
"pc": 6,
"type": "function"
},
"__main__.main.Args": {
"full_name": "__main__.main.Args",
"members": {},
"size": 0,
"type": "struct"
},
"__main__.main.ImplicitArgs": {
"full_name": "__main__.main.ImplicitArgs",
"members": {},
"size": 0,
"type": "struct"
},
"__main__.main.Return": {
"cairo_type": "()",
"type": "type_definition"
},
"__main__.main.SIZEOF_LOCALS": {
"type": "const",
"value": 0
},
"__main__.main.result": {
"cairo_type": "felt",
"full_name": "__main__.main.result",
"references": [
{
"ap_tracking_data": {
"group": 3,
"offset": 0
},
"pc": 14,
"value": "[cast(ap + (-1), felt*)]"
}
],
"type": "reference"
}
},
"main_scope": "__main__",
"prime": "0x800000000000011000000000000000000000000000000000000000000000001",
"reference_manager": {
"references": [
{
"ap_tracking_data": {
"group": 3,
"offset": 0
},
"pc": 14,
"value": "[cast(ap + (-1), felt*)]"
},
{
"ap_tracking_data": {
"group": 4,
"offset": 0
},
"pc": 17,
"value": "[cast(fp + (-5), felt*)]"
},
{
"ap_tracking_data": {
"group": 4,
"offset": 0
},
"pc": 17,
"value": "[cast(fp + (-4), felt*)]"
},
{
"ap_tracking_data": {
"group": 4,
"offset": 0
},
"pc": 17,
"value": "[cast(fp + (-3), felt*)]"
},
{
"ap_tracking_data": {
"group": 4,
"offset": 1
},
"pc": 20,
"value": "[cast(ap + (-1), felt*)]"
},
{
"ap_tracking_data": {
"group": 4,
"offset": 1
},
"pc": 23,
"value": "[cast(ap + (-1), felt*)]"
}
]
}
}
1 change: 1 addition & 0 deletions crates/exex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ reth-testing-utils = { workspace = true }
proptest = { workspace = true }
arbitrary = { workspace = true }
rand = { workspace = true }
mockito = { workspace = true }
2 changes: 1 addition & 1 deletion crates/exex/src/atlantic/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ pub struct SharpQueryDetails {
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct QueryResponse {
pub sharp_query_id: String,
pub atlantic_query_id: String,
}
Loading

0 comments on commit 1f430e4

Please sign in to comment.