Skip to content

Conversation

@benesjan
Copy link
Contributor

@benesjan benesjan commented Oct 9, 2025

In this PR I implement the approach that Nico originally described in this post for sender tagging index sync (for recipient it will be done in a followup PR).

To summarize I do the following:

  1. Associate the tagging index with a hash of a tx in which the corresponding tax was used,
  2. I track the status of the given tx in the tagging data provider,
  3. tagging index status can be either PENDING, FINALIZED or DROPPED_OR_REVERTED (this status is only symbolic as when we realize a corresponding tx has been dropped or reverted we just delete the pending index),
  4. when choosing the next index to use when sending a private log I choose HIGHEST_PENDING_INDEX + 1 (or HIGHEST_FINALIZED_INDEX + 1 if there is no pending index),
  5. if the chosen index is further than WINDOW_LENGTH away from the HIGHEST_FINALIZED_INDEX an error is thrown. This should be a good guarantee of us never losing a log because we are always looking for a WINDOW_LENGTH of logs.

Notes for reviewer

  • I separated TaggingDataProvider into SenderTaggingDataProvider and RecipientTaggingDataProvider because the algorithms are completely disjoint and it makes the code clearer.
  • Moved the syncTaggedLogsAsSender function to pxe/src/tagging directory and renamed it as syncSenderTaggingIndexes. Now PrivateExecutionOracle just calls this function. This is a step in the direction of deprecating PXEOracleInterface and it allowed me to write a reasonably clear unit tests.

Issues created in this PR

@benesjan benesjan marked this pull request as ready for review October 13, 2025 14:06
@benesjan benesjan marked this pull request as draft October 14, 2025 07:56
@benesjan benesjan marked this pull request as ready for review October 14, 2025 08:54
@benesjan benesjan marked this pull request as draft October 14, 2025 10:17
@benesjan benesjan force-pushed the 10-08-refactor_renaming_indexedtaggingsecret_as_pretag branch from 73a8f6d to 778aeaa Compare October 14, 2025 10:19
@benesjan benesjan force-pushed the 10-09-feat_more_robust_unconstrained_tagging branch from 588cef2 to 39f19c1 Compare October 14, 2025 10:19
@benesjan benesjan marked this pull request as ready for review October 14, 2025 10:56
@benesjan benesjan force-pushed the 10-09-feat_more_robust_unconstrained_tagging branch from ceb0929 to d100cf8 Compare October 14, 2025 11:32
@benesjan benesjan force-pushed the 10-08-refactor_renaming_indexedtaggingsecret_as_pretag branch from 778aeaa to 0a26d3b Compare October 14, 2025 11:32
@benesjan benesjan marked this pull request as draft October 14, 2025 13:55
@benesjan benesjan force-pushed the 10-08-refactor_renaming_indexedtaggingsecret_as_pretag branch from 0a26d3b to 16795d9 Compare October 15, 2025 21:24
@benesjan benesjan force-pushed the 10-09-feat_more_robust_unconstrained_tagging branch from 977b053 to dfec582 Compare October 15, 2025 21:24
Base automatically changed from 10-08-refactor_renaming_indexedtaggingsecret_as_pretag to next October 15, 2025 22:30
@benesjan benesjan force-pushed the 10-09-feat_more_robust_unconstrained_tagging branch from dfec582 to f04c9c9 Compare October 16, 2025 10:42
@benesjan benesjan marked this pull request as ready for review October 16, 2025 10:46
@benesjan benesjan marked this pull request as draft October 16, 2025 11:06
@benesjan benesjan marked this pull request as ready for review October 16, 2025 12:00
@benesjan benesjan changed the title feat: more robust unconstrained tagging refactor: reworked tagging index sync as sender Oct 16, 2025
@benesjan benesjan changed the title refactor: reworked tagging index sync as sender refactor: more robust tagging index sync as sender Oct 16, 2025
@benesjan benesjan marked this pull request as draft October 16, 2025 12:26
@benesjan benesjan force-pushed the 10-09-feat_more_robust_unconstrained_tagging branch 2 times, most recently from bcf2da9 to 4f1a6ee Compare December 15, 2025 17:11
Copy link
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.

Left a lot of comments since this is a very large PR. In hindsight we probably should've implemented some of the logic e.g. re. to pending or to processing in separate prs, and then merged that with pxe's work. So unfortutunately there's lots of comments both big and small in the mix.

Sorry it took so long to review this. Thanks for the effort in keeping it up to date and as understandable as possible.

@benesjan benesjan marked this pull request as draft December 15, 2025 19:00
@benesjan benesjan force-pushed the 10-09-feat_more_robust_unconstrained_tagging branch 3 times, most recently from e2f9768 to a55fa6b Compare December 16, 2025 18:06
@benesjan benesjan added the ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure label Dec 16, 2025
@benesjan benesjan marked this pull request as ready for review December 16, 2025 19:06
@benesjan benesjan requested a review from nventuro December 16, 2025 19:33
Copy link
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.

The improvements are excellent, thank you very much for going through my comments and considering each of them.

In this PR I implement the approach that Nico originally described in [this post](https://forum.aztec.network/t/on-note-discovery-and-index-coordination/7165) for sender tagging index sync (for recipient it will be done in a followup PR).

To summarize I do the following:
1. Associate the tagging index with a hash of a tx in which the corresponding tax was used,
2. I track the status of the given tx in the tagging data provider,
3. tagging index status can be either PENDING, FINALIZED or DROPPED_OR_REVERTED (this status is only symbolic as when we realize a corresponding tx has been dropped or reverted we just delete the pending index),
4. when choosing the next index to use when sending a private log I choose `HIGHEST_PENDING_INDEX + 1` (or `HIGHEST_FINALIZED_INDEX + 1` if there is no pending index),
5. if the chosen index is further than WINDOW_LENGTH away from the HIGHEST_FINALIZED_INDEX an error is thrown. This should be a good guarantee of us never losing a log because we are always looking for a WINDOW_LENGTH of logs.

# Notes for reviewer
- I separated `TaggingDataProvider` into `SenderTaggingDataProvider` and `RecipientTaggingDataProvider` because the algorithms are completely disjoint and it makes the code clearer.
- Moved the `syncTaggedLogsAsSender` function to `pxe/src/tagging` directory and renamed it as `syncSenderTaggingIndexes`. Now `PrivateExecutionOracle` just calls this function. This is a step in the direction of deprecating `PXEOracleInterface` and it allowed me to write a reasonably clear unit tests.

# Issues created in this PR
- #17775
- #17776

Co-authored-by: Jan Beneš <janbenes1234@gmail.com>
@AztecBot AztecBot force-pushed the 10-09-feat_more_robust_unconstrained_tagging branch from e52830e to eb5f940 Compare December 16, 2025 21:07
@AztecBot AztecBot enabled auto-merge December 16, 2025 21:07
@AztecBot AztecBot added this pull request to the merge queue Dec 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 16, 2025
@benesjan benesjan added this pull request to the merge queue Dec 16, 2025
Merged via the queue into next with commit b98e36b Dec 16, 2025
17 checks passed
@benesjan benesjan deleted the 10-09-feat_more_robust_unconstrained_tagging branch December 16, 2025 21:55
ludamad pushed a commit that referenced this pull request Dec 19, 2025
In this PR I implement the approach that Nico originally described in
[this
post](https://forum.aztec.network/t/on-note-discovery-and-index-coordination/7165)
for sender tagging index sync (for recipient it will be done in a
followup PR).

To summarize I do the following:
1. Associate the tagging index with a hash of a tx in which the
corresponding tax was used,
2. I track the status of the given tx in the tagging data provider,
3. tagging index status can be either PENDING, FINALIZED or
DROPPED_OR_REVERTED (this status is only symbolic as when we realize a
corresponding tx has been dropped or reverted we just delete the pending
index),
4. when choosing the next index to use when sending a private log I
choose `HIGHEST_PENDING_INDEX + 1` (or `HIGHEST_FINALIZED_INDEX + 1` if
there is no pending index),
5. if the chosen index is further than WINDOW_LENGTH away from the
HIGHEST_FINALIZED_INDEX an error is thrown. This should be a good
guarantee of us never losing a log because we are always looking for a
WINDOW_LENGTH of logs.

# Notes for reviewer
- I separated `TaggingDataProvider` into `SenderTaggingDataProvider` and
`RecipientTaggingDataProvider` because the algorithms are completely
disjoint and it makes the code clearer.
- Moved the `syncTaggedLogsAsSender` function to `pxe/src/tagging`
directory and renamed it as `syncSenderTaggingIndexes`. Now
`PrivateExecutionOracle` just calls this function. This is a step in the
direction of deprecating `PXEOracleInterface` and it allowed me to write
a reasonably clear unit tests.

# Issues created in this PR
- #17775
- #17776
ludamad pushed a commit that referenced this pull request Dec 19, 2025
In this PR I implement the approach that Nico originally described in
[this
post](https://forum.aztec.network/t/on-note-discovery-and-index-coordination/7165)
for sender tagging index sync (for recipient it will be done in a
followup PR).

To summarize I do the following:
1. Associate the tagging index with a hash of a tx in which the
corresponding tax was used,
2. I track the status of the given tx in the tagging data provider,
3. tagging index status can be either PENDING, FINALIZED or
DROPPED_OR_REVERTED (this status is only symbolic as when we realize a
corresponding tx has been dropped or reverted we just delete the pending
index),
4. when choosing the next index to use when sending a private log I
choose `HIGHEST_PENDING_INDEX + 1` (or `HIGHEST_FINALIZED_INDEX + 1` if
there is no pending index),
5. if the chosen index is further than WINDOW_LENGTH away from the
HIGHEST_FINALIZED_INDEX an error is thrown. This should be a good
guarantee of us never losing a log because we are always looking for a
WINDOW_LENGTH of logs.

# Notes for reviewer
- I separated `TaggingDataProvider` into `SenderTaggingDataProvider` and
`RecipientTaggingDataProvider` because the algorithms are completely
disjoint and it makes the code clearer.
- Moved the `syncTaggedLogsAsSender` function to `pxe/src/tagging`
directory and renamed it as `syncSenderTaggingIndexes`. Now
`PrivateExecutionOracle` just calls this function. This is a step in the
direction of deprecating `PXEOracleInterface` and it allowed me to write
a reasonably clear unit tests.

# Issues created in this PR
- #17775
- #17776
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants