Skip to content

Commit

Permalink
Fix bnb local network
Browse files Browse the repository at this point in the history
  • Loading branch information
boyuan-chen committed May 18, 2024
1 parent fd87b9f commit 9138984
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 110 deletions.
12 changes: 6 additions & 6 deletions ops/docker-compose-bnb-side.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ version: "3"

# Account #0
x-deployer_pk: &deployer_pk
DEPLOYER_PRIVATE_KEY: '0x953dbe85f02d84377f90a6eb6d8a6dd128aa50f69c4671d32414b139040be24b'
DEPLOYER_PRIVATE_KEY: '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'

# Account #6 - bobalink test
x-bobalink_pk: &bobalink_pk
BOBALINK_REPORTER_KEY: '0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e'

# Account #19
x-gas-price-oracle_pk: &gas-price-oracle_pk
GAS_PRICE_ORACLE_OWNER_PRIVATE_KEY: '0x68ef711b398fa47f22fbc44a972efbd2c2e25338e7c6afb92dc84b569bf784a5'
GAS_PRICE_ORACLE_OWNER_PRIVATE_KEY: '0xdf57089febbacf7ba0bc227dafbffa9fc08a93fdc68e1e42411a14efcf23656e'


services:
Expand Down Expand Up @@ -84,10 +84,10 @@ services:
MIN_BALANCE: 0
URL: http://dtl:8081/addresses.json
AA_DEPLOYER: http://dtl:8081/aa-addr.json
MNEMONIC_OR_PK: "0x953dbe85f02d84377f90a6eb6d8a6dd128aa50f69c4671d32414b139040be24b"
MNEMONIC_OR_PK: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
L1_NODE_WEB3_URL: http://l1_chain:8545
L2_NODE_WEB3_URL: http://l2geth:8545
BENEFICIARY: "0xc32ec0115BCB6693d4b4854531cA5e6a99217ABF"
BENEFICIARY: "0xcd3b766ccdd6ae721141f452c550ca635964ce71"
MAX_BUNDLE_GAS: 5000000
#should be set to false in prod!
UNSAFE: 'true'
Expand Down Expand Up @@ -132,5 +132,5 @@ services:
- "5432:5432"

networks:
default:
name: local-network
bnb-network:
name: bnb-network
145 changes: 78 additions & 67 deletions ops/docker-compose-bnb.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,87 @@
# # Accounts and their usage
# Deployer:
#- Address: 0xb75573a04648535Bddc52adf6fBc887149624253
#- PrivKey: 0x953dbe85f02d84377f90a6eb6d8a6dd128aa50f69c4671d32414b139040be24b

## Relayer:
#- Address: 0xBb46AbbCC95213754f549E0CFa2B13bef0aBFaB6
#- PrivKey: 0x4d5211ccb78c977d7ae7094b27b561458274a1c2df8be5f3c66479fe33ea8838

## Fast Relayer:
#- Address: 0x8E1Ad6FaC6ea5871140594ABEF5b1D503385e936
#- PrivKey: 0x3c6efff45290e2204cc19b091cdefffcead5757b074b1723e9cf8973e6337ba4

# Integration 2 PK:
#- Address: 0xC8D063A7e0A118432721daE5e059404b5598BD76
#- PrivKey: 0x81f43b0303746bfacbaae64947850e86deca412d3b39b1f8d3c89bf483d615f3

## Integration 3 PK:
#- Address: 0xc32ec0115BCB6693d4b4854531cA5e6a99217ABF
#- PrivKey: 0xeca0930606860b8ae4a7f2b9a56ee62c4e11f613a894810b7642cabef689cf09

# GasPrice Oracle
#- Address: 0x7fd60C817837dCFEFCa6D0A52A44980d12F70C59
#- PrivKey: 0x68ef711b398fa47f22fbc44a972efbd2c2e25338e7c6afb92dc84b569bf784a5
# l1_chain_1 | Account #0: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 (10000 ETH)
# l1_chain_1 | Private Key: 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
# l1_chain_1 |
# l1_chain_1 | Account #1: 0x70997970c51812dc3a010c7d01b50e0d17dc79c8 (10000 ETH)
# l1_chain_1 | Private Key: 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
# l1_chain_1 |
# l1_chain_1 | Account #2: 0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc (10000 ETH)
# l1_chain_1 | Private Key: 0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a
# l1_chain_1 |
# l1_chain_1 | Account #3: 0x90f79bf6eb2c4f870365e785982e1f101e93b906 (10000 ETH)
# l1_chain_1 | Private Key: 0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6
# l1_chain_1 |
# l1_chain_1 | Account #4: 0x15d34aaf54267db7d7c367839aaf71a00a2c6a65 (10000 ETH)
# l1_chain_1 | Private Key: 0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a
# l1_chain_1 |
# l1_chain_1 | Account #5: 0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc (10000 ETH)
# l1_chain_1 | Private Key: 0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba
# l1_chain_1 |
# l1_chain_1 | Account #6: 0x976ea74026e726554db657fa54763abd0c3a0aa9 (10000 ETH)
# l1_chain_1 | Private Key: 0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e
# l1_chain_1 |
# l1_chain_1 | Account #7: 0x14dc79964da2c08b23698b3d3cc7ca32193d9955 (10000 ETH)
# l1_chain_1 | Private Key: 0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356
# l1_chain_1 |
# l1_chain_1 | Account #8: 0x23618e81e3f5cdf7f54c3d65f7fbc0abf5b21e8f (10000 ETH)
# l1_chain_1 | Private Key: 0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97
# l1_chain_1 |
# l1_chain_1 | Account #9: 0xa0ee7a142d267c1f36714e4a8f75612f20a79720 (10000 ETH)
# l1_chain_1 | Private Key: 0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6
# l1_chain_1 |
# l1_chain_1 | Account #10: 0xbcd4042de499d14e55001ccbb24a551f3b954096 (10000 ETH)
# l1_chain_1 | Private Key: 0xf214f2b2cd398c806f84e317254e0f0b801d0643303237d97a22a48e01628897
# l1_chain_1 |
# l1_chain_1 | Account #11: 0x71be63f3384f5fb98995898a86b02fb2426c5788 (10000 ETH)
# l1_chain_1 | Private Key: 0x701b615bbdfb9de65240bc28bd21bbc0d996645a3dd57e7b12bc2bdf6f192c82
# l1_chain_1 |
# l1_chain_1 | Account #12: 0xfabb0ac9d68b0b445fb7357272ff202c5651694a (10000 ETH)
# l1_chain_1 | Private Key: 0xa267530f49f8280200edf313ee7af6b827f2a8bce2897751d06a843f644967b1
# l1_chain_1 |
# l1_chain_1 | Account #13: 0x1cbd3b2770909d4e10f157cabc84c7264073c9ec (10000 ETH)
# l1_chain_1 | Private Key: 0x47c99abed3324a2707c28affff1267e45918ec8c3f20b8aa892e8b065d2942dd
# l1_chain_1 |
# l1_chain_1 | Account #14: 0xdf3e18d64bc6a983f673ab319ccae4f1a57c7097 (10000 ETH)
# l1_chain_1 | Private Key: 0xc526ee95bf44d8fc405a158bb884d9d1238d99f0612e9f33d006bb0789009aaa
# l1_chain_1 |
# l1_chain_1 | Account #15: 0xcd3b766ccdd6ae721141f452c550ca635964ce71 (10000 ETH)
# l1_chain_1 | Private Key: 0x8166f546bab6da521a8369cab06c5d2b9e46670292d85c875ee9ec20e84ffb61
# l1_chain_1 |
# l1_chain_1 | Account #16: 0x2546bcd3c84621e976d8185a91a922ae77ecec30 (10000 ETH)
# l1_chain_1 | Private Key: 0xea6c44ac03bff858b476bba40716402b03e41b8e97e276d1baec7c37d42484a0
# l1_chain_1 |
# l1_chain_1 | Account #17: 0xbda5747bfd65f08deb54cb465eb87d40e51b197e (10000 ETH)
# l1_chain_1 | Private Key: 0x689af8efa8c651a91ad287602527f3af2fe9f6501a7ac4b061667b5a93e037fd
# l1_chain_1 |
# l1_chain_1 | Account #18: 0xdd2fd4581271e230360230f9337d5c0430bf44c0 (10000 ETH)
# l1_chain_1 | Private Key: 0xde9be858da4a475276426320d5e9262ecfc3ba460bfac56360bfa6c4c28b4ee0
# l1_chain_1 |
# l1_chain_1 | Account #19: 0x8626f6940e2eb28930efb4cef49b2d1f2c9c1199 (10000 ETH)
# l1_chain_1 | Private Key: 0xdf57089febbacf7ba0bc227dafbffa9fc08a93fdc68e1e42411a14efcf23656e

## Account #0
x-deployer_pk: &deployer_pk
DEPLOYER_PRIVATE_KEY: '0x953dbe85f02d84377f90a6eb6d8a6dd128aa50f69c4671d32414b139040be24b'
DEPLOYER_PRIVATE_KEY: '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'

# Account #8
x-relayer_pk: &relayer_pk
RELAYER_PRIVATE_KEY: '0x4d5211ccb78c977d7ae7094b27b561458274a1c2df8be5f3c66479fe33ea8838'
RELAYER_PRIVATE_KEY: '0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97'

# Account #9
# Account #18
x-fast-relayer_pk: &fast-relayer_pk
FAST_RELAYER_PRIVATE_KEY: '0x3c6efff45290e2204cc19b091cdefffcead5757b074b1723e9cf8973e6337ba4'
FAST_RELAYER_PRIVATE_KEY: '0xde9be858da4a475276426320d5e9262ecfc3ba460bfac56360bfa6c4c28b4ee0'

# Account #0 - allows the fee test
# Account #19 - allows the fee test
x-integration_pk: &integration_pk
PRIVATE_KEY: '0x953dbe85f02d84377f90a6eb6d8a6dd128aa50f69c4671d32414b139040be24b'
PRIVATE_KEY: '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'

# Account #10 - allows the fee test
# Account #14 - allows the fee test
x-integration_2_pk: &integration_2_pk
PRIVATE_KEY_2: '0x81f43b0303746bfacbaae64947850e86deca412d3b39b1f8d3c89bf483d615f3'
PRIVATE_KEY_2: '0xc526ee95bf44d8fc405a158bb884d9d1238d99f0612e9f33d006bb0789009aaa'

# Account #7 - allows the fee test
# Account #15 - allows the fee test
x-integration_3_pk: &integration_3_pk
PRIVATE_KEY_3: '0xeca0930606860b8ae4a7f2b9a56ee62c4e11f613a894810b7642cabef689cf09'
PRIVATE_KEY_3: '0x8166f546bab6da521a8369cab06c5d2b9e46670292d85c875ee9ec20e84ffb61'

x-integration_4_pk: &integration_4_pk
GAS_PRICE_ORACLE_PRIVATE_KEY: '0x68ef711b398fa47f22fbc44a972efbd2c2e25338e7c6afb92dc84b569bf784a5'
Expand Down Expand Up @@ -93,6 +130,7 @@ services:
context: ./docker/hardhat
dockerfile: Dockerfile
environment:
CHAIN_ID: 99
GAS_PRICE: 54321012345
ports:
# expose the service to the host for integration testing
Expand All @@ -113,15 +151,15 @@ services:
L1_NODE_WEB3_URL: http://l1_chain:8545
# these keys are hardhat's first 2 accounts, DO NOT use in production
<< : [*deployer_pk, *relayer_pk]
SEQUENCER_ADDRESS: "0xA2bC4Cf857f3D7a22b29c71774B4d8f25cc7edD0"
PROPOSER_ADDRESS: "0x59b02D4d2F94ea5c55230715a58EBb0b703bCD4B"
SEQUENCER_ADDRESS: "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
PROPOSER_ADDRESS: "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc"
# setting the whitelist owner to address(0) disables the whitelist
WHITELIST_OWNER: "0x0000000000000000000000000000000000000000"
L1_FEE_WALLET_ADDRESS: "0x391716d440c151c42cdf1c95c1d83a5427bca52c"
L2_CHAIN_ID: 31338
L2_BLOCK_GAS_LIMIT: 11000000
BLOCK_SIGNER_ADDRESS: "0x00000398232E2064F896018496b4b44b3D62751F"
GAS_PRICE_ORACLE_OWNER: "0x7fd60C817837dCFEFCa6D0A52A44980d12F70C59"
GAS_PRICE_ORACLE_OWNER: "0x8626f6940e2eb28930efb4cef49b2d1f2c9c1199"
GAS_PRICE_ORACLE_OVERHEAD: "2750"
GAS_PRICE_ORACLE_SCALAR: "1500000"
GAS_PRICE_ORACLE_L1_BASE_FEE: "1"
Expand All @@ -138,8 +176,6 @@ services:
ports:
# expose the service to the host for getting the contract addrs
- ${DEPLOYER_PORT:-8077}:8082
networks:
- bnb-network

boba_deployer:
depends_on:
Expand All @@ -163,8 +199,6 @@ services:
# skip compilation when run in docker-compose, since the contracts
# were already compiled in the builder step
NO_COMPILE: 1
networks:
- bnb-network

dtl:
depends_on:
Expand Down Expand Up @@ -198,8 +232,6 @@ services:
ports:
- ${DTL_PORT:-7878}:7878
- ${REGISTRY_PORT:-8080}:8081
networks:
- bnb-network

l2geth:
depends_on:
Expand Down Expand Up @@ -234,8 +266,6 @@ services:
ports:
- ${L2GETH_HTTP_PORT:-8545}:8545
- ${L2GETH_WS_PORT:-8546}:8546
networks:
- bnb-network

relayer:
depends_on:
Expand Down Expand Up @@ -263,8 +293,6 @@ services:
MAX_WAIT_TX_TIME_S: 5
RESUBMISSION_TIMEOUT: 5
MULTI_RELAY_LIMIT: 5
networks:
- bnb-network

# a second relay system for messages that need to get to L1 quickly
# NOTE - all withdrawal messages use the standard relayer with its 7 day window
Expand Down Expand Up @@ -295,8 +323,6 @@ services:
RESUBMISSION_TIMEOUT: 5
MULTI_RELAY_LIMIT: 5
FAST_RELAYER: 'true'
networks:
- bnb-network

batch_submitter:
restart: always
Expand All @@ -323,10 +349,8 @@ services:
BATCH_SUBMITTER_KMS_ENDPOINT: http://kms:8888/
BATCH_SUBMITTER_KMS_REGION: us-east-1
#aliases are setup, check seed.yml
BATCH_SUBMITTER_SEQUENCER_KEY_ID: "0x91ef3b19cdb344c5010358718e9347dd5cb2f362"
BATCH_SUBMITTER_PROPOSER_KEY_ID: "0xf31ca20d67bf4e3ddb4d7546c4a0983f3fa6ffea"
networks:
- bnb-network
BATCH_SUBMITTER_SEQUENCER_KEY_ID: "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
BATCH_SUBMITTER_PROPOSER_KEY_ID: "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc"

integration_tests:
image: bobanetwork/integration-tests:latest
Expand Down Expand Up @@ -354,8 +378,6 @@ services:
<< : [*integration_pk, *integration_2_pk, *integration_3_pk, *integration_4_pk]
volumes:
- ~/result:/opt/optimism/integration-tests/result
networks:
- bnb-network

replica:
depends_on:
Expand Down Expand Up @@ -392,8 +414,6 @@ services:
ports:
- ${L2GETH_HTTP_PORT:-8549}:8545
- ${L2GETH_WS_PORT:-8550}:8546
networks:
- bnb-network

verifier:
depends_on:
Expand Down Expand Up @@ -428,8 +448,6 @@ services:
ports:
- ${VERIFIER_HTTP_PORT:-8547}:8545
- ${VERIFIER_WS_PORT:-8548}:8546
networks:
- bnb-network

fraud-detector:
depends_on:
Expand All @@ -452,8 +470,6 @@ services:
L2_START_BLOCK: 1
ports:
- ${FRAUD_CHECKER_HTTP_PORT:-8555}:8555
networks:
- bnb-network

#in no way should this be running in production
kms:
Expand All @@ -463,16 +479,11 @@ services:
KMS_REGION: "us-east-1"
volumes:
- type: bind
source: ./seed-bnb.yaml
source: ./seed.yaml
target: /init/seed.yaml
ports:
- 8888:8888
networks:
- bnb-network

networks:
bnb-network:
name: local-network
ipam:
config:
- subnet: "192.168.0.0/24"
name: bnb-network
2 changes: 2 additions & 0 deletions ops/docker/hardhat/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ const isForkModeEnabled = !!process.env.FORK_URL
const forkUrl = process.env.FORK_URL
const forkStartingBlock = parseInt(process.env.FORK_STARTING_BLOCK) || undefined
const gasPrice = parseInt(process.env.GAS_PRICE) || 0
const chainId = parseInt(process.env.CHAIN_ID) || 31337

const config = {
networks: {
hardhat: {
chainId,
gasPrice,
initialBaseFeePerGas: 0
},
Expand Down
41 changes: 4 additions & 37 deletions packages/contracts/src/local-network-config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {
defaultHardhatNetworkHdAccountsConfigParams
} from 'hardhat/internal/core/config/default-config'
import { defaultHardhatNetworkHdAccountsConfigParams } from 'hardhat/internal/core/config/default-config'
import { normalizeHardhatNetworkAccountsConfig } from 'hardhat/internal/core/providers/util'

export const hardHatLocalTestnet = {
Expand Down Expand Up @@ -142,40 +140,9 @@ export const AvalancheLocalTestnet = {

export const BnbLocalTestnet = {
chainID: 99,
accounts: [
{
privateKey:
'0x953dbe85f02d84377f90a6eb6d8a6dd128aa50f69c4671d32414b139040be24b',
},
{
privateKey:
'0x4d5211ccb78c977d7ae7094b27b561458274a1c2df8be5f3c66479fe33ea8838',
},
{
privateKey:
'0x3c6efff45290e2204cc19b091cdefffcead5757b074b1723e9cf8973e6337ba4',
},
{
privateKey:
'0x81f43b0303746bfacbaae64947850e86deca412d3b39b1f8d3c89bf483d615f3',
},
{
privateKey:
'0xeca0930606860b8ae4a7f2b9a56ee62c4e11f613a894810b7642cabef689cf09',
},
{
privateKey:
'0x68ef711b398fa47f22fbc44a972efbd2c2e25338e7c6afb92dc84b569bf784a5',
},
{
privateKey:
'0xa568b36fca21714f879e3cf157f021a4c5dccd6229ef6e6eee7fb7888193c026',
},
{
privateKey:
'0xc484de1ef84e998869d59752d1f09bffa161673d54250ea152ec82d684e2f154',
},
],
accounts: normalizeHardhatNetworkAccountsConfig(
defaultHardhatNetworkHdAccountsConfigParams
).slice(0, 20),
depositL2Gas: 8_000_000,
gasLimitOption: { gasLimit: 1_000_000 },
isLocalAltL1: true,
Expand Down

0 comments on commit 9138984

Please sign in to comment.