Skip to content

fix: minor improvements to empty sequencer block handling#1814

Merged
mslipper merged 6 commits intoethereum-optimism:developfrom
cfromknecht:deadlock-followup
Dec 2, 2021
Merged

fix: minor improvements to empty sequencer block handling#1814
mslipper merged 6 commits intoethereum-optimism:developfrom
cfromknecht:deadlock-followup

Conversation

@cfromknecht
Copy link
Contributor

@cfromknecht cfromknecht commented Nov 24, 2021

Description
This PR makes some minor improvements to the sequencers empty block detection, specifically:

  • fixes the empty block detection within commitTransactions to only count transactions if they are successfully executed
  • handles an edge case in commitTransactions where an empty block can be produced when the execution is interrupted
  • moves the low-level empty block check up in commit, to avoid sending empty blocks on w.taskCh

Note, the empty block production in this case was never accepted by the chain, but this improves our detection of these cases locally instead of relying on the catch-all check in commit.

Metadata

  • Fixes ENG-1703

@changeset-bot
Copy link

changeset-bot bot commented Nov 24, 2021

🦋 Changeset detected

Latest commit: 5febe10

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@eth-optimism/l2geth Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tynes
Copy link
Contributor

tynes commented Nov 25, 2021

To prevent broken unit tests, sometimes we hide changes behind if rconfig.UsingOVM. We could also skip the failing test or modify it

    worker_test.go:357: new task timeout

@cfromknecht cfromknecht force-pushed the deadlock-followup branch 3 times, most recently from cd86746 to 59580b2 Compare November 25, 2021 01:12
@cfromknecht cfromknecht requested review from mslipper and tynes and removed request for tynes November 25, 2021 03:09
Copy link
Contributor

@tynes tynes left a comment

Choose a reason for hiding this comment

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

Will approve when a changeset is added, then we can get this out on kovan

@cfromknecht
Copy link
Contributor Author

@tynes changeset added 👍

@cfromknecht cfromknecht requested a review from tynes December 2, 2021 20:06
When using PoW, geth begins mining on empty blocks before attempting to
select which transactions to include. This optimization is not needed,
as we require that every L2 block have exactly one transaction. This
commit disables this behavior an modifies the tests accordingly. The
test is also expanded to be stricter wrt to testing number of txs and
uncles on all blocks.
As of the prior commit, all calls to the `commit` pass a noempty value
of true, indicating that the sequencer should not start mining empty
blocks. Therefore, we can remove all usage of noempty from the worker.
With empty block mining logic totally removed in the prior commit,
worker.commit is now only called with update=true. We can now safely
remove the argument and the affected codepaths.
This commit fixes a bug in the way txCount was used for detecting and
aborting empty blocks. Previously, txCount was incremented immediately
after popping off the new transaction but before it is executed. This
was incorrect, as the transaction can still be rejected for nonce/gas
errors later on. Instead, we modify the logic only count transactions
that are successfully added, and utilize the existing w.current.tcount
member to implement the detection.
Prior to this commit, an empty block would be submitted to the taskCh
before sanity check whether or not it was empty. This assertion is moved
up to fail before submitting the task.

It seems the placement of the check before was done to get around the
StreamUncle unit test, which would allow commit to submit an empty task
before ultimately failing. Now that the test is modified to reflect the
expected behavior of the sequencer, this placement is no longer
necessary.
@mslipper mslipper merged commit d4300c8 into ethereum-optimism:develop Dec 2, 2021
@cfromknecht cfromknecht deleted the deadlock-followup branch December 2, 2021 20:59
theochap added a commit that referenced this pull request Dec 10, 2025
…g package (#1814)

## Description

This PR fixes the package versions of the go e2e test folder. This fix
ensures that the kurtosis CI job fails if the `kona-node` fails to start
inside kurtosis. This will help preventing breaking the kurtosis
deployment (at least at startup).

Merging this PR means we'll be using the version of the monorepo from my
fork `https://github.com/theochap/optimism`. This will be helpful to add
features to the `devnet-sdk` without waiting for approval inside the
`ethereum-optimism/optimism` repo. Once we stabilize the `devnet-sdk` we
can remove the pointer to the forked version of the node.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cannon Area: cannon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants