prysmaticlabs / prysm

Go implementation of Ethereum proof of stake
https://www.offchainlabs.com
GNU General Public License v3.0
3.47k stars 1k forks source link

bug with minimal genesis preset: SynCommitteeBits length expected 64 #14249

Open 0xys opened 3 months ago

0xys commented 3 months ago

Describe the bug

I built prysmctl with minimal build tag to test generating private net genesis.

go build -tags minimal -o prysmctl ./cmd/prysmctl

but the following command fails, with the error log as provided.

./prysmctl testnet generate-genesis --fork=capella --num-validators=64 --genesis-time-delay=15 --output-ssz=genesis.ssz --chain-config-file=my_minimal_config.yml

Probably due to the hardcoded bit length of 64 here. (must be 4 = 32/8 for minimal preset) https://github.com/prysmaticlabs/prysm/blob/3b184f43c86baf6c36478f65a5113e7cf0836d41/proto/prysm/v1alpha1/altair.ssz.go#L782-L785

Has this worked before in a previous version?

No response

🔬 Minimal Reproduction

my config is

CONFIG_NAME: minimal
PRESET_BASE: minimal

# Genesis
GENESIS_FORK_VERSION: 0x20000089

# Altair
ALTAIR_FORK_EPOCH: 0
ALTAIR_FORK_VERSION: 0x20000090

# Merge
BELLATRIX_FORK_EPOCH: 0
BELLATRIX_FORK_VERSION: 0x20000091
TERMINAL_TOTAL_DIFFICULTY: 0

# Capella
CAPELLA_FORK_EPOCH: 0
CAPELLA_FORK_VERSION: 0x20000092
MAX_WITHDRAWALS_PER_PAYLOAD: 16

DENEB_FORK_VERSION: 0x20000093

# Time parameters
SECONDS_PER_SLOT: 12
SLOTS_PER_EPOCH: 6

# Deposit contract
DEPOSIT_CONTRACT_ADDRESS: 0x4242424242424242424242424242424242424242

Error

FATA[0000] Could not generate beacon chain genesis state  error="could not generate genesis state: could not hash tree root empty block body: --.SyncCommitteeBits (bytes array does not have the correct length): expected 64 and 4 found" prefix=genesis


### Platform(s)

Mac (Apple Silicon)

### What version of Prysm are you running? (Which release)

v5.0.4

### Anything else relevant (validator index / public key)?

_No response_
james-prysm commented 3 months ago

you'll need to build with bazel in this case