Skip to content

Conversation

@benesjan
Copy link
Contributor

@benesjan benesjan commented Dec 15, 2025

Fixes #17775

In this PR I implement a new log sync algorithm we've come up with in Buenos Aires that should be fully robust against any kind of private log losses. The algorithm is explained in the body of loadPrivateLogsForSenderRecipientPair function. That function should be the entrypoint when reviewing this PR (if checking the utility functions first you would not have enough context).

Unfortunately this PR introduces a performance regression that is tracked by this issue. I am fairly certain that the regression is caused by an unreasonable number of requests performed by the loadLogsForRange function - that will be tackled in a followup PR.

In this PR the algorithm is not yet integrated into the system. That is done in a PR up the stack.

The directory structure is not yet final - I wanted to keep this PR contained in one place to not have conflicts with Martin's PR. So please ignore that for now (will move stuff around in a final pass).

My plan is as follows:

  1. Merge this PR,
  2. fix the regression by modifying the getLogsByTag API such that it gives me all the info I need (now it doesn't give me block timestamp),
  3. once that PR is merged most likely wait for Martin's refactor to be merged and then rebase and polish my integrating new log sync PR,
  4. move some files around to make it all cuter.

Update on regression of time in e2e tests

Unfortunately realized that this has caused a regression and log sync is now significantly slower.

Did 2 runs of the e2e_l1_with_wall_time test and on next the results are 337 and 334 seconds but with the new code it's 661 and 658 seconds.

Will work on dropping that down before merging that "integrating new log sync" PR.

@benesjan benesjan force-pushed the 10-09-feat_more_robust_unconstrained_tagging branch from 11a7226 to bcf2da9 Compare December 15, 2025 17:09
@benesjan benesjan force-pushed the 12-15-refactor_more_robust_tagging_index_sync_as_recipient branch 2 times, most recently from 4097236 to 46b912e Compare December 15, 2025 17:11
@benesjan benesjan force-pushed the 10-09-feat_more_robust_unconstrained_tagging branch 2 times, most recently from a78d1a8 to bb588b3 Compare December 15, 2025 19:08
@benesjan benesjan force-pushed the 12-15-refactor_more_robust_tagging_index_sync_as_recipient branch from b03272a to 6d590c5 Compare December 15, 2025 19:08
@benesjan benesjan changed the base branch from 10-09-feat_more_robust_unconstrained_tagging to graphite-base/19030 December 15, 2025 19:42
@benesjan benesjan force-pushed the 12-15-refactor_more_robust_tagging_index_sync_as_recipient branch from 6d590c5 to bfd7013 Compare December 16, 2025 19:10
@benesjan benesjan changed the base branch from graphite-base/19030 to 10-09-feat_more_robust_unconstrained_tagging December 16, 2025 19:10
@AztecBot AztecBot force-pushed the 10-09-feat_more_robust_unconstrained_tagging branch from e52830e to eb5f940 Compare December 16, 2025 21:07
Base automatically changed from 10-09-feat_more_robust_unconstrained_tagging to next December 16, 2025 21:55
@benesjan benesjan force-pushed the 12-15-refactor_more_robust_tagging_index_sync_as_recipient branch 5 times, most recently from 71a3b8a to d8fc670 Compare December 18, 2025 16:37
@benesjan benesjan force-pushed the 12-15-refactor_more_robust_tagging_index_sync_as_recipient branch 5 times, most recently from 370568a to 1b335df Compare December 19, 2025 14:18
@benesjan benesjan marked this pull request as ready for review December 19, 2025 15:17
Copy link
Contributor

@mverzilli mverzilli left a comment

Choose a reason for hiding this comment

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

Looks awesome, just want to sync particularly regarding data storage

@benesjan benesjan marked this pull request as draft December 22, 2025 15:12
@benesjan benesjan marked this pull request as ready for review December 22, 2025 15:39
@benesjan benesjan requested a review from mverzilli December 22, 2025 15:40
@benesjan benesjan enabled auto-merge December 22, 2025 15:44
Copy link
Contributor

@mverzilli mverzilli left a comment

Choose a reason for hiding this comment

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

🚀

Fixes #17775

In this PR I implement a new log sync algorithm we've come up with in Buenos Aires that should be fully robust against any kind of private log losses. The algorithm is explained in the body of `loadPrivateLogsForSenderRecipientPair` function. That function should be the entrypoint when reviewing this PR (if checking the utility functions first you would not have enough context).

Unfortunately this PR introduces a performance regression that is tracked by [this issue](https://linear.app/aztec-labs/issue/F-229/improve-log-sync-performance). I am fairly certain that the regression is caused by an unreasonable number of requests performed by the `loadLogsForRange` function - that will be tackled in a followup PR.

In this PR the algorithm is not yet integrated into the system. That is done in a [PR up the stack](#19125).

The directory structure is not yet final - I wanted to keep this PR contained in one place to not have conflicts with Martin's PR. So please ignore that for now (will move stuff around in a final pass).

My plan is as follows:
1. Merge this PR,
2. fix the regression by modifying the `getLogsByTag` API such that it gives me all the info I need (now it doesn't give me block timestamp),
3. once that PR is merged most likely wait for Martin's refactor to be merged and then rebase and polish my integrating new log sync PR,
4. move some files around to make it all cuter.

## Update on regression of time in e2e tests
Unfortunately realized that this has caused a regression and log sync is now significantly slower.

Did 2 runs of the `e2e_l1_with_wall_time` test and on `next` the results are 337 and 334 seconds but with the new code it's 661 and 658 seconds.

Will work on dropping that down before merging that "integrating new log sync" PR.
@AztecBot AztecBot force-pushed the 12-15-refactor_more_robust_tagging_index_sync_as_recipient branch from 6ac2b16 to 262640c Compare December 22, 2025 16:38
@benesjan benesjan added this pull request to the merge queue Dec 22, 2025
@AztecBot
Copy link
Collaborator

Flakey Tests

🤖 says: This CI run detected 2 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (\0338;;http://ci.aztec-labs.com/7caf89186c564e8a�7caf89186c564e8a8;;�\033):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_p2p/multiple_validators_sentinel.parallel.test.ts "collects attestations for validators in proposer node when block is not published" (116s) (code: 1) group:e2e-p2p-epoch-flakes (\033Jan Beneš\033: refactor: more robust tagging index sync as recipient (#19030))
\033FLAKED\033 (\0338;;http://ci.aztec-labs.com/6a8e75fe88b20a26�6a8e75fe88b20a268;;�\033):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_epochs/epochs_multi_proof.test.ts (255s) (code: 1) group:e2e-p2p-epoch-flakes (\033Jan Beneš\033: refactor: more robust tagging index sync as recipient (#19030))

Merged via the queue into next with commit 9ab0032 Dec 22, 2025
17 checks passed
@benesjan benesjan deleted the 12-15-refactor_more_robust_tagging_index_sync_as_recipient branch December 22, 2025 17:12
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.

Implement robust recipient log sync algorithm

4 participants