Skip to content

[DO-NOT-MERGE] chore: fixing flakey tests#20935

Open
danielntmd wants to merge 18 commits intonextfrom
danielntmd/fix-flakey-tests
Open

[DO-NOT-MERGE] chore: fixing flakey tests#20935
danielntmd wants to merge 18 commits intonextfrom
danielntmd/fix-flakey-tests

Conversation

@danielntmd
Copy link
Contributor

Trying to recreate failing tests...

spypsy and others added 18 commits February 26, 2026 14:26
This PR introduces additional block/checkpoint proposal validation to
ensure `SEQ_MAX_TX_PER_BLOCK` is not breached. Also adds additional
tests for existing validation criteria.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
## Summary
- Reject `rollbackTo` calls targeting a block that is not the last block
of its checkpoint, since rollback operates at checkpoint granularity.
The error message indicates the nearest valid checkpoint boundaries so
the caller can retry with a correct target.
- Fix proven checkpoint number to roll back to the target checkpoint
instead of resetting to zero.

Fixes A-552

## Test plan
- Unit tests added in `archiver-store.test.ts` covering:
  - Rejection of non-boundary blocks with correct error message
- Successful rollback to checkpoint boundary with sync point
verification
  - Proven checkpoint rollback when target is before proven block
  - Proven checkpoint preservation when target is after proven block
- e2e test `e2e_epochs/manual_rollback` passes

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

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Ref: A-493
- Split `peerCount` metric into total connections and healthy
connections
- Fixed memory leak in peer manager: `peerConnectedAt` map entries are
now deleted after recording connection duration
  - Fixed mined-delay tracking for `TxPoolV2`
  - Added attestation pool instrumentation
  - Renamed metrics/groups
  - Other zero metric fixes
BigInt() doesn't accept scientific notation strings like "1e+23" or
"2E+23". This caused a crash when starting a node with --network
testnet, as config values like 200000e18 get converted to "2e+23" by
the JSON pipeline.

Parse scientific notation losslessly using bigint arithmetic instead
of going through float64, preserving exact values.
## Summary

- Fixes `bigintConfigHelper` to handle scientific notation strings (e.g.
`1e+23`, `2E+23`) that `BigInt()` can't parse directly
- Uses lossless bigint arithmetic to parse scientific notation instead
of going through float64
- Fixes crash when starting a node with `--network testnet` where config
values like `200000e18` get converted to `2e+23` by JSON

## Context

The bug surfaces because `network-defaults.yml` values like `200000e18`
pass through `yq -o json | jq`, which converts them to float64
scientific notation (`2E+23`). At runtime, `BigInt("2e+23")` throws
`SyntaxError: Cannot convert 2e+23 to a BigInt`.

This fix makes the parsing layer resilient to scientific notation,
regardless of how the values arrive.

## Test plan

- Added unit tests covering: plain integers, scientific notation
(`1e+23`, `2E+23`, `1e23`, `5e18`), decimal mantissa (`1.5e10`), empty
string default, and error on non-integer results (`1e-3`)
- All 10 test cases verified passing

[ClaudeBox log](http://ci.aztec-labs.com/e312c3dcef56fc86-1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants