Skip to content

fix: incorrect blocknumber in syncTaggedLogs#13152

Merged
nventuro merged 8 commits intomasterfrom
03-28-fix_incorrect_blocknumber_in_synctaggedlogs
Apr 1, 2025
Merged

fix: incorrect blocknumber in syncTaggedLogs#13152
nventuro merged 8 commits intomasterfrom
03-28-fix_incorrect_blocknumber_in_synctaggedlogs

Conversation

@benesjan
Copy link
Contributor

In syncTaggedLog we used the block number from AztecNode instead of the one up to which PXE was synced.

Copy link
Contributor Author

benesjan commented Mar 28, 2025

Base automatically changed from 03-28-feat_making_syncdataprovider_throw_before_sync to master March 28, 2025 22:23
@benesjan benesjan force-pushed the 03-28-fix_incorrect_blocknumber_in_synctaggedlogs branch 2 times, most recently from 55959ec to 17768ae Compare March 28, 2025 23:21
@benesjan benesjan marked this pull request as ready for review March 28, 2025 23:23
@benesjan benesjan requested review from Thunkar and nventuro March 29, 2025 00:26
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.

In general we'll need to be much better re. testing from now on, and given the current state of it is in general so poor we need to at least not muddle it further.

Comment on lines +78 to +81

// PXEOracleInterface.syncTaggedLogs(...) function syncs logs up to the block number up to which PXE synced. We set
// as sufficiently high sync number here to not interfere with the tests.
await setSyncedBlockNumber(100);
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems very fragile. Why do we even need to do this in the setup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we need the PXE to be synced to a block larger than the largest block in any of the logs such that we get delivered all the logs by default in the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense to define the constants. Did that in fe43da9

Copy link
Contributor

Choose a reason for hiding this comment

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

But why do it so early? We've not even created the PXE yet. And how do we know that block 3 is enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But why do it so early?

No reason. Moved it to the end of the beforeEach function as I agree it makes more sense there.

And how do we know that block 3 is enough?

See the comment above the call to setSyncedBlockNumber. That block corresponds to the block of the last emitted log (as set by generateMockLogs function).

@benesjan benesjan force-pushed the 03-28-fix_incorrect_blocknumber_in_synctaggedlogs branch from 702806c to fe43da9 Compare March 31, 2025 20:19
@benesjan benesjan requested a review from nventuro March 31, 2025 20:20
@benesjan benesjan force-pushed the 03-28-fix_incorrect_blocknumber_in_synctaggedlogs branch from fe43da9 to 9fca6ed Compare April 1, 2025 02:12
@benesjan benesjan enabled auto-merge (squash) April 1, 2025 02:12
@benesjan benesjan requested review from nventuro and removed request for Thunkar and nventuro April 1, 2025 02:43
@nventuro nventuro disabled auto-merge April 1, 2025 20:06
@nventuro nventuro added this pull request to the merge queue Apr 1, 2025
Merged via the queue into master with commit eea1fd7 Apr 1, 2025
8 checks passed
@nventuro nventuro deleted the 03-28-fix_incorrect_blocknumber_in_synctaggedlogs branch April 1, 2025 22:07
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