Skip to content

perf(l2): enable solc optimizer flag for contract compilation #3502

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 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ rm-test-db: ## 🛑 Removes the DB used by the ethrex client used for testing
sudo cargo run --release --bin ethrex -- removedb --force --datadir test_ethrex

fixtures/ERC20/ERC20.bin: ## 🔨 Build the ERC20 contract for the load test
solc ./fixtures/contracts/ERC20/ERC20.sol -o $@
solc --optimize ./fixtures/contracts/ERC20/ERC20.sol -o $@

sort-genesis-files:
cd ./tooling/genesis && cargo run
Expand Down
1 change: 1 addition & 0 deletions crates/l2/sdk/src/sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ pub fn compile_contract(

// Both the contract path and the output path are relative to where the Makefile is.
if !Command::new("solc")
.arg("--optimize")
.arg(bin_flag)
.arg(
"@openzeppelin/contracts=".to_string()
Expand Down
2 changes: 1 addition & 1 deletion crates/l2/tee/contracts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ lib/openzeppelin-contracts:

solc_out/TDXVerifier.bin: src/TDXVerifier.sol lib/openzeppelin-contracts
mkdir -p solc_out
solc src/TDXVerifier.sol --bin --allow-paths lib/ -o solc_out/ --overwrite
solc --optimize src/TDXVerifier.sol --bin --allow-paths lib/ -o solc_out/ --overwrite

deploy: solc_out/TDXVerifier.bin
$(eval CONTRACT_BIN := $(shell cat solc_out/TDXVerifier.bin))
Expand Down