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

Proper handling of invalid forced batches is missing. #3770

Open
gimersettle opened this issue Aug 15, 2024 · 0 comments
Open

Proper handling of invalid forced batches is missing. #3770

gimersettle opened this issue Aug 15, 2024 · 0 comments

Comments

@gimersettle
Copy link

Rationale

The ZkEVM system does not properly handle incorrect/invalid forced transactions. The function forceBatches allows a sequencer/user to force a batch of L2 transactions. This function is allowed only for use by the admin address. However, the contract has the functionality to allow any user to send force batches if the trusted sequencer does not work as expected.

We tested this functionality by sending forced batches with an invalid transaction. This causes other valid forced batches not to process as expected. An invalid force batch can include a transaction that does not follow the Polygon's format or is invalid (e.g., not enough funds, invalid nonce, etc. ).

As you can see in the following image, the first forced batch is valid and processed correctly. After sequencing this batch, the smart contract deletes the information related to this batch in the smart contract because it is not needed anymore. However, the second batch contains an invalid transaction (i.e., incorrect nonce). The batch is never been processed as expected and remains in the queue of forced batches with their associated data. The third batch contains a valid transaction that is never processed because forced batches are processed sequentially.

Screenshot 2024-08-15 at 8 40 16 a m

As you can see in the image, I have three forced batches, but only the first one was sequenced. Notice that if the forced batch does not follow the Polygon's encoding format, the sequencer will send an error message to the logs. However, if a transaction is invalid, there is no message, and the batch is not processed.

Implementation

Is there a feature in the system that can handle this problem? Will this problem be addressed shortly? Consider implementing a mechanism to update the forced batch queue even if the sequencer does not process a batch correctly.

Thank you in advance!

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

No branches or pull requests

1 participant