Skip to content

l2geth: reset db metadata on error#2395

Closed
tynes wants to merge 3 commits intodevelopfrom
fix/l2geth-reset-onerr
Closed

l2geth: reset db metadata on error#2395
tynes wants to merge 3 commits intodevelopfrom
fix/l2geth-reset-onerr

Conversation

@tynes
Copy link
Contributor

@tynes tynes commented Apr 1, 2022

Description
Be sure to reset the values on error

@mergify mergify bot requested review from cfromknecht and mslipper April 1, 2022 00:48
}

// This reset function MUST be called on any error case
reset := func() {
Copy link
Contributor

@Inphi Inphi Apr 1, 2022

Choose a reason for hiding this comment

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

maybe make this a defer to be robust against added failure modes in the future:

func applyTransactionToTip(tx *types.Transaction) (err error) {
defer func() {
  if err != nil {
    reset();
  }
}()

and then it can be moved up further.

@mslipper mslipper added the C-protocol-critical Category: Modifies protocol-critical code label Apr 1, 2022
@mergify mergify bot requested a review from smartcontracts April 1, 2022 03:29
@changeset-bot
Copy link

changeset-bot bot commented Apr 2, 2022

🦋 Changeset detected

Latest commit: f4d1090

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

@github-actions github-actions bot removed the C-protocol-critical Category: Modifies protocol-critical code label Apr 2, 2022
@mslipper mslipper added the C-protocol-critical Category: Modifies protocol-critical code label Apr 3, 2022
Copy link
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

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

Changes generally LGTM, want to first confirm that we should be resetting the enqueue index before approving tho

}
}
return nil
s.SetLatestEnqueueIndex(queueIndex)
Copy link
Contributor

Choose a reason for hiding this comment

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

when the deadlock bug was fixed, there was a reason we decided to leave out resetting the enqueue index. i can't recall what the exact reason was, but wanted to bring it up so that we can revisit those assumptions

@mslipper
Copy link
Collaborator

mslipper commented Apr 4, 2022

Let's reopen this guy against the HA sequencing branch @Inphi will make after merging #2406.

@mslipper mslipper closed this Apr 4, 2022
theochap pushed a commit that referenced this pull request Dec 10, 2025
…RootAtTimestamp` (#2395)

Closes #2383 , #2384 

- Skipped testing for `supervisor_syncStatus` because that is being
tested checking the chain progress.
- Skipped `supervisor_dependencySetV1` because we need `QueryAPI` in Go
implementation to implement the end-point so that we can test it using
devstack.

#### Changes

- The serialize and deserialize implemented for `ChainID` is now generic
for `u64` because I needed it at other places as well.
- Due to the way Go unmarshalls the response, I needed to add the
response objects `SuperRootOutputRpc` and `ChainRootInfoRpc`, which are
essentially the same as `SuperRootOutput` and `ChainRootInfo` used
before. The fields `timestamp`, `version` and `chainID` needed to be
compatible with `hexutil.Uint64` and hexutil.Bytes`. Hence all the
modifications.

Tested locally, all tests including e2e tests are passing as expected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cannon Area: cannon C-protocol-critical Category: Modifies protocol-critical code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants