Skip to content

Commit 12709ae

Browse files
feat: add devnet4 support (#283)
This PR adds devnet 4 support to ethlambda, removing devnet 3 support. --------- Co-authored-by: Pablo Deymonnaz <pdeymon@fi.uba.ar>
1 parent 0ee9ac1 commit 12709ae

40 files changed

Lines changed: 3666 additions & 2115 deletions

.claude/skills/devnet-log-review/references/CLIENT_LOG_PATTERNS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ ethlambda_p2p: Published block to gossipsub slot=X proposer=Y
5454
```
5555
ethlambda_blockchain: Published attestation slot=X validator_id=Y
5656
ethlambda_p2p::gossipsub::handler: Received new attestation from gossipsub, sending for processing slot=X validator=Y
57-
ethlambda_blockchain: Skipping attestation for proposer slot=X (expected: proposers don't attest to their own slot)
5857
```
5958

6059
### Block Processing

CLAUDE.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ crates/
4848
### Tick-Based Validator Duties (4-second slots, 5 intervals per slot)
4949
```
5050
Interval 0: Block proposal → accept attestations if proposal exists
51-
Interval 1: Vote propagation (no action)
51+
Interval 1: Attestation production (all validators, including proposer)
5252
Interval 2: Aggregation (aggregators create proofs from gossip signatures)
5353
Interval 3: Safe target update (fork choice)
5454
Interval 4: Accept accumulated attestations
@@ -106,7 +106,7 @@ let byte: u8 = code.into();
106106
### Ownership for Large Structures
107107
```rust
108108
// Prefer taking ownership to avoid cloning large data (signatures ~3KB)
109-
pub fn insert_signed_block(&mut self, root: H256, signed_block: SignedBlockWithAttestation) { ... }
109+
pub fn insert_signed_block(&mut self, root: H256, signed_block: SignedBlock) { ... }
110110

111111
// Add .clone() at call site if needed - makes cost explicit
112112
store.insert_signed_block(block_root, signed_block.clone());
@@ -310,8 +310,8 @@ Both servers are spawned as independent `tokio::spawn` tasks from `main.rs`. Bin
310310
```yaml
311311
GENESIS_TIME: 1770407233
312312
GENESIS_VALIDATORS:
313-
- "cd323f232b34ab26d6db7402c886e74ca81cfd3a..." # 52-byte XMSS pubkeys (hex)
314-
- "b7b0f72e24801b02bda64073cb4de6699a416b37..."
313+
- attestation_pubkey: "cd323f232b34ab26d6db7402c886e74ca81cfd3a..." # 52-byte XMSS pubkeys (hex)
314+
proposal_pubkey: "b7b0f72e24801b02bda64073cb4de6699a416b37..."
315315
```
316316
- Validator indices are assigned sequentially (0, 1, 2, ...) based on array order
317317
- All genesis state fields (checkpoints, justified_slots, etc.) initialize to zero/empty defaults
@@ -338,10 +338,9 @@ cargo test -p ethlambda-blockchain --test forkchoice_spectests -- --test-threads
338338
## Common Gotchas
339339

340340
### Aggregator Flag Required for Finalization
341-
- At least one node **must** be started with `--is-aggregator` to finalize blocks in production (without `skip-signature-verification`)
341+
- At least one node **must** be started with `--is-aggregator` to finalize blocks
342342
- Without this flag, attestations pass signature verification and are logged as "Attestation processed", but the signature is never stored for aggregation (`store.rs:368`), so blocks are always built with `attestation_count=0`
343343
- The attestation pipeline: gossip → verify signature → store gossip signature (only if `is_aggregator`) → aggregate at interval 2 → promote to known → pack into blocks
344-
- With `skip-signature-verification` (tests only), attestations bypass aggregation and go directly to `new_aggregated_payloads`, so the flag is not needed
345344
- **Symptom**: `justified_slot=0` and `finalized_slot=0` indefinitely despite healthy block production and attestation gossip
346345

347346
### Signature Verification
@@ -363,7 +362,7 @@ cargo test -p ethlambda-blockchain --test forkchoice_spectests -- --test-threads
363362
|-------|-------------|---------|
364363
| `BlockHeaders` | H256 → BlockHeader | Block headers by root |
365364
| `BlockBodies` | H256 → BlockBody | Block bodies (empty for genesis) |
366-
| `BlockSignatures` | H256 → BlockSignaturesWithAttestation | Signatures (absent for genesis) |
365+
| `BlockSignatures` | H256 → BlockSignatures | Signatures (absent for genesis) |
367366
| `States` | H256 → State | Beacon states by root |
368367
| `LatestKnownAttestations` | u64 → AttestationData | Fork-choice-active attestations |
369368
| `LatestNewAttestations` | u64 → AttestationData | Pending (pre-promotion) attestations |

0 commit comments

Comments
 (0)