Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timestamp when querying zkevm_getBatchByNumer and the batch is only in trusted state #3750

Merged
merged 8 commits into from
Aug 7, 2024

Conversation

agnusmor
Copy link
Contributor

@agnusmor agnusmor commented Aug 5, 2024

What does this PR do?

When querying zkevm_getBatchByNumber endpoint and the batch requested was only in trusted state (not sequenced/virtualized) the timestamp returned in the response for the batch was wrong. The function assigned a "nil" value for the timestamp and this was intrepreted as a very high timestamp value in the json response (future timestamp).

Now the issue is fixed and in the case the batch is only in trusted state it returns the timestamp of the last L2 block in the batch.

Reviewers

Main reviewers:

@ToniRamirezM
@tclemos
@ARR552

@agnusmor agnusmor added cherry-picked Content has been cherry-picked into a higher version branch zkevm-bridge-sync-rpc labels Aug 5, 2024
@agnusmor agnusmor added this to the v0.7.3 milestone Aug 5, 2024
@agnusmor agnusmor requested a review from ARR552 August 5, 2024 20:42
@agnusmor agnusmor self-assigned this Aug 5, 2024
@cla-bot cla-bot bot added the cla-signed label Aug 5, 2024
Copy link
Contributor

@ARR552 ARR552 left a comment

Choose a reason for hiding this comment

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

LGTM

@agnusmor agnusmor merged commit a774dc9 into release/v0.7.3 Aug 7, 2024
16 checks passed
@agnusmor agnusmor deleted the fix/timestamp-get-batch branch August 7, 2024 09:45
agnusmor added a commit that referenced this pull request Aug 14, 2024
…ly in trusted state (#3750)

* fix timestamp when querying zkevm_getBatchByNumer and the batch is only in trusted state

* control timestamp to be returned for a batch in GetBatchTimestamp

* fix ErrNotFound

* fix state.ErrNotFound check

* fix comments

* fix GetRawBatchTimestamps

* fix comments

* fix GetRawBatchTimestamps return err
agnusmor added a commit that referenced this pull request Aug 14, 2024
…ly in trusted state (#3750) (#3768)

* fix timestamp when querying zkevm_getBatchByNumer and the batch is only in trusted state

* control timestamp to be returned for a batch in GetBatchTimestamp

* fix ErrNotFound

* fix state.ErrNotFound check

* fix comments

* fix GetRawBatchTimestamps

* fix comments

* fix GetRawBatchTimestamps return err
Copy link

@Booss13 Booss13 left a comment

Choose a reason for hiding this comment

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

@Booss13
Copy link

Booss13 commented Aug 18, 2024

What does this PR do?

When querying zkevm_getBatchByNumber endpoint and the batch requested was only in trusted state (not sequenced/virtualized) the timestamp returned in the response for the batch was wrong. The function assigned a "nil" value for the timestamp and this was intrepreted as a very high timestamp value in the json response (future timestamp).

Now the issue is fixed and in the case the batch is only in trusted state it returns the timestamp of the last L2 block in the batch.

Reviewers

Main reviewers:

@ToniRamirezM

@tclemos

@ARR552

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked Content has been cherry-picked into a higher version branch cla-signed zkevm-bridge-sync-rpc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants