Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,30 @@ subspecifications that the Lean Ethereum protocol relies on.
- When refactoring from functions to classes, DELETE the old functions entirely
- Update ALL call sites to use the new API directly
- Old patterns must be REMOVED, not preserved alongside new ones
- **CRITICAL - NO ABBREVIATIONS IN IDENTIFIERS**: This is a STRICT requirement. Every
identifier — variables, parameters, function and method names, class names, attributes,
and constants — must spell words out in full. A reference spec must be as explicit as
possible; abbreviations make it ambiguous. This applies to source, tests, and the
`packages/` testing framework.
- Expand truncated words. Examples:
- `att` / `att_data` → `attestation` / `attestation_data`
- `msg` → `message`, `sig` → `signature`, `sk` → `secret_key`, `pk` / `pubkey` → `public_key`
- `idx` → `index`, `prev` → `previous`, `curr` → `current`, `agg` → `aggregate`
- `prop` → `proposal`, `conn` → `connection`, `addr` → `address`, `cert` → `certificate`
- `privkey` → `private_key`, `elem` → `element`, `buf` → `buffer`, `dir` → `directory`
- `len` → `length` (inside a name, never the `len()` builtin), `fe` → `field_elements`
- Use the correct domain term, not just any expansion: a validator is referenced by its
INDEX, so `validator_id` → `validator_index` (never `validator_id`).
- KEEP canonical protocol identifiers that genuinely use "ID": `peer_id`, `node_id`,
`protocol_id`, `subnet_id`, `stream_id`. The trailing `_id` is fine on these; only expand
the word part (`msg_id` → `message_id`, but `peer_id` stays).
- KEEP canonical short field/format names and accepted prefixes: `attnets` and `seq`
(ENR fields), `pem`, `num`/`num_*` (eth2 number-of style, e.g. `num_validators`), and the
`reqresp` libp2p protocol name.
- KEEP universal Python idioms and library/stdlib API names verbatim: `args`, `kwargs`,
`config`, `model_config`, `tmp_path`, `dest` (argparse), `exc_info`, `__init__`, `__repr__`.
- NEVER rename external/wire identifiers: third-party library symbols (e.g. functions
imported from `lean_multisig_py`), protobuf field names, JSON/YAML keys, pydantic aliases,
or any on-the-wire string. Rename the Python identifier, never the serialized contract.
- When a fully-expanded name becomes unwieldy, prefer a shorter but still complete phrasing
(drop redundant words) rather than re-introducing an abbreviation.
10 changes: 5 additions & 5 deletions packages/testing/src/consensus_testing/genesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ def _build_validators(num_validators: int) -> Validators:

validators = []
for i in range(num_validators):
idx = ValidatorIndex(i)
attestation_pubkey, proposal_pubkey = key_manager.get_public_keys(idx)
index = ValidatorIndex(i)
attestation_public_key, proposal_public_key = key_manager.get_public_keys(index)
validators.append(
Validator(
attestation_pubkey=Bytes52(attestation_pubkey.encode_bytes()),
proposal_pubkey=Bytes52(proposal_pubkey.encode_bytes()),
index=idx,
attestation_public_key=Bytes52(attestation_public_key.encode_bytes()),
proposal_public_key=Bytes52(proposal_public_key.encode_bytes()),
index=index,
)
)

Expand Down
Loading
Loading