ethereum-optimism / developers

This repository is to serve as a place where builders on every level of the OP Stack can come to collaborate.
Creative Commons Zero v1.0 Universal
73 stars 45 forks source link

Function `sync()` is not implemented in your script. #461

Open abcfy2 opened 8 months ago

abcfy2 commented 8 months ago

Bug Description From official guide: https://docs.optimism.io/builders/chain-operators/tutorials/create-l2-rollup

Generate contract artifacts

forge script scripts/Deploy.s.sol:Deploy --sig 'sync()' --rpc-url $L1_RPC_URL

Will show this error:

# git checkout v1.7.0
$ forge script scripts/Deploy.s.sol:Deploy --sig 'sync()' --rpc-url $L1_RPC_URL
[⠢] Compiling...
[⠆] Compiling 77 files with 0.8.15
[⠒] Compiling 12 files with 0.8.24
[⠘] Solc 0.8.24 finished in 1.68s
[⠒] Solc 0.8.15 finished in 121.42s
Compiler run successful!
Error: 
Function `sync()` is not implemented in your script.

Steps to Reproduce

When running:

$ forge script scripts/Deploy.s.sol:Deploy --private-key $GS_ADMIN_PRIVATE_KEY --broadcast --rpc-url $L1_RPC_URL --slow
$ forge script scripts/Deploy.s.sol:Deploy --sig 'sync()' --rpc-url $L1_RPC_URL

Expected behavior

Follow the official docs should work.

Environment Information:

Dependency | Minimum | Actual git 2 2.44.0 go 1.21 1.22.1 node 20 20.11.1 pnpm 8 8.13.1 foundry 0.2.0 (a5efe4f) 0.2.0 (ce22450) make 3 4.4.1 jq 1.6 1.7.1 direnv 2 2.33.0

Configurations: Command line flags or environment variables you're using.

Logs:

[⠢] Compiling...
[⠆] Compiling 77 files with 0.8.15
[⠒] Compiling 12 files with 0.8.24
[⠘] Solc 0.8.24 finished in 1.68s
[⠒] Solc 0.8.15 finished in 121.42s
Compiler run successful!
Error: 
Function `sync()` is not implemented in your script.

Additional context Add any other context about the problem here.


⚠️ Notice: Issues that do not include the following sections will be subject to closure:

Please ensure all required sections are filled out accurately to expedite the debugging process and improve issue resolution efficiency.

tynes commented 8 months ago

There is no need to call sync() anymore, the guide needs an update cc @smartcontracts

abcfy2 commented 8 months ago

An update would be great. I find the guide is outdated.

./scripts/getting-started/config.sh

generated the deploy-config/getting-started.json seems lost some required properties. I have to add the lost properties to make the deploy success.

Thanks.

420516460 commented 8 months ago

I have this problem when deploying L2 with Optimized Release v1.7.0, so what properties should i add?

rabbitprincess commented 7 months ago

When will the tutorial branch and getting-started updated? Outdated tutorials and documentation is so confused now. ( l2oo, sync, deployment-dir )

HONGYI-SD commented 7 months ago

I have this problem with v1.7.2 too.

pjt3591oo commented 7 months ago

I have this problem when deploying L2 with Optimized Release v1.7.0, so what properties should i add?

"fundDevAccounts": false,
"useFaultProofs": false,
"proofMaturityDelaySeconds": 604800,
"disputeGameFinalityDelaySeconds": 302400,
"respectedGameType": 0,
"faultGameWithdrawalDelay": 604800,
420516460 commented 7 months ago

I have this problem when deploying L2 with Optimized Release v1.7.0, so what properties should i add?

"fundDevAccounts": false,
"useFaultProofs": false,
"proofMaturityDelaySeconds": 604800,
"disputeGameFinalityDelaySeconds": 302400,
"respectedGameType": 0,
"faultGameWithdrawalDelay": 604800,

thanks @pjt3591oo ~, i will try!

Padraic-O-Mhuiris commented 6 months ago

I've also experienced issues with this on 1.7.3 but those @pjt3591oo changes succeeded in a deployment, I understand some changes have been made in https://github.com/ethereum-optimism/optimism/pull/10106 but would be good to have clarity on whether it will be fixed in the next release

pjt3591oo commented 6 months ago

I've also experienced issues with this on 1.7.3 but those @pjt3591oo changes succeeded in a deployment, I understand some changes have been made in ethereum-optimism/optimism#10106 but would be good to have clarity on whether it will be fixed in the next release

I am not sure whether this will be reflected in the next version. I am also just a developer working on a project using optimism.

I would like to share some of the research I conducted while working on the project based on version v1.7.3.

There are four things areas that need to be modified in the official Optimism document.

First.

The process of deploying contracts to L1 and creating artifacts has been simplified.

deploy-the-l1-contracts

# Deploy the L1 contracts
# generate .deploy
$ forge script scripts/Deploy.s.sol:Deploy --private-key $GS_ADMIN_PRIVATE_KEY --broadcast --rpc-url $L1_RPC_URL --slow

# Generate contract artifacts
# .deploy to [deployed contracts].json
forge script scripts/Deploy.s.sol:Deploy --sig 'sync()' --rpc-url $L1_RPC_URL
# Deploy the L1 contracts
# generate .deploy
$ forge script scripts/Deploy.s.sol:Deploy --private-key $GS_ADMIN_PRIVATE_KEY --broadcast --rpc-url $L1_RPC_URL --slow

[deployed contracts].json vs .deploy

[deployed contracts].json: each json files that each contract include abi, address, bytecode etc

.deploy: one json file key(contract name)-value(address) of deployed contract on L1


Ssecond.

The command options for creating configuration files (genesis, rollup) for L2 have been changed.

https://docs.optimism.io/builders/chain-operators/tutorials/create-l2-rollup#generate-the-l2-config-files

Specify the directory path containing artifacts with the deployment-dir option.

$ go run cmd/main.go genesis l2 \
  --deploy-config ../packages/contracts-bedrock/deploy-config/getting-started.json \
  --deployment-dir ../packages/contracts-bedrock/deployments/getting-started/ \
  --outfile.l2 genesis.json \
  --outfile.rollup rollup.json \
  --l1-rpc $L1_RPC_URL

but removed deployment-dir option, add l1-deployments

Specify the .deploy file path instead of the artifacts path.

$ go run cmd/main.go genesis l2 \
  --deploy-config ../packages/contracts-bedrock/deploy-config/getting-started.json \
  --l1-deployments ../packages/contracts-bedrock/deployments/getting-started/.deploy \
  --outfile.l2 genesis.json \
  --outfile.rollup rollup.json \
  --l1-rpc $L1_RPC_URL

Third.

When running proposer, you need to change the value passed to the --l2-address option.

https://docs.optimism.io/builders/chain-operators/tutorials/create-l2-rollup#start-op-proposer

l2oo-address show deployed L2OutputOracleProxy contract path

$ ./bin/op-proposer \
  --poll-interval=12s \
  --rpc.port=8560 \
  --rollup-rpc=http://localhost:8547 \
  --l2oo-address=$(cat ../packages/contracts-bedrock/deployments/getting-started/L2OutputOracleProxy.json | jq -r .address) \
  --private-key=$GS_PROPOSER_PRIVATE_KEY \
  --l1-eth-rpc=$L1_RPC_URL

but not exist L2OutputOracleProxy.json file. exist .deploy file


fourth.

Changed the part where L1StandardBridgeProxy contract address is retrieved for bridge (asset movement)

https://docs.optimism.io/builders/chain-operators/tutorials/create-l2-rollup#connect-your-wallet-to-your-chain

$ cat deployments/getting-started/L1StandardBridgeProxy.json | jq -r .address
$ cat deployments/getting-started/.deploy | jq -r .L1StandardBridgeProxy