feat: merge-train/spartan#22526
Merged
Merged
Conversation
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>
Collaborator
Author
|
🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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