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

Add more logging information to monotonicity violation logs #1066

Merged
merged 2 commits into from
Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/weak-terms-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/batch-submitter': patch
---

Log additional data in monotonicity violation
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,17 @@ export class TransactionBatchSubmitter extends BatchSubmitter {
// Verify all of the batch elements are monotonic
let lastTimestamp: number
let lastBlockNumber: number
for (const ele of batch) {
for (const [idx, ele] of batch.entries()) {
if (ele.timestamp < lastTimestamp) {
this.logger.error('Timestamp monotonicity violated! Element', { ele })
this.logger.error('Timestamp monotonicity violated! Element', {
idx,
ele,
})
return false
}
if (ele.blockNumber < lastBlockNumber) {
this.logger.error('Block Number monotonicity violated! Element', {
idx,
ele,
})
return false
Expand Down