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

fix: fix perf bug in mox compile #159

Merged
merged 3 commits into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions moccasin/commands/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def compile_project(
with multiprocessing.Pool(n_cpus) as pool:
for contract_path in contracts_to_compile:
res = pool.apply_async(
compile_,
compile_noret,
(contract_path, build_folder),
dict(is_zksync=is_zksync, write_data=write_data),
)
Expand Down Expand Up @@ -144,7 +144,7 @@ def compile_(
compiler_args: dict | None = None,
is_zksync: bool = False,
write_data: bool = False,
) -> VyperDeployer | None:
) -> VyperDeployer | VVMDeployer:
logger.debug(f"Compiling contract {contract_path}")

# Getting the compiler Data
Expand Down Expand Up @@ -203,3 +203,8 @@ def compile_(
logger.debug(f"Done compiling {contract_name}")

return deployer

# discard the result of the compilation so that we don't need to pickle it
# between processes
def compile_noret(*args, **kwargs) -> None:
compile_(*args, **kwargs)