Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Add support and tests for ejsvm allowUnlimitedContractSize #126

Merged
merged 1 commit into from
Jul 2, 2018

Conversation

mikeseese
Copy link
Contributor

@mikeseese mikeseese commented Jun 20, 2018

This PR is a clean replacement for #79. #79 got messed up with some issue with rebasing, so I recreated the effective changes in a new branch/commit. You can see #79's description below:

I'm creating a real-time Solidity debugger runtime for an Augur bounty.

To do this sanely, compiler optimization needs to be turned off for the developer to be follow a logical stepping process; otherwise it's possible for the compiler to optimize things away and cause unexpected behavior from a debugging perspective.

Unfortunately, turning off optimization can mean very large compiled contracts. EIP 170 prevents contracts with more than 0x6000 bytes (or 24KB) from being created. The rationale for EIP 170 (as I interpreted it) was really to address scaling from a global perspective, however I can see it acceptable to allow users to ignore EIP 170, specifically for debugging purposes.

This PR adds the option for ignoring EIP 170. The option will not do anything until the associated ethereumjs-vm PR (ethereumjs/ethereumjs-monorepo#282) has been merged.

At first I figured ganache-core would always want the EIP 170 ignored, but after learning more about Ganache it seems that applications will use ganache-core with a "production blockchain" mindset as well; therefore I am using the existing debug flag to indicate whether or not this flag should be ignored.

I'm open to the idea to adding an additional external option for ignoring EIP 170 if that would make more sense.

@mikeseese mikeseese requested a review from benjamincburns June 20, 2018 21:55
@mikeseese mikeseese closed this Jun 20, 2018
@mikeseese mikeseese reopened this Jun 20, 2018
Copy link
Contributor

@benjamincburns benjamincburns left a comment

Choose a reason for hiding this comment

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

Minor change requested.


// Thanks solc. At least this works!
// This removes solc's overzealous uncaughtException event handler.
process.removeAllListeners("uncaughtException");
Copy link
Contributor

Choose a reason for hiding this comment

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

These tests likely belong in vm.js

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I disagree. I don't think we should bombard a bunch of "junk" into one file. I would much rather support a folder-based structure.

For example we have vm.js and unlimited_contract_size.js. I think this would be better as vm/revert.js and vm/unlimited_contract_size.js rather than putting it all in vm.js and causing chaos for maintenance.

Copy link
Contributor Author

@mikeseese mikeseese Jul 2, 2018

Choose a reason for hiding this comment

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

From @benjamincburns on Slack:

if you want to reorganize for folder structure for tests that's fine, but they should share test setup/teardown

that's the key benefit of grouping like tests
honestly I think some test engineering is warranted in ganache-cli for setup/teardown
for now feel free to merge as-is as well and we can discuss that later
or fold it into The Refactoring

I'm going to go ahead and merge this as is; we'll discuss at a later time on how testing is structured

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants