Skip to content

Commit

Permalink
ops-bedrock: change devnet l1 init holder (#76)
Browse files Browse the repository at this point in the history
* ops-bedrock: change devnet l1 init holder

* fix readme

* fix readme

---------

Co-authored-by: Welkin <welkin.b@nodereal.com>
  • Loading branch information
welkin22 and Welkin authored Oct 26, 2023
1 parent 4e98121 commit 22a8a64
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 26 deletions.
10 changes: 5 additions & 5 deletions bedrock-devnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ make devnet-logs
```

# Notes
1. If you encounter a ValueError: invalid mode: 'rU' while trying to load binding.gyp error when executing `yarn install`, this may be caused by python3 installed on your computer. You need to install python 2.7 and configure the environment variable to specify the python version to use: `export npm_config_python=/path/to/executable/python`.
1. If you encounter a ValueError: invalid mode: 'rU' while trying to load binding.gyp error when executing `yarn install`, this may be caused by python3 installed on your computer but Npm requires python 2.7. You need to install python 2.7 and configure the environment variable to specify the python version to use: `export npm_config_python=/path/to/executable/python`.
2. When executing for the first time, please be patient if you see the message "wait L1 up...", as the BSC network takes time to initialize.
3. If you encounter an error during the "Deploying contracts" step, please try again as it usually recovers.
4. Do not use the `make devnet-up` command, use the make `devnet-up-deploy` command to start devnet. The `devnet-up` command is not well adapted.
4. Do not use the `make devnet-up` command, use the `make devnet-up-deploy` command to start devnet. The `devnet-up` command is not well adapted.
5. L1 is accessible at http://localhost:8545, and L2 is accessible at http://localhost:9545

# Additional Information
Expand All @@ -59,13 +59,13 @@ L2 chain ID is 901.

L1 test account:

address: 0x04d63aBCd2b9b1baa327f2Dda0f873F197ccd186
address: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266

Private key: 59ba8068eb256d520179e903f43dacf6d8d57d72bd306e1bd603fdb8c8da10e8
Private key: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

L2 test account:

Address: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
Address: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266

Private key: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

38 changes: 19 additions & 19 deletions bedrock-devnet/devnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,25 @@ def devnet_deploy(paths):
devnet_cfg_orig = pjoin(paths.contracts_bedrock_dir, 'deploy-config', 'devnetL1.json')
devnet_cfg_backup = pjoin(paths.devnet_dir, 'devnetL1.json.bak')
shutil.copy(devnet_cfg_orig, devnet_cfg_backup)
deploy_config = read_json(devnet_cfg_orig)
l1BlockTag = l1BlockTagGet()["result"]
log.info(l1BlockTag)
l1BlockTimestamp = l1BlockTimestampGet(l1BlockTag)["result"]["timestamp"]
log.info(l1BlockTimestamp)
deploy_config['l1GenesisBlockTimestamp'] = l1BlockTimestamp
deploy_config['l1StartingBlockTag'] = l1BlockTag
deploy_config['l1ChainID'] = int(bscChainId,10)
deploy_config['batchSenderAddress'] = l1_init_holder
deploy_config['l2OutputOracleProposer'] = l1_init_holder
deploy_config['baseFeeVaultRecipient'] = l1_init_holder
deploy_config['l1FeeVaultRecipient'] = l1_init_holder
deploy_config['sequencerFeeVaultRecipient'] = l1_init_holder
deploy_config['proxyAdminOwner'] = l1_init_holder
deploy_config['finalSystemOwner'] = l1_init_holder
deploy_config['portalGuardian'] = l1_init_holder
deploy_config['controller'] = l1_init_holder
deploy_config['governanceTokenOwner'] = l1_init_holder
write_json(devnet_cfg_orig, deploy_config)

if os.path.exists(paths.addresses_json_path):
log.info('Contracts already deployed.')
Expand Down Expand Up @@ -163,25 +182,6 @@ def devnet_deploy(paths):
log.info('L2 genesis and rollup configs already generated.')
else:
log.info('Generating network config.')
deploy_config = read_json(devnet_cfg_orig)
l1BlockTag = l1BlockTagGet()["result"]
log.info(l1BlockTag)
l1BlockTimestamp = l1BlockTimestampGet(l1BlockTag)["result"]["timestamp"]
log.info(l1BlockTimestamp)
deploy_config['l1GenesisBlockTimestamp'] = l1BlockTimestamp
deploy_config['l1StartingBlockTag'] = l1BlockTag
deploy_config['l1ChainID'] = int(bscChainId,10)
deploy_config['batchSenderAddress'] = l1_init_holder
deploy_config['l2OutputOracleProposer'] = l1_init_holder
deploy_config['baseFeeVaultRecipient'] = l1_init_holder
deploy_config['l1FeeVaultRecipient'] = l1_init_holder
deploy_config['sequencerFeeVaultRecipient'] = l1_init_holder
deploy_config['proxyAdminOwner'] = l1_init_holder
deploy_config['finalSystemOwner'] = l1_init_holder
deploy_config['portalGuardian'] = l1_init_holder
deploy_config['controller'] = l1_init_holder
deploy_config['governanceTokenOwner'] = l1_init_holder
write_json(devnet_cfg_orig, deploy_config)
log.info('Generating L2 genesis and rollup configs.')
run_command([
'go', 'run', 'cmd/main.go', 'genesis', 'l2',
Expand Down
3 changes: 3 additions & 0 deletions ops-bedrock/l1-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ cd genesis
npm install
cd ..

sed -i -e "s/INIT_HOLDER=\"0x04d63aBCd2b9b1baa327f2Dda0f873F197ccd186\"/INIT_HOLDER=\"$INIT_HOLDER\"/g" .env
sed -i -e "s/INIT_HOLDER_PRV=\"59ba8068eb256d520179e903f43dacf6d8d57d72bd306e1bd603fdb8c8da10e8\"/INIT_HOLDER_PRV=\"$INIT_HOLDER_PRV\"/g" .env

if [ ! -f init_file_bc ]; then
bash +x ./setup_bc_node.sh native_init
echo "finish" > init_file_bc
Expand Down
4 changes: 2 additions & 2 deletions ops-bedrock/l1.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
INIT_HOLDER="0x04d63aBCd2b9b1baa327f2Dda0f873F197ccd186"
INIT_HOLDER_PRV="59ba8068eb256d520179e903f43dacf6d8d57d72bd306e1bd603fdb8c8da10e8"
INIT_HOLDER="0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
INIT_HOLDER_PRV="ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
BSC_CHAIN_ID=714

0 comments on commit 22a8a64

Please sign in to comment.