Skip to content

fix(discovery-core): handle open notes properly - #588

Merged
m-kus merged 1 commit into
mainfrom
02-27-fix_discovery-core_handle_open_notes_properly
Mar 2, 2026
Merged

m-kus merged 1 commit into
mainfrom
02-27-fix_discovery-core_handle_open_notes_properly

Conversation

@m-kus

@m-kus m-kus commented Feb 27, 2026 •

Copy link
Copy Markdown

TL;DR

Added support for open notes by introducing an is_open field to DecryptedNote and implementing plaintext amount handling for notes with salt value 1.

What changed?

  • Added is_open boolean field to the DecryptedNote struct to indicate whether a note stores its amount in plaintext
  • Imported OPEN_NOTE_SALT constant and modified decrypt_note() function to check if salt equals 1 (open note)
  • For open notes (salt == 1), the function now returns the plaintext amount directly instead of attempting ECDH-based decryption
  • Added comprehensive test coverage for both open note and encrypted note scenarios
  • Defined OPEN_NOTE_SALT constant with value 1 in the decryption module
  • Removed the TODO comment about handling open notes since this functionality is now implemented

This change is Reviewable

m-kus commented Feb 27, 2026 •

Copy link
Copy Markdown
Author

@m-kus
m-kus force-pushed the 02-27-fix_discovery-core_handle_open_notes_properly branch 2 times, most recently from 9c1140e to 4cb895b Compare March 1, 2026 17:28
@m-kus
m-kus force-pushed the 02-26-chore_discovery-service_adjust_default_config branch 2 times, most recently from 5030cc7 to 60694d6 Compare March 2, 2026 09:47
@m-kus
m-kus force-pushed the 02-27-fix_discovery-core_handle_open_notes_properly branch from 4cb895b to c4d9a31 Compare March 2, 2026 09:47

@Yoni-Starkware Yoni-Starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

:lgtm:

@Yoni-Starkware reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on m-kus).

@m-kus
m-kus force-pushed the 02-26-chore_discovery-service_adjust_default_config branch from 60694d6 to b44d88c Compare March 2, 2026 15:38
@m-kus
m-kus force-pushed the 02-27-fix_discovery-core_handle_open_notes_properly branch from c4d9a31 to 2f09c38 Compare March 2, 2026 15:38
@m-kus
m-kus marked this pull request as ready for review March 2, 2026 15:41
@m-kus
m-kus changed the base branch from 02-26-chore_discovery-service_adjust_default_config to graphite-base/588 March 2, 2026 15:52
@m-kus
m-kus force-pushed the graphite-base/588 branch from b44d88c to fb7a5a6 Compare March 2, 2026 16:02
@m-kus
m-kus force-pushed the 02-27-fix_discovery-core_handle_open_notes_properly branch from 2f09c38 to 6c5baec Compare March 2, 2026 16:02
@m-kus
m-kus changed the base branch from graphite-base/588 to main March 2, 2026 16:02
@m-kus
m-kus force-pushed the 02-27-fix_discovery-core_handle_open_notes_properly branch from 6c5baec to eaedc3b Compare March 2, 2026 16:07
@m-kus
m-kus merged commit d4cf5c6 into main Mar 2, 2026
9 checks passed
@m-kus
m-kus deleted the 02-27-fix_discovery-core_handle_open_notes_properly branch March 2, 2026 16:11
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.

2 participants