Skip to content

feat: merge-train/spartan#22526

Merged
AztecBot merged 8 commits into
nextfrom
merge-train/spartan
Apr 15, 2026
Merged

feat: merge-train/spartan#22526
AztecBot merged 8 commits into
nextfrom
merge-train/spartan

Conversation

@AztecBot

@AztecBot AztecBot commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator

BEGIN_COMMIT_OVERRIDE
fix(p2p): replace non-null assertions on blockStream with explicit checks (#22499)
refactor: type-safe config (#22445)
fix: type-safe config parseEnv return types (#22530)
refactor: unify branding pattern across codebase (#22516)
END_COMMIT_OVERRIDE

AztecBot and others added 7 commits April 14, 2026 13:50
Ref: A-175

- Add type parameter to `ConfigMapping<T> `
- Replace `ConfigMappingsType<T> = Record<keyof T, ConfigMapping<any>>`
with a per-key mapped type: `{ [K in keyof T]-?:
ConfigMapping<Required<T>[K]> }`
- `parseEnv` must return T or throw — empty strings are treated as "not
set" before `parseEnv` is called
- Fix spread ordering bug in `sequencerClientConfigMappings` where
narrow `l1Contracts` from `chainConfigMappings` was overwriting the full
set from `l1ReaderConfigMappings`
## Summary
Fixes two TypeScript type errors introduced by PR #22445 (refactor:
type-safe config).

`ConfigMappingsType<T>` uses `Required<T>[K]` to derive the `parseEnv`
return type, so for optional `number` fields, `parseEnv` must return
`number` — not `number | undefined`. The `undefined` case for missing
env vars is already handled by the config framework before `parseEnv` is
called.

- `stdlib/src/config/sequencer-config.ts`:
`attestationPropagationTime.parseEnv` now returns `number` instead of
`number | undefined`
- `p2p/src/config.ts`: `l1PublishingTime.parseEnv` now returns `number`
instead of `number | undefined`

ClaudeBox log: https://claudebox.work/s/1b406eba6bceb29c?run=1
## Summary

- Unify branding pattern across codebase: `BlockHash`,
`BlockProposalHash`, `CheckpointProposalHash`,
`CheckpointAttestationHash`
- Strengthen `BlockHash` type: add `ZERO`, `fromBuffer`,
`GENESIS_BLOCK_HEADER_HASH` as `BlockHash`; change `setHash` to accept
`BlockHash` instead of `Fr`
- Change `LeafTypes[ARCHIVE]` and `LeafValueTypes[ARCHIVE]` from `Fr` to
`BlockHash` in merkle tree operations
- Replace `new BlockHash(Fr.fromBuffer/ZERO/random)` with static factory
methods throughout
- Add `Tag.random()` and `SiloedTag.random()` static factory methods
- Add `blockHashFromSingle` helper in txe encoding
- Import `GENESIS_BLOCK_HEADER_HASH` from `@aztec/stdlib/block` instead
of `@aztec/constants`
- Fix `BlockHash` serialization for native world state msgpack channel
(`SYNC_BLOCK` and `appendLeaves`)
- Remove dead `TypeRegistry.register` calls (resolver/reviver unused
outside own test)

## Test plan

- Build passes (`yarn build`)
- Lint passes (`yarn lint`)
- E2E tests pass (serialization fix for native world state channel
verified)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@ludamad ludamad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto-approved

@AztecBot AztecBot enabled auto-merge April 15, 2026 00:22
@AztecBot

Copy link
Copy Markdown
Collaborator Author

🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass.

@AztecBot AztecBot added this pull request to the merge queue Apr 15, 2026
Merged via the queue into next with commit c060777 Apr 15, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants