Skip to content

feat[tool]: add venom artifacts into solc_json output #4637

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

crebsy
Copy link

@crebsy crebsy commented May 12, 2025

What I did

I added the venom optimizer keys ['bb', 'bb_runtime', 'cfg', 'cfg_runtime'] into the compiled output when calling compile_json()

How I did it

Adapted the translate map and guarded it with the venom flag

How to verify it

Added tests inside test_compile_json.py

Commit message

feat: add venom optimizer keys ['bb', 'bb_runtime', 'cfg', 'cfg_runtime'] into the compiled output when calling compile_json()

Description for the changelog

  • compile_json output contains venom optimizer keys ['bb', 'bb_runtime', 'cfg', 'cfg_runtime']

Cute Animal Picture

image

Comment on lines 57 to 60
translate_map.remove("bb")
translate_map.remove("bb_runtime")
translate_map.remove("cfg")
translate_map.remove("cfg_runtime")
Copy link
Member

Choose a reason for hiding this comment

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

style, bit more compact:

Suggested change
translate_map.remove("bb")
translate_map.remove("bb_runtime")
translate_map.remove("cfg")
translate_map.remove("cfg_runtime")
venom_outputs = ("bb", "bb_runtime", "cfg", "cfg_runtime")
for s in venom_outputs:
translate_map.remove(s)

@@ -245,6 +249,10 @@ def get_output_formats(input_dict: dict) -> dict[PurePath, list[str]]:
raise JSONError(f"Invalid outputSelection - {e}")

outputs = sorted(list(outputs))
if not input_dict["settings"].get("venom") and not input_dict["settings"].get("experimentalCodegen"):
for key in ["bb", "bb_runtime", "cfg", "cfg_runtime"]:
Copy link
Member

Choose a reason for hiding this comment

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

maybe extract this list to a top level variable

@@ -401,6 +409,18 @@ def format_to_output_dict(compiler_data: dict) -> dict:
if "source_map_runtime" in data:
evm["sourceMap"] = data["source_map_runtime"]

venom_keys = ("bb", "bb_runtime", "cfg", "cfg_runtime",)
Copy link
Member

Choose a reason for hiding this comment

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

ditto -- venom_keys could be top level variable

@charles-cooper charles-cooper changed the title feat: add venom keys into the compiled output json feat[tool]: add venom artifacts into solc_json output May 19, 2025
@charles-cooper charles-cooper added this to the v0.4.2 milestone May 20, 2025
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.

2 participants