fix: handle scientific notation in bigintConfigHelper#20929
Merged
ludamad merged 3 commits intomerge-train/spartanfrom Feb 27, 2026
Merged
fix: handle scientific notation in bigintConfigHelper#20929ludamad merged 3 commits intomerge-train/spartanfrom
ludamad merged 3 commits intomerge-train/spartanfrom
Conversation
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.
aminsammara
approved these changes
Feb 27, 2026
AztecBot
added a commit
that referenced
this pull request
Feb 27, 2026
## 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)
Collaborator
Author
|
✅ Successfully backported to backport-to-v4-staging #20923. |
AztecBot
added a commit
that referenced
this pull request
Feb 27, 2026
## 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)
ludamad
pushed a commit
that referenced
this pull request
Feb 27, 2026
BEGIN_COMMIT_OVERRIDE fix: handle scientific notation in bigintConfigHelper (#20929) END_COMMIT_OVERRIDE Co-authored-by: AztecBot <AztecBot@users.noreply.github.com>
ludamad
added a commit
that referenced
this pull request
Feb 27, 2026
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 3, 2026
BEGIN_COMMIT_OVERRIDE fix: track last seen nonce in case of stale fallback L1 RPC node (#20855) feat: Validate num txs in block proposals (#20850) fix(archiver): enforce checkpoint boundary on rollbackTo (#20908) fix: tps zero metrics (#20656) fix: handle scientific notation in bigintConfigHelper (#20929) feat(aztec): node enters standby mode on genesis root mismatch (#20938) fix: logging of class instances (#20807) feat(slasher): make slash grace period relative to rollup upgrade time (#20942) chore: add script to find PRs to backport (#20956) chore: remove unused prover-node dep (#20955) fix: increase minFeePadding in e2e_bot bridge resume tests and harden GasFees.mul() (#20962) feat(sequencer): (A-526) rotate publishers when send fails (#20888) chore: (A-554) bump reth version 1.6.0 -> 1.11.1 for eth devnet (#20889) chore: metric on how many epochs validator has been on committee (#20967) fix: set wallet minFeePadding in BotFactory constructor (#20992) chore: deflake epoch invalidate block test (#21001) chore(sequencer): e2e tests for invalid signature recovery in checkpoint attestations (#20971) chore: deflake duplicate proposals and attestations (#20990) chore: deflake epochs mbps test (#21003) feat: reenable function selectors in txPublicSetupAllowList (#20909) fix: limit offenses when voting in tally slashing mode by slashMaxPayloadSize (#20683) fix(spartan): wire SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT env var (#21017) END_COMMIT_OVERRIDE
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.
Summary
bigintConfigHelperto handle scientific notation strings (e.g.1e+23,2E+23) thatBigInt()can't parse directly--network testnetwhere config values like200000e18get converted to2e+23by JSONContext
The bug surfaces because
network-defaults.ymlvalues like200000e18pass throughyq -o json | jq, which converts them to float64 scientific notation (2E+23). At runtime,BigInt("2e+23")throwsSyntaxError: 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
1e+23,2E+23,1e23,5e18), decimal mantissa (1.5e10), empty string default, and error on non-integer results (1e-3)ClaudeBox log