Skip to content

Fixing block hang on syncing empty blocks#266

Merged
willmeister merged 1 commit intomasterfrom
fixEmptyBlockSyncHang
Sep 19, 2020
Merged

Fixing block hang on syncing empty blocks#266
willmeister merged 1 commit intomasterfrom
fixEmptyBlockSyncHang

Conversation

@willmeister
Copy link

Description

Fixes infinite error loop on syncing an empty block by waiting for the block X blocks after it to exist.

Contributing Agreement

Copy link
Contributor

@K-Ho K-Ho left a comment

Choose a reason for hiding this comment

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

lgtm!

const deployResult = await config.signer.sendTransaction({
data: rawTx.data,
gasLimit: 9_500_000,
gasLimit: 7_500_000,
Copy link
Contributor

Choose a reason for hiding this comment

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

👍👍

Comment on lines +123 to +131
while (
(await provider.getBlockNumber()) <
blockNumber + this.confirmsUntilFinal
) {
log.debug(
`Waiting for empty block ${blockNumber} to be final. Sleeping...`
)
await sleep(15_000)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need both cases or can we just keep this one?

Copy link
Author

@willmeister willmeister Sep 19, 2020

Choose a reason for hiding this comment

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

No, don't need to. Was thinking maaaaaybe ethers does something better than just polling, so that's better than this? Happy to consolidate if you think though. Eventually we'll go with the "this block finalizes the block X blocks ago" approach vs the "I got a block, now wait a bunch of blocks for this block to be final" approach.

Copy link
Author

Choose a reason for hiding this comment

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

Going to ship for now but happy to change it post-merge if you'd like!

@willmeister willmeister merged commit 409feb5 into master Sep 19, 2020
@willmeister willmeister deleted the fixEmptyBlockSyncHang branch September 19, 2020 02:35
snario pushed a commit that referenced this pull request Apr 14, 2021
Co-authored-by: Kelvin Fichter <kelvinfichter@gmail.com>
protolambda pushed a commit to protolambda/optimism that referenced this pull request May 1, 2022
theochap pushed a commit that referenced this pull request Dec 10, 2025
* chore(derive): sources touchups

* fix: lints
Zena-park pushed a commit to tokamak-network/optimism that referenced this pull request Dec 30, 2025
theochap pushed a commit that referenced this pull request Jan 15, 2026
### Description

Removes the `TryFrom` span batch for `RawSpanBatch`, inlining the
coercion into a `to_raw_span_batch` method.

Closes #266.
theochap pushed a commit that referenced this pull request Jan 21, 2026
### Description

Removes the `TryFrom` span batch for `RawSpanBatch`, inlining the
coercion into a `to_raw_span_batch` method.

Closes #266.
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