aztec-packages
aztec-packages copied to clipboard
refactor: more robust tagging index sync as sender
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:
- Associate the tagging index with a hash of a tx in which the corresponding tax was used,
- I track the status of the given tx in the tagging data provider,
- 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),
- when choosing the next index to use when sending a private log I choose
HIGHEST_PENDING_INDEX + 1(orHIGHEST_FINALIZED_INDEX + 1if there is no pending index), - 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
TaggingDataProviderintoSenderTaggingDataProviderandRecipientTaggingDataProviderbecause the algorithms are completely disjoint and it makes the code clearer. - Moved the
syncTaggedLogsAsSenderfunction topxe/src/taggingdirectory and renamed it assyncSenderTaggingIndexes. NowPrivateExecutionOraclejust calls this function. This is a step in the direction of deprecatingPXEOracleInterfaceand it allowed me to write a reasonably clear unit tests.
Issues created in this PR
- https://github.com/AztecProtocol/aztec-packages/issues/17775
- https://github.com/AztecProtocol/aztec-packages/issues/17776
- #17611
👈 (View in Graphite) - #17568

- #17534

- #17445

- #17451

next
This stack of pull requests is managed by Graphite. Learn more about stacking.