Skip to content

Commit

Permalink
update start beacon params - NEW ERROR UNLOCKED
Browse files Browse the repository at this point in the history
  • Loading branch information
badgersrus committed Jun 25, 2024
1 parent 597f2c1 commit bddaa80
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 46 deletions.
2 changes: 1 addition & 1 deletion integration/eth2network/eth2_binaries.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

const (
_gethVersion = "1.14.0"
_prysmVersion = "v5.0.3"
_prysmVersion = "v5.0.4"
)

var (
Expand Down
37 changes: 15 additions & 22 deletions integration/eth2network/eth2_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,35 @@ personal.importRawKey(key, pwd);
accts = personal.listAccounts;
personal.unlockAccount(accts[0], pwd, 0);
console.log("key: ", key)
console.log("pwd: ", pwd)
console.log("accts: ", accts[0]);
console.log("Unlocked account");
`

const _beaconConfig = `
CONFIG_NAME: interop
PRESET_BASE: interop
DEPOSIT_CHAIN_ID: %d
DEPOSIT_NETWORK_ID: %d
# Genesis
GENESIS_FORK_VERSION: 0x20000089
# Altair
ALTAIR_FORK_EPOCH: 1
ALTAIR_FORK_EPOCH: 0
ALTAIR_FORK_VERSION: 0x20000090
# Merge
BELLATRIX_FORK_EPOCH: 2
BELLATRIX_FORK_EPOCH: 0
BELLATRIX_FORK_VERSION: 0x20000091
TERMINAL_TOTAL_DIFFICULTY: 0
# Capella
CAPELLA_FORK_EPOCH: 3
CAPELLA_FORK_EPOCH: 0
CAPELLA_FORK_VERSION: 0x20000092
MAX_WITHDRAWALS_PER_PAYLOAD: 16
DENEB_FORK_EPOCH: 4
DENEB_FORK_EPOCH: 0
DENEB_FORK_VERSION: 0x20000093
# Time parameters
Expand All @@ -59,13 +60,10 @@ DEPOSIT_CONTRACT_ADDRESS: 0x4242424242424242424242424242424242424242

const _baseGenesis = `{
"config": {
"ChainName": "l1_chain",
"chainId": 32382,
"consensus": "ethash",
"homesteadBlock": 0,
"daoForkSupport": true,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
Expand All @@ -75,17 +73,15 @@ const _baseGenesis = `{
"muirGlacierBlock": 0,
"berlinBlock": 0,
"londonBlock": 0,
"terminalBlockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"arrowGlacierBlock": 0,
"grayGlacierBlock": 0,
"shanghaiTime": 1719219940,
"cancunTime": 1719220012,
"shanghaiTime": 1694203366,
"ethash": {},
"terminalTotalDifficulty": 0,
"terminalTotalDifficultyPassed": true
},
"nonce": "0",
"timestamp": "0x65c0a21c",
"nonce": "0x0",
"timestamp": "0x667ad601",
"gasLimit": "0x1c9c380",
"difficulty": "0x1",
"mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
Expand All @@ -99,9 +95,9 @@ const _baseGenesis = `{
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"baseFeePerGas": "0x0",
"excessBlobGas": "0x0",
"blobGasUsed": "0x0"
"baseFeePerGas": null,
"excessBlobGas": null,
"blobGasUsed": null
}`

// generateGenesis returns a genesis with specified params
Expand All @@ -115,12 +111,9 @@ func generateGenesis(blockTimeSecs int, chainID int, signerAddrs, prefundedAddrs

// add the prefunded prefundedAddrs
for _, account := range prefundedAddrs {
genesisJSON["alloc"].(map[string]interface{})[account] = map[string]string{"balance": "7500000000000000000000000000000"}
genesisJSON["alloc"].(map[string]interface{})[account] = map[string]string{"balance": "0x21e19e0c9bab2400000"}
}

//// set the block prod speed
//genesisJSON["config"].(map[string]interface{})["clique"].(map[string]interface{})["period"] = blockTimeSecs

// set the network id
genesisJSON["config"].(map[string]interface{})["chainId"] = chainID

Expand Down
72 changes: 49 additions & 23 deletions integration/eth2network/eth2_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ func NewEth2Network(

// Write beacon config
//beaconConf := fmt.Sprintf(_beaconConfig, chainID, chainID, secondsPerSlot, slotsPerEpoch)
beaconConf := fmt.Sprintf(_beaconConfig, chainID, chainID)
err = os.WriteFile(prysmConfigPath, []byte(beaconConf), 0o600)
//beaconConf := fmt.Sprintf(_beaconConfig, chainID, chainID)
err = os.WriteFile(prysmConfigPath, []byte(_beaconConfig), 0o600)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -397,9 +397,7 @@ func (n *Impl) gethStartNode(executionPort, networkPort, httpPort, wsPort int, d
_dataDirFlag, dataDirPath,
"--http",
"--http.addr", "0.0.0.0",
"--http.vhosts", "*",
"--http.port", fmt.Sprintf("%d", httpPort),
"--http.corsdomain", "*",
"--http.api", "admin,miner,engine,personal,eth,net,web3,debug",
"--mine",
"--miner.etherbase", minerAddress,
Expand All @@ -416,8 +414,7 @@ func (n *Impl) gethStartNode(executionPort, networkPort, httpPort, wsPort int, d
"--syncmode", "full", // sync mode to download and test all blocks and txs
"--allow-insecure-unlock", // allows to use personal accounts over http/ws
"--nodiscover", // don't try and discover peers
"--ipcdisable", // avoid geth erroring bc the ipc path is too long
"--verbosity", "3", // error log level
"--verbosity", "5", // error log level
}
fmt.Printf("gethStartNode: %s %s\n", n.gethBinaryPath, strings.Join(args, " "))
cmd := exec.Command(n.gethBinaryPath, args...) //nolint
Expand All @@ -433,9 +430,8 @@ func (n *Impl) prysmGenerateGenesis() error {
"testnet",
"generate-genesis",
"--fork", "deneb",
"--genesis-time-delay", "10",
"--num-validators", fmt.Sprintf("%d", len(n.dataDirs)),
"--config-name", "interop",
"--genesis-time-delay", "10",
"--chain-config-file", n.prysmConfigPath,
"--geth-genesis-json-in", n.gethGenesisPath,
"--geth-genesis-json-out", n.gethGenesisPath,
Expand All @@ -453,30 +449,60 @@ func (n *Impl) prysmStartBeaconNode(gethAuthRPCPort, rpcPort, p2pPort int, nodeD
// full command list at https://docs.prylabs.network/docs/prysm-usage/parameters
args := []string{
"--datadir", path.Join(nodeDataDir, "prysm", "beacondata"),
"--interop-eth1data-votes",
"--accept-terms-of-use",
"--no-discovery",
"--rpc-port", fmt.Sprintf("%d", rpcPort),
"--p2p-udp-port", fmt.Sprintf("%d", p2pPort),
"--min-sync-peers", "0",
"--minimum-peers-per-subnet", "0",
//"--min-sync-peers", fmt.Sprintf("%d", len(n.dataDirs)-1),
//"--minimum-peers-per-subnet", fmt.Sprintf("%d", min(len(n.dataDirs)-1, 2)),
"--interop-num-validators", fmt.Sprintf("%d", len(n.dataDirs)),
"--genesis-state", n.prysmGenesisPath,
"--bootstrap-node", "",
"--interop-eth1data-votes",
"--chain-config-file", n.prysmConfigPath,
"--config-file", n.prysmConfigPath,
"--contract-deployment-block", "0",
"--chain-id", fmt.Sprintf("%d", n.chainID),
"--grpc-gateway-corsdomain", "*",
"--grpc-gateway-port", fmt.Sprintf("%d", rpcPort+10),
"--execution-endpoint", fmt.Sprintf("http://127.0.0.1:%d", gethAuthRPCPort),
"--accept-terms-of-use",
"--jwt-secret", path.Join(nodeDataDir, "geth", "jwtsecret"),
"--contract-deployment-block", "0",
"--verbosity", "trace",
//"--suggested-fee-recipient", n.preFundedMinerPKs["n0"]
"--minimum-peers-per-subnet", "0",
"--enable-debug-rpc-endpoints",
"--execution-endpoint", fmt.Sprintf("http://127.0.0.1:%d", gethAuthRPCPort),

//"--rpc-port", fmt.Sprintf("%d", rpcPort),
//"--p2p-udp-port", fmt.Sprintf("%d", p2pPort),
//"--min-sync-peers", fmt.Sprintf("%d", len(n.dataDirs)-1),
//"--minimum-peers-per-subnet", fmt.Sprintf("%d", min(len(n.dataDirs)-1, 2)),
//"--interop-num-validators", fmt.Sprintf("%d", len(n.dataDirs)),
//"--config-file", n.prysmConfigPath,
//"--grpc-gateway-corsdomain", "*",
//"--grpc-gateway-port", fmt.Sprintf("%d", rpcPort+10),
//"--execution-endpoint", fmt.Sprintf("http://127.0.0.1:%d", gethAuthRPCPort),
//"--contract-deployment-block", "0",
//"--verbosity", "trace",
//"--enable-debug-rpc-endpoints",
"--force-clear-db",
}
//args := []string{
// "--datadir", path.Join(nodeDataDir, "prysm", "beacondata"),
// "--interop-eth1data-votes",
// "--accept-terms-of-use",
// "--no-discovery",
// "--rpc-port", fmt.Sprintf("%d", rpcPort),
// "--p2p-udp-port", fmt.Sprintf("%d", p2pPort),
// "--min-sync-peers", "0",
// "--minimum-peers-per-subnet", "0",
// //"--min-sync-peers", fmt.Sprintf("%d", len(n.dataDirs)-1),
// //"--minimum-peers-per-subnet", fmt.Sprintf("%d", min(len(n.dataDirs)-1, 2)),
// "--interop-num-validators", fmt.Sprintf("%d", len(n.dataDirs)),
// "--genesis-state", n.prysmGenesisPath,
// "--chain-config-file", n.prysmConfigPath,
// "--config-file", n.prysmConfigPath,
// "--contract-deployment-block", "0",
// "--chain-id", fmt.Sprintf("%d", n.chainID),
// "--grpc-gateway-corsdomain", "*",
// "--grpc-gateway-port", fmt.Sprintf("%d", rpcPort+10),
// "--execution-endpoint", fmt.Sprintf("http://127.0.0.1:%d", gethAuthRPCPort),
// "--jwt-secret", path.Join(nodeDataDir, "geth", "jwtsecret"),
// "--contract-deployment-block", "0",
// "--verbosity", "trace",
// "--enable-debug-rpc-endpoints",
// "--force-clear-db",
//}

fmt.Printf("prysmStartBeaconNode: %s %s\n", n.prysmBeaconBinaryPath, strings.Join(args, " "))
cmd := exec.Command(n.prysmBeaconBinaryPath, args...) //nolint
Expand Down

0 comments on commit bddaa80

Please sign in to comment.