Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import changes from deprecated contracts repo #476

Closed
wants to merge 7 commits into from
Closed

Conversation

maurelian
Copy link
Contributor

Description

This PR is brings in the remaining changes that were left behind in the contracts repo, with a clean commit history.

Additional context

This branch includes changes which were not made by @smartcontracts and @ben-chain. They should do a sanity check on their code.

@changeset-bot
Copy link

changeset-bot bot commented Apr 15, 2021

🦋 Changeset detected

Latest commit: 93f81c3

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

This PR includes changesets to release 5 packages
Name Type
@eth-optimism/contracts Minor
@eth-optimism/batch-submitter Patch
@eth-optimism/data-transport-layer Patch
@eth-optimism/message-relayer 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

@maurelian maurelian changed the title Import changes from deprecated contrats repo Import changes from deprecated contracts repo Apr 15, 2021
* @param _creationCode Code to pass into CREATE for deployment.
* @param _address OVM address being deployed to.
*/
function safeCREATE(
uint _gasLimit,
uint, // _gasLimit
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmmm, I think this was me, but I think Kelvin would want to remove this param internally to be more consistent with the EVM, so cc @smartcontracts

@tynes
Copy link
Contributor

tynes commented Apr 16, 2021

Some modifications to geth are required for the integration tests to pass

@maurelian
Copy link
Contributor Author

Some modifications to geth are required for the integration tests to pass

Right, this change was in ethereum-optimism/contracts#300, which was abandoned, but my understanding is that the changes are still desired.

If necessary I can separate out the changes into multiple PRs.

Copy link
Collaborator

@ben-chain ben-chain left a comment

Choose a reason for hiding this comment

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

Thanks for porting these changes over! 😄

Right, this change was in ethereum-optimism/contracts#300, which was abandoned, but my understanding is that the changes are still desired.

The RLP changes are definitely desired, but I think we should have those in a separate PR so that reviewers can look at the contract changes and geth changes together. I also looked through the state manager in geth and luckily it looks like the nonce type change here won't require any geth work. Can you make this PR be for everything except the RLP changes? I don't think those even need to be a PR until @smartcontracts has done some more work there; I think we're gonna modify the contract account be an L2-compiled contract now anyway.

@maurelian
Copy link
Contributor Author

OK, fingers crossed just reverting the commit does it. I did a quick scan of the revert diff, and it looks OK to me.

* @param _in RLP uint64 value.
* @return Decoded uint64.
*/
function readUint64(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used anywhere?

@@ -744,6 +744,24 @@ const test_ovmCREATE: TestDefinition = {
},
],
},
{
name: 'ovmCREATE(UNSAFE_CODE)',
steps: [
Copy link
Contributor

Choose a reason for hiding this comment

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

This was already the case right? This test does not seem to be accompanied by any extra code in the safety checker.

decodedTx.data
);
if (decodedTx.value > 0) {
Lib_SafeExecutionManagerWrapper.safeREQUIRE(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed? Was it the case before, was it a bug?

Also, it seems like integration tests are failing, did you run them locally?

@maurelian
Copy link
Contributor Author

maurelian commented Apr 19, 2021

I had hoped to import a few different changes from the old repo, in such a way that would preserve the commit history.
I now realize that this creates a confusing and overloaded diff. I will close this one, and open separate PRs for each of the following:

  • Reduce nonce size to uint64
  • Ban ovmCALLER opcode when it would return ZERO
  • incrementNonce instead of setNonce

@maurelian maurelian closed this Apr 19, 2021
@gakonst gakonst deleted the import branch April 20, 2021 08:49
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.

5 participants