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

[BUG] Sequence-sender sends next sequence immediately after restart, ignoring LastBatchVirtualizationTimeMaxWaitPeriod configuration #247

Open
akshat-zeeve opened this issue Dec 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@akshat-zeeve
Copy link

akshat-zeeve commented Dec 20, 2024

Bug Report

Sequence-sender sends next sequence immediately after restart, ignoring LastBatchVirtualizationTimeMaxWaitPeriod configuration.

Description

We found a bug in the sequence-sender of the cdk-node service. The issue is with the timing of when the next sequences are sent. The configuration is set to send sequences every 3 hours, but when we restart the cdk-node, it sends the next sequence right away instead of waiting for the 3-hour period.

To Reproduce

Steps to reproduce the behavior:

  1. Wait for a batch to be created and then restart sequence-sender

Actual behavior

Upon restarting the cdk-node, next sequences are sent immediately, bypassing the configured 3-hour interval.

Expected behavior

Sequences should wait for the configured time period (3 hours) before being sent, even after restarting the cdk-node.

Configuration

[SequenceSender]
MaxPendingTx = 5
SequencesTxFileName = "/tmp/sequencesender.json"
LastBatchVirtualizationTimeMaxWaitPeriod = "3h"
        [SequenceSender.EthTxManager]
                StoragePath = "/tmp/sequencesender-ethtxmanager.sqlite"
@akshat-zeeve akshat-zeeve added the bug Something isn't working label Dec 20, 2024
@akshat-zeeve akshat-zeeve changed the title [BUG] Sequence-sender sends sequences immediately after restart, ignoring LastBatchVirtualizationTimeMaxWaitPeriod configuration [BUG] Sequence-sender sends next sequence immediately after restart, ignoring LastBatchVirtualizationTimeMaxWaitPeriod configuration Dec 20, 2024
@ToniRamirezM
Copy link
Contributor

On startup, the variable latestVirtualTime is not initialized, which causes the condition to send data to L1 to be erroneously met during its first check.

To resolve this issue, the variable should be set to the timestamp of the latest virtualized sequence. Achieving this requires syncing the virtualization events. While the l1-sync-lib on the aggregator already syncs this information, its database is not accessible from the sequence sender. Moreover, replicating all that data solely for this purpose seems excessive.

As an alternative, we can retrieve the latest virtualization event directly from L1 by querying a reasonable range of L1 blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants