Skip to content

feat: simple Orderbook DEX#14464

Merged
benesjan merged 24 commits intonextfrom
05-22-feat_simple_orderbook_dex
May 28, 2025
Merged

feat: simple Orderbook DEX#14464
benesjan merged 24 commits intonextfrom
05-22-feat_simple_orderbook_dex

Conversation

@benesjan
Copy link
Copy Markdown
Contributor

@benesjan benesjan commented May 22, 2025

Implemented an orderbook DEX as we need it to demonstrate partial note completion in private flow.

Pointed this to 05-22-refactor_separating_getlogsbytags_to_public_and_private_versions branch as to avoid getting unwanted collisions of Orderbook's public logs with token's partial note completion logs.

Copy link
Copy Markdown
Contributor Author

benesjan commented May 22, 2025

@benesjan benesjan force-pushed the 05-22-feat_simple_orderbook_dex branch 2 times, most recently from 5b3fdc6 to c9c8a76 Compare May 23, 2025 07:07
@benesjan benesjan changed the base branch from master to 05-22-refactor_separating_getlogsbytags_to_public_and_private_versions May 23, 2025 07:21
@benesjan benesjan changed the base branch from 05-22-refactor_separating_getlogsbytags_to_public_and_private_versions to next May 23, 2025 07:21
@benesjan benesjan changed the base branch from next to master May 23, 2025 07:22
@benesjan benesjan force-pushed the 05-22-feat_simple_orderbook_dex branch from c9c8a76 to 5089fa3 Compare May 23, 2025 10:11
@benesjan benesjan changed the base branch from master to 05-22-refactor_separating_getlogsbytags_to_public_and_private_versions May 23, 2025 10:12
@benesjan benesjan force-pushed the 05-22-feat_simple_orderbook_dex branch from 5089fa3 to 962accd Compare May 23, 2025 10:14
@benesjan benesjan marked this pull request as ready for review May 23, 2025 10:52
@benesjan benesjan requested a review from nventuro May 23, 2025 10:53
Copy link
Copy Markdown
Contributor

@nventuro nventuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so much nicer than I thought it'd be. Are we actually doing a good job?

@benesjan benesjan marked this pull request as draft May 23, 2025 13:17
@benesjan benesjan force-pushed the 05-22-refactor_separating_getlogsbytags_to_public_and_private_versions branch from 1faf365 to 2d318b3 Compare May 23, 2025 14:49
@benesjan benesjan force-pushed the 05-22-feat_simple_orderbook_dex branch 2 times, most recently from e339b2a to 807baf1 Compare May 26, 2025 07:39
@benesjan benesjan marked this pull request as ready for review May 26, 2025 09:08
#[utility]
unconstrained fn get_order(order_id: Field) -> pub (Order, bool) {
let order = storage.orders.at(order_id).read();
let is_fulfilled = check_nullifier_exists(order_id);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have nullifier_exists function on public context but not on utility and private contexts. Shall we add it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure. The way we do this in private is with the prove_nullifier_inclusion fn, which expects a full block header. It'd not touch these too much until we use them more, or get external feedback.

Copy link
Copy Markdown
Contributor

@nventuro nventuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

such smart
much nice
wow

#[utility]
unconstrained fn get_order(order_id: Field) -> pub (Order, bool) {
let order = storage.orders.at(order_id).read();
let is_fulfilled = check_nullifier_exists(order_id);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure. The way we do this in private is with the prove_nullifier_inclusion fn, which expects a full block header. It'd not touch these too much until we use them more, or get external feedback.

@benesjan benesjan force-pushed the 05-22-refactor_separating_getlogsbytags_to_public_and_private_versions branch from aff6028 to 0e0996d Compare May 27, 2025 13:39
@benesjan benesjan force-pushed the 05-22-feat_simple_orderbook_dex branch from 0610d9f to 6c8ce5d Compare May 27, 2025 13:39
@benesjan benesjan marked this pull request as draft May 27, 2025 13:54
@benesjan benesjan force-pushed the 05-22-feat_simple_orderbook_dex branch from fca2253 to 989ed05 Compare May 27, 2025 14:27
@benesjan benesjan changed the base branch from 05-22-refactor_separating_getlogsbytags_to_public_and_private_versions to graphite-base/14464 May 27, 2025 14:29
benesjan and others added 21 commits May 28, 2025 06:48
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
…src/main.nr

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
…src/main.nr

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
…src/config.nr

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
@benesjan benesjan force-pushed the 05-22-feat_simple_orderbook_dex branch from 3b5017b to 65f6141 Compare May 28, 2025 06:51
@benesjan benesjan marked this pull request as ready for review May 28, 2025 07:00
@benesjan benesjan enabled auto-merge May 28, 2025 07:00
@benesjan benesjan added this pull request to the merge queue May 28, 2025
Merged via the queue into next with commit 8e8f4b9 May 28, 2025
8 checks passed
@benesjan benesjan deleted the 05-22-feat_simple_orderbook_dex branch May 28, 2025 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants