Skip to content

Never revert on ovmCREATE*#10

Merged
willmeister merged 3 commits intomasterfrom
YAS-171/ContractCreationShouldNotRevert
Feb 19, 2020
Merged

Never revert on ovmCREATE*#10
willmeister merged 3 commits intomasterfrom
YAS-171/ContractCreationShouldNotRevert

Conversation

@willmeister
Copy link
Copy Markdown

Description

Makes ExecutionManager.sol always return an address from ovmCREATE and ovmCREATE2. It will be the 0 address if the create failed. This is to make it work how the EVM works currently.

Metadata

Fixes

Contributing Agreement

Copy link
Copy Markdown

@masonforest masonforest left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@karlfloersch karlfloersch left a comment

Choose a reason for hiding this comment

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

I'd approve if I didn't feel self concious for only taking approx. 7 mins to review this!

Looks good so far! I did ask one question here in the comments though that I'm curious about

mstore(returnData, 0)
return(returnData, 0x20)
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we know that this is what is returned during a failed STATIC_CALL? I personally don't so just want to make sure

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I suppose we had tests for all failures result in 0 address and that static calls to create fail, but I added some tests to make sure that static calls actually return 0 address 👍

let returnData := mload(0x40)
mstore(returnData, 0)
return(returnData, 0x20)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@willmeister willmeister merged commit 0df35d9 into master Feb 19, 2020
@willmeister willmeister deleted the YAS-171/ContractCreationShouldNotRevert branch February 19, 2020 22:41
gakonst added a commit that referenced this pull request Apr 12, 2021
Previously, the Watcher was a separate package. It's currently consumed by:
* our integration tests
* our UI
* synthetix’s tests and UI

Given core-utils is a package meant to ship Optimism related utilities
to consumers, it makes more sense to bundle the Watcher in core-utils
than have it as a separate package.

Co-authored-by: Kelvin Fichter <kelvinfichter@gmail.com>
snario pushed a commit that referenced this pull request Apr 14, 2021
InoMurko referenced this pull request in omgnetwork/optimism May 25, 2021
Previously, the Watcher was a separate package. It's currently consumed by:
* our integration tests
* our UI
* synthetix’s tests and UI

Given core-utils is a package meant to ship Optimism related utilities
to consumers, it makes more sense to bundle the Watcher in core-utils
than have it as a separate package.

Co-authored-by: Kelvin Fichter <kelvinfichter@gmail.com>
InoMurko referenced this pull request in omgnetwork/optimism May 25, 2021
refcell pushed a commit that referenced this pull request Sep 6, 2023
Provide an option for users to invalidate nonces by increasing their nonces to (higher) new values
github-merge-queue bot pushed a commit that referenced this pull request Jan 8, 2024
* blob encoding version 2

* - cosmetic cleanup
- use testify/require for testing
- improve big blob test case
- some performance improvements

* op-service: blob encoding nits (#10)

---------

Co-authored-by: Roberto Bayardo <roberto.bayardo@coinbase.com>
Co-authored-by: protolambda <proto@protolambda.com>
max-sanchez referenced this pull request in hemilabs/optimism Apr 16, 2024
88047e707 Add tbcd, a small bitcoin daemon that participates on bitcoin p2p (ethereum-optimism#50)
1146a08b5 localnet reorg fix (ethereum-optimism#76)
87f18a191 build(deps): bump github.com/docker/docker (ethereum-optimism#64)
9073baeaf localnet (#37)
1588cbf04 Add common user-specific files to gitignore (ethereum-optimism#51)
210aabe7a Update popm.go, fix typo (#40)
a5e689493 make: automate copyright headers (#31)
1c3bfc9bc Use `maps.Clone(m)` to copy returned map in `APICommands()` (#33)
1be4df2a3 Use 'errors.Is' to compare errors (#32)
3f6bc5f8e e2e: sync ElectrumX environment variables with infra (#36)
c5b0fea01 electrumx: add connection reuse and pooling (#26)
cfc1293e9 Update README.md (#29)
8896259f0 retry mine keystone on failure (#18)
a10e3bb29 Use '%w' verb in fmt.Errorf to wrap errors (fixes #13) (#27)
6cd677611 deps: update google.golang.org/protobuf to v1.33.0 (#28)
ed7eb8e97 ci: fix concurrency cancel-in-progress for pull requests (#16)
ac3b7eacb docker: update golang image to v1.22.1 (#25)
d6b0ac8af returning response errors if they exist from bfg -> popm (#24)
d450b787a Network test start height + no panic (#22)
b390805c5 allowing BTC Block and L2 Keystone generation rates to be configurable in local network (#19)
bfd3b1dc0 make: add -local flag to goimports (#9)
e0e8964fc Move internal error into protocol package (#10)
7875a897c l2 keystone mining fixes (#3)

git-subtree-dir: heminetwork
git-subtree-split: 88047e707e2db8522e2ad77c5f849e55bc94cd10
ClaytonNorthey92 referenced this pull request in hemilabs/optimism Apr 17, 2024
88047e707 Add tbcd, a small bitcoin daemon that participates on bitcoin p2p (ethereum-optimism#50)
1146a08b5 localnet reorg fix (ethereum-optimism#76)
87f18a191 build(deps): bump github.com/docker/docker (ethereum-optimism#64)
9073baeaf localnet (#37)
1588cbf04 Add common user-specific files to gitignore (ethereum-optimism#51)
210aabe7a Update popm.go, fix typo (#40)
a5e689493 make: automate copyright headers (#31)
1c3bfc9bc Use `maps.Clone(m)` to copy returned map in `APICommands()` (#33)
1be4df2a3 Use 'errors.Is' to compare errors (#32)
3f6bc5f8e e2e: sync ElectrumX environment variables with infra (#36)
c5b0fea01 electrumx: add connection reuse and pooling (#26)
cfc1293e9 Update README.md (#29)
8896259f0 retry mine keystone on failure (#18)
a10e3bb29 Use '%w' verb in fmt.Errorf to wrap errors (fixes #13) (#27)
6cd677611 deps: update google.golang.org/protobuf to v1.33.0 (#28)
ed7eb8e97 ci: fix concurrency cancel-in-progress for pull requests (#16)
ac3b7eacb docker: update golang image to v1.22.1 (#25)
d6b0ac8af returning response errors if they exist from bfg -> popm (#24)
d450b787a Network test start height + no panic (#22)
b390805c5 allowing BTC Block and L2 Keystone generation rates to be configurable in local network (#19)
bfd3b1dc0 make: add -local flag to goimports (#9)
e0e8964fc Move internal error into protocol package (#10)
7875a897c l2 keystone mining fixes (#3)

git-subtree-dir: heminetwork
git-subtree-split: 88047e707e2db8522e2ad77c5f849e55bc94cd10
bap2pecs referenced this pull request in babylonlabs-io/optimism Jul 31, 2024
OptimismBot pushed a commit that referenced this pull request Aug 18, 2025
cannon: Ensure FP tests are runnable in CI
cuiweixie pushed a commit to cuiweixie/optimism that referenced this pull request Oct 22, 2025
…eum-optimism#10)

* feat(scripts): support rootless docker in 3-op-init.sh

* feat(scripts): rename scripts for consistency

* fix(scripts): fix rootless docker command

* refactor(scrits): rename script name for consistency
falcorocks added a commit that referenced this pull request Dec 4, 2025
Switch from docker-bake.yaml to the new unified docker.yaml workflow
with mode: bake to test the merged workflow from factory PR #10.
theochap pushed a commit that referenced this pull request Dec 10, 2025
Zena-park added a commit to tokamak-network/optimism that referenced this pull request Dec 30, 2025
Zena-park added a commit to tokamak-network/optimism that referenced this pull request Dec 30, 2025
There are two fixes in this commit:
1. add: reentrancy modifier to updateSeigniorage function
2. fix: Fixed bug when settling to layer2 sequencer in updateSeigniorage function
theochap pushed a commit that referenced this pull request Jan 14, 2026
smartcontracts added a commit that referenced this pull request Feb 22, 2026
Add onlyDelegateCall enforcement to upgradeSuperchain, upgrade, and
migrate functions (#17). Include msg.sender in deploy salt to prevent
cross-caller CREATE2 collisions (#17). Add duplicate instruction key
detection in upgrade validation (#9). Validate startingRespectedGameType
against enabled game configs (#10). Add code-existence check in
loadBytes (#18). Add tests covering all audit fix behaviors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
smartcontracts added a commit that referenced this pull request Feb 22, 2026
Add onlyDelegateCall enforcement to upgradeSuperchain, upgrade, and
migrate functions (#17). Include msg.sender in deploy salt to prevent
cross-caller CREATE2 collisions (#17). Add duplicate instruction key
detection in upgrade validation (#9). Validate startingRespectedGameType
against enabled game configs (#10). Add code-existence check in
loadBytes (#18). Add setUp guard to VerifyOPCM.runSingle (#4). Remove
unused _findChar function (#5). Pass real AddressManager in migrator
proxy deploy args (#11). Add tests covering all audit fix behaviors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
smartcontracts added a commit that referenced this pull request Feb 22, 2026
Add onlyDelegateCall enforcement to upgradeSuperchain, upgrade, and
migrate functions (#17). Include msg.sender in deploy salt to prevent
cross-caller CREATE2 collisions (#17). Add duplicate instruction key
detection in upgrade validation (#9). Validate startingRespectedGameType
against enabled game configs (#10). Add code-existence check in
loadBytes (#18). Add setUp guard to VerifyOPCM.runSingle (#4). Remove
unused _findChar function (#5). Pass real AddressManager in migrator
proxy deploy args (#11). Add tests covering all audit fix behaviors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
smartcontracts added a commit that referenced this pull request Feb 22, 2026
Add onlyDelegateCall enforcement to upgradeSuperchain, upgrade, and
migrate functions (#17). Include msg.sender in deploy salt to prevent
cross-caller CREATE2 collisions (#17). Add duplicate instruction key
detection in upgrade validation (#9). Validate startingRespectedGameType
against enabled game configs (#10). Add code-existence check in
loadBytes (#18). Add setUp guard to VerifyOPCM.runSingle (#4). Remove
unused _findChar function (#5). Pass real AddressManager in migrator
proxy deploy args (#11). Add tests covering all audit fix behaviors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
smartcontracts added a commit that referenced this pull request Mar 3, 2026
Add onlyDelegateCall enforcement to upgradeSuperchain, upgrade, and
migrate functions (#17). Include msg.sender in deploy salt to prevent
cross-caller CREATE2 collisions (#17). Add duplicate instruction key
detection in upgrade validation (#9). Validate startingRespectedGameType
against enabled game configs (#10). Add code-existence check in
loadBytes (#18). Add setUp guard to VerifyOPCM.runSingle (#4). Remove
unused _findChar function (#5). Pass real AddressManager in migrator
proxy deploy args (#11). Add tests covering all audit fix behaviors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
smartcontracts added a commit that referenced this pull request Mar 5, 2026
Add onlyDelegateCall enforcement to upgradeSuperchain, upgrade, and
migrate functions (#17). Include msg.sender in deploy salt to prevent
cross-caller CREATE2 collisions (#17). Add duplicate instruction key
detection in upgrade validation (#9). Validate startingRespectedGameType
against enabled game configs (#10). Add code-existence check in
loadBytes (#18). Add setUp guard to VerifyOPCM.runSingle (#4). Remove
unused _findChar function (#5). Pass real AddressManager in migrator
proxy deploy args (#11). Add tests covering all audit fix behaviors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
github-merge-queue bot pushed a commit that referenced this pull request Mar 5, 2026
…19272)

* contracts: implement audit code fixes and add tests

Add onlyDelegateCall enforcement to upgradeSuperchain, upgrade, and
migrate functions (#17). Include msg.sender in deploy salt to prevent
cross-caller CREATE2 collisions (#17). Add duplicate instruction key
detection in upgrade validation (#9). Validate startingRespectedGameType
against enabled game configs (#10). Add code-existence check in
loadBytes (#18). Add setUp guard to VerifyOPCM.runSingle (#4). Remove
unused _findChar function (#5). Pass real AddressManager in migrator
proxy deploy args (#11). Add tests covering all audit fix behaviors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* contracts: regenerate semver-lock.json for OPContractsManagerV2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* contracts: bump OPContractsManagerV2 version to 7.0.10

Semver-diff requires a patch version bump when bytecode changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@0xChin 0xChin mentioned this pull request Mar 9, 2026
wwared pushed a commit that referenced this pull request Mar 9, 2026
…19272)

* contracts: implement audit code fixes and add tests

Add onlyDelegateCall enforcement to upgradeSuperchain, upgrade, and
migrate functions (#17). Include msg.sender in deploy salt to prevent
cross-caller CREATE2 collisions (#17). Add duplicate instruction key
detection in upgrade validation (#9). Validate startingRespectedGameType
against enabled game configs (#10). Add code-existence check in
loadBytes (#18). Add setUp guard to VerifyOPCM.runSingle (#4). Remove
unused _findChar function (#5). Pass real AddressManager in migrator
proxy deploy args (#11). Add tests covering all audit fix behaviors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* contracts: regenerate semver-lock.json for OPContractsManagerV2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* contracts: bump OPContractsManagerV2 version to 7.0.10

Semver-diff requires a patch version bump when bytecode changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
OptimismBot pushed a commit that referenced this pull request Mar 10, 2026
…edStaker

Cantina audit finding #10: when a beneficiary removes a staker from
their allowlist, the staker's lastUpdate is reset via _increasePeData,
losing accumulated staking weight. Document this as an inherent trust
assumption of the delegation model.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
github-merge-queue bot pushed a commit that referenced this pull request Mar 16, 2026
* docs(staking): document pause bypass behavior in setAllowedStaker

* fix(staking): only reset lastUpdate on full unstake in _decreasePeData

Cantina audit finding #7: _decreasePeData unconditionally reset
lastUpdate on every decrease, penalizing partial unstakers by
resetting their staking weight. Now lastUpdate is only reset when
effectiveStake reaches zero.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(staking): implement two-step ownership transfer

Cantina audit finding #8: transferOwnership now nominates a pending
owner who must call acceptOwnership() to finalize the transfer,
preventing irrevocable ownership loss from incorrect addresses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs(staking): document lastUpdate reset trust assumption in setAllowedStaker

Cantina audit finding #10: when a beneficiary removes a staker from
their allowlist, the staker's lastUpdate is reset via _increasePeData,
losing accumulated staking weight. Document this as an inherent trust
assumption of the delegation model.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: undo version change

* chore: upgrade natspec

* chore: update event emission order

* fix: wrong event args

* chore: add interface comments

* fix: pre-pr

* refactor: make ownable private functions public

* fix: pre-pr

* feat(ownable): reset pending owner on zeroaddress ownership transfer

* refactor: inherit OZ's ownable and use helper contract for mapping storage slot

* fix: ci

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

3 participants