Skip to content

refactor(Notes): Make set.get_notes fail if it returns no notes #4988

@nventuro

Description

@nventuro

We currently have a limits value so that we don't return (and delete!) more than a certain number of notes - this is typically used in conjunction with sorting to e.g. get the largest value note, etc. However, there are no constraints on the minimum number of notes.

The minimum number is not typically a very interesting value (why would an application care that it gets at least 5 notes?), except for one scenario: making sure we retrieved at least a single one. I argue that we always want to enforce this, since get_notes returning no notes is meaninless: no assertions are performed (since there are no values to return), and note non-existance is not proven (since a malicious PXE could simply choose to not return the notes). Therefore, a call to get_notes that results in no notes being returned is always 'wrong'.

Metadata

Metadata

Assignees

Labels

C-aztec.nrComponent: Aztec smart contract framework

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions