optimism icon indicating copy to clipboard operation
optimism copied to clipboard

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

Open abcfy2 opened this issue 3 months ago • 9 comments

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:

  • Operating System: [e.g. Ubuntu 20.04] Archlinux
  • Package Version (or commit hash): [e.g. op-node v1.5.1, op-node c934019]

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:

  • Bug Description
  • Steps to Reproduce
  • Environment Information

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

abcfy2 avatar Mar 07 '24 07:03 abcfy2

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

tynes avatar Mar 07 '24 16:03 tynes

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.

abcfy2 avatar Mar 08 '24 01:03 abcfy2

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

420516460 avatar Mar 11 '24 06:03 420516460

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

rabbitprincess avatar Mar 29 '24 07:03 rabbitprincess

I have this problem with v1.7.2 too.

HONGYI-SD avatar Apr 09 '24 02:04 HONGYI-SD

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,

pjt3591oo avatar Apr 15 '24 08:04 pjt3591oo

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!

420516460 avatar Apr 15 '24 08:04 420516460

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

Padraic-O-Mhuiris avatar Apr 24 '24 11:04 Padraic-O-Mhuiris

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 #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

  • previous version: [Deploy the L1 contracts] -> [Generate contract artifacts]
# 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
  • V1.7.3: [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

[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

  • previous version:

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

  • v1.7.3 version

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

  • previous version:

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

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

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

  • previous version:
$ cat deployments/getting-started/L1StandardBridgeProxy.json | jq -r .address
  • v1.7.3 version:
$ cat deployments/getting-started/.deploy | jq -r .L1StandardBridgeProxy

pjt3591oo avatar Apr 26 '24 23:04 pjt3591oo