Skip to content

Commit

Permalink
Merge pull request #215 from ethereum-optimism/10-21-feat_worldgen_us…
Browse files Browse the repository at this point in the history
…e_submodule_for_monorepo_cloning

feat(worldgen): use submodule for monorepo cloning
  • Loading branch information
jakim929 authored Oct 21, 2024
2 parents 93a802b + b324896 commit 3acbd0a
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 81 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ go.work.sum

.DS_Store

# vendored packages
lib

/main
dist/
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "contracts/lib/optimism"]
path = contracts/lib/optimism
[submodule "lib/optimism"]
path = lib/optimism
url = https://github.com/ethereum-optimism/optimism
17 changes: 7 additions & 10 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set positional-arguments

build-contracts:
forge --version
forge build --sizes --root ./contracts
forge build --sizes --root ./

build-go:
go build ./...
Expand All @@ -11,7 +11,7 @@ lint-go:
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 5m -e "errors.As" -e "errors.Is" ./...

test-contracts:
forge test -vvv --root ./contracts
forge test -vvv --root ./

test-go:
go test ./... -v
Expand All @@ -23,13 +23,10 @@ clean-lib:
rm -rf lib

checkout-optimism-monorepo:
rm -rf lib/optimism
mkdir -p lib/optimism && \
cd lib/optimism && \
git init && \
git remote add origin https://github.com/ethereum-optimism/optimism.git && \
git fetch --depth=1 origin $(cat ../../monorepo-commit-hash) && \
git reset --hard FETCH_HEAD && \
git checkout $(cat ../../monorepo-commit-hash)

install-submodules:
git submodule update --init --recursive --progress --depth=1

calculate-artifact-url:
Expand All @@ -38,10 +35,10 @@ calculate-artifact-url:
checksum=$(bash scripts/ops/calculate-checksum.sh) && \
echo "https://storage.googleapis.com/oplabs-contract-artifacts/artifacts-v1-$checksum.tar.gz"
generate-monorepo-bindings:
generate-monorepo-bindings: checkout-optimism-monorepo install-submodules
./scripts/generate-bindings.sh -u $(just calculate-artifact-url) -n CrossL2Inbox,L2ToL2CrossDomainMessenger,L1BlockInterop,SuperchainWETH,SuperchainERC20,SuperchainTokenBridge -o ./bindings

generate-genesis: build-contracts checkout-optimism-monorepo
generate-genesis: checkout-optimism-monorepo install-submodules build-contracts
go run ./genesis/cmd/main.go --monorepo-artifacts $(just calculate-artifact-url) --periphery-artifacts ./contracts/out --outdir ./genesis/generated

generate-all: generate-genesis generate-monorepo-bindings
5 changes: 2 additions & 3 deletions bindings/crossl2inbox.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions bindings/l1blockinterop.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions bindings/l2tol2crossdomainmessenger.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions bindings/superchainerc20.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions bindings/superchaintokenbridge.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions bindings/superchainweth.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/test/L2NativeSuperchainERC20.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {Predeploys} from "@contracts-bedrock/libraries/Predeploys.sol";

import {ERC20} from "@solady/tokens/ERC20.sol";

import {L2NativeSuperchainERC20, ZeroAddress} from "src/L2NativeSuperchainERC20.sol";
import {L2NativeSuperchainERC20, ZeroAddress} from "../src/L2NativeSuperchainERC20.sol";
import {ICrosschainERC20} from "@contracts-bedrock/L2/interfaces/ICrosschainERC20.sol";
import {ISuperchainERC20} from "@contracts-bedrock/L2/interfaces/ISuperchainERC20.sol";

Expand Down
12 changes: 6 additions & 6 deletions contracts/foundry.toml → foundry.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
src = "contracts/src"
test = "contracts/test"
script = "contracts/script"
out = "contracts/out"
libs = ["lib", "contracts/lib"]
evm_version = "cancun"

fs_permissions = [
{ access='read-write', path='../generated' },
]
fs_permissions = []

remappings = [
"@contracts-bedrock/=lib/optimism/packages/contracts-bedrock/src/",
Expand Down
14 changes: 7 additions & 7 deletions genesis/generated/900-l1-genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"depositContractAddress": "0x0000000000000000000000000000000000000000"
},
"nonce": "0x0",
"timestamp": "0x67167aea",
"timestamp": "0x6716b49b",
"extraData": "0x",
"gasLimit": "0x1c9c380",
"difficulty": "0x0",
Expand Down Expand Up @@ -299,7 +299,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000035": "0x0000000000000000000000811d626a3444c5c10fa01607ee11efbeaf19b0ff00",
"0x0000000000000000000000000000000000000000000000000000000000000037": "0x000000000000000000000000fb295aa436f23be2bd17678adf1232bdec02fed1",
"0x0000000000000000000000000000000000000000000000000000000000000038": "0x00000000000000000000000094e2e1fcbfd1099b450b2d5ac1f1701327361163",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067167aea00000001",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x0000000000000000000000000000000000000000000000006716b49b00000001",
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000fa16d7079aab573acdf911dd58e4457a20547548",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x000000000000000000000000d98e0b378583bbcc8183184ce053aecbd15f22e5"
},
Expand All @@ -315,7 +315,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000035": "0x0000000000000000000000811d626a3444c5c10fa01607ee11efbeaf19b0ff00",
"0x0000000000000000000000000000000000000000000000000000000000000037": "0x000000000000000000000000fd19a33f8d757b8ea93bb2b40b1cde946c1e1f4d",
"0x0000000000000000000000000000000000000000000000000000000000000038": "0x000000000000000000000000124efba5858a36f53726e107481e71d9060d84e0",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067167aea00000001",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x0000000000000000000000000000000000000000000000006716b49b00000001",
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000fa16d7079aab573acdf911dd58e4457a20547548",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x0000000000000000000000000c2405b5f131d7fe2e1f49e41e8a20d8e4179e7e"
},
Expand Down Expand Up @@ -521,7 +521,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000035": "0x0000000000000000000000811d626a3444c5c10fa01607ee11efbeaf19b0ff00",
"0x0000000000000000000000000000000000000000000000000000000000000037": "0x00000000000000000000000025782c27ef09d9173f8f274bead411bb9ac5417c",
"0x0000000000000000000000000000000000000000000000000000000000000038": "0x000000000000000000000000ed76b1d812dad3a322fdc3d766f251d51a78c3a9",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067167aea00000001",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x0000000000000000000000000000000000000000000000006716b49b00000001",
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000fa16d7079aab573acdf911dd58e4457a20547548",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x00000000000000000000000048ff3b8ac58f74a9060dadfd60093d71a2e0b2ea"
},
Expand Down Expand Up @@ -830,7 +830,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000035": "0x0000000000000000000000811d626a3444c5c10fa01607ee11efbeaf19b0ff00",
"0x0000000000000000000000000000000000000000000000000000000000000037": "0x00000000000000000000000083e3463f6d53730367af74ad398779760b6404dd",
"0x0000000000000000000000000000000000000000000000000000000000000038": "0x0000000000000000000000000a4bf4bfdbd1155df635021f4558eef0754e3706",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067167aea00000001",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x0000000000000000000000000000000000000000000000006716b49b00000001",
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000fa16d7079aab573acdf911dd58e4457a20547548",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x000000000000000000000000041ce2550a7925b7307fb1253962a3a6d89e7135"
},
Expand Down Expand Up @@ -937,7 +937,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000035": "0x0000000000000000000000811d626a3444c5c10fa01607ee11efbeaf19b0ff00",
"0x0000000000000000000000000000000000000000000000000000000000000037": "0x000000000000000000000000489d9f7f107dfca422f31f7b9d90d27442c76d64",
"0x0000000000000000000000000000000000000000000000000000000000000038": "0x000000000000000000000000ed5f8f44f210716c76111f7973acbddb39784d73",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067167aea00000001",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x0000000000000000000000000000000000000000000000006716b49b00000001",
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000fa16d7079aab573acdf911dd58e4457a20547548",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x000000000000000000000000702ff7bf17315db7a068039006515a1c9a40c1c0"
},
Expand Down Expand Up @@ -1266,7 +1266,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000000001",
"0x0000000000000000000000000000000000000000000000000000000000000001": "0x000000000000000000000000000000000000000000000000000000003b9aca00",
"0x0000000000000000000000000000000000000000000000000000000000000032": "0x000000000000000000000000000000000000000000000000000000000000dead",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067167aea00000000"
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x0000000000000000000000000000000000000000000000006716b49b00000000"
},
"balance": "0x0",
"nonce": "0x1"
Expand Down
Loading

0 comments on commit 3acbd0a

Please sign in to comment.