Skip to content

getL2Output reverts if not found#2979

Merged
mergify[bot] merged 2 commits intodevelopfrom
m/revert-on-get-zerol2output
Jul 17, 2022
Merged

getL2Output reverts if not found#2979
mergify[bot] merged 2 commits intodevelopfrom
m/revert-on-get-zerol2output

Conversation

@maurelian
Copy link
Contributor

@maurelian maurelian commented Jul 11, 2022

Description

Calls to oracle.getL2Output revert if no output is found for the given block number.

Pros:

Reverting on blocks which are not found forces 3rd parties to consider and handle this failure mode, instead of possibly missing this 'edge case'. This feels more semantically correct, and is similar to how many of ERC721's functions handle non-existent token IDs (ex. getApproved).

Cons:

This change forces us to introduce some pretty ugly try/catch code in isOutputFinalized().

Metadata

  • Fixes #ENG-2279

@changeset-bot
Copy link

changeset-bot bot commented Jul 11, 2022

🦋 Changeset detected

Latest commit: ad77328

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/contracts-bedrock 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 added 2-reviewers A-pkg-contracts-bedrock Area: packages/contracts-bedrock labels Jul 11, 2022
@mergify
Copy link
Contributor

mergify bot commented Jul 11, 2022

Hey @maurelian! This PR has merge conflicts. Please fix them before continuing review.

@mergify mergify bot added the conflict label Jul 11, 2022
@maurelian maurelian force-pushed the m/revert-on-get-zerol2output branch 3 times, most recently from c64b175 to 5a7873b Compare July 12, 2022 00:45
@mergify mergify bot removed the conflict label Jul 12, 2022
@maurelian
Copy link
Contributor Author

maurelian commented Jul 12, 2022

@smartcontracts: I discussed this change with @tynes. Would appreciate your input before I spend time debuggin the go tests.

@maurelian maurelian force-pushed the m/revert-on-get-zerol2output branch from 5a7873b to 90478ca Compare July 12, 2022 14:18
@mergify
Copy link
Contributor

mergify bot commented Jul 12, 2022

Hey @maurelian! This PR has merge conflicts. Please fix them before continuing review.

@mergify mergify bot added the conflict label Jul 12, 2022
@maurelian maurelian force-pushed the m/revert-on-get-zerol2output branch from 90478ca to dc46973 Compare July 13, 2022 19:58
@mergify mergify bot removed the conflict label Jul 13, 2022
@maurelian maurelian force-pushed the m/revert-on-get-zerol2output branch from dc46973 to a57ead4 Compare July 13, 2022 20:06
@mergify
Copy link
Contributor

mergify bot commented Jul 13, 2022

Hey @maurelian! This PR has merge conflicts. Please fix them before continuing review.

@mergify mergify bot added the conflict label Jul 13, 2022
@maurelian maurelian force-pushed the m/revert-on-get-zerol2output branch from a57ead4 to 235dba7 Compare July 14, 2022 19:57
@mergify mergify bot removed the conflict label Jul 14, 2022
@maurelian
Copy link
Contributor Author

@mergify refresh

@mergify
Copy link
Contributor

mergify bot commented Jul 14, 2022

refresh

✅ Pull request refreshed

@mergify
Copy link
Contributor

mergify bot commented Jul 14, 2022

Hey @maurelian! This PR has merge conflicts. Please fix them before continuing review.

@mergify mergify bot added the conflict label Jul 14, 2022
@maurelian maurelian force-pushed the m/revert-on-get-zerol2output branch from 9fdcbe9 to 4d4e89d Compare July 14, 2022 23:13
@mergify mergify bot removed the conflict label Jul 14, 2022
@maurelian maurelian requested a review from smartcontracts July 14, 2022 23:22
@mergify
Copy link
Contributor

mergify bot commented Jul 15, 2022

Hey @maurelian! This PR has merge conflicts. Please fix them before continuing review.

@mergify mergify bot added the conflict label Jul 15, 2022
@maurelian maurelian force-pushed the m/revert-on-get-zerol2output branch 2 times, most recently from 82017d8 to cbfb4e8 Compare July 15, 2022 16:23
@mergify mergify bot removed the conflict label Jul 15, 2022
@maurelian
Copy link
Contributor Author

@mergify refresh

@mergify
Copy link
Contributor

mergify bot commented Jul 15, 2022

refresh

✅ Pull request refreshed

@maurelian maurelian force-pushed the m/revert-on-get-zerol2output branch from cbfb4e8 to efb96fd Compare July 15, 2022 17:07
@maurelian
Copy link
Contributor Author

@mergify refresh

@mergify
Copy link
Contributor

mergify bot commented Jul 15, 2022

refresh

✅ Pull request refreshed

feat(bedrock): Handle error on empty output in Portal

feat(ctb): use isOutputFinalized in finalizeWithdrawalTx
Revert "feat(ctb): use isOutputFinalized in finalizeWithdrawalTx"

This reverts commit 4d4e89d.

ctb: getL2Output returns the next output for a block

ctb: Fix error message style
@maurelian maurelian force-pushed the m/revert-on-get-zerol2output branch from a6e9bf4 to ad77328 Compare July 17, 2022 18:18
@mergify
Copy link
Contributor

mergify bot commented Jul 17, 2022

This PR has been added to the merge queue, and will be merged soon.

@mergify mergify bot merged commit 7e6eb9b into develop Jul 17, 2022
@mergify mergify bot deleted the m/revert-on-get-zerol2output branch July 17, 2022 18:45
@mergify
Copy link
Contributor

mergify bot commented Jul 17, 2022

This PR is next in line to be merged, and will be merged as soon as checks pass.

@mergify mergify bot removed the on-merge-train label Jul 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-pkg-contracts-bedrock Area: packages/contracts-bedrock

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants