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

Make use of features from solc 0.8.23 release #467

Closed
wants to merge 1 commit into from

Conversation

richardgreg
Copy link
Contributor

πŸ—’οΈ Description

Most specifically the following feature:
Commandline Interface: An empty --yul-optimizations sequence can now be always provided.

πŸ”— Related Issues

Fixes: #395

βœ… Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: All converted JSON/YML tests from ethereum/tests have been added to converted-ethereum-tests.txt.
  • Tests: Included the type and version of evm t8n tool used to locally execute test cases: e.g., ref with commit hash or geth 1.13.1-stable-3f40e65.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

Most specifically the following feature:

Commandline Interface: An empty --yul-optimizations sequence can now be always
provided.

Fixes: ethereum#395
Copy link
Member

@marioevz marioevz 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 this, but I could not make it work, even after applying the suggested change, solc is constantly hitting an assertion, and simply refuses to compile.

Are you getting this same exception with 0.8.23+ ?

@@ -80,6 +80,14 @@ def __bytes__(self) -> bytes:
)
else:
solc_args = (self.binary, *DEFAULT_SOLC_ARGS)

solc_version = self.version()
if solc_version >= Version("0.8.23"):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if solc_version >= Version("0.8.23"):
if solc_version >= Version.parse("0.8.23"):

@richardgreg
Copy link
Contributor Author

Thanks for this, but I could not make it work, even after applying the suggested change, solc is constantly hitting an assertion, and simply refuses to compile.

Are you getting this same exception with 0.8.23+ ?

Same πŸ˜…

@danceratopz and I discussed the issue earlier and hoped he'd offer a perspective that led to a solution. If an empty --yul-optimization doesn't work then feel free to close the PR πŸ™‚

@danceratopz
Copy link
Member

Thanks for this, but I could not make it work, even after applying the suggested change, solc is constantly hitting an assertion, and simply refuses to compile.
Are you getting this same exception with 0.8.23+ ?

Same πŸ˜…

@danceratopz and I discussed the issue earlier and hoped he'd offer a perspective that led to a solution. If an empty --yul-optimization doesn't work then feel free to close the PR πŸ™‚

Looking at the help output (below), it looks like the --yul-optimizations option is only relevant (resp. applicable) if --optimize is enabled, which it isn't in our case. So it doesn't look like this option helps us in any way.

Nonetheless, thanks for taking the time to try it out @richardgreg!

The unhandled exception looks to be a minor bug in solc's command-line argument parsing: ethereum/solidity#14946

Optimizer Options:
  --optimize           Enable optimizer.
  --optimize-runs n (=200)
                       The number of runs specifies roughly how often each 
                       opcode of the deployed code will be executed across the 
                       lifetime of the contract. Lower values will optimize 
                       more for initial deployment cost, higher values will 
                       optimize more for high-frequency usage.
  --optimize-yul       Enable Yul optimizer (independently of the EVM assembly 
                       optimizer). The general --optimize option automatically 
                       enables this unless --no-optimize-yul is specified.
  --no-optimize-yul    Disable Yul optimizer (independently of the EVM assembly
                       optimizer).
  --yul-optimizations steps
                       Forces Yul optimizer to use the specified sequence of 
                       optimization steps instead of the built-in one.

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.

Make use of features from solc 0.8.23 release
3 participants