Skip to content

chore: (A-815) fix l1 tx utils fallback id logic#22187

Merged
PhilWindle merged 1 commit intomerge-train/spartanfrom
danielntmd/l1-utils-id-fallback
Mar 31, 2026
Merged

chore: (A-815) fix l1 tx utils fallback id logic#22187
PhilWindle merged 1 commit intomerge-train/spartanfrom
danielntmd/l1-utils-id-fallback

Conversation

@danielntmd
Copy link
Copy Markdown
Contributor

This is purely a correctness fix, no behavioral changes as the id is only used for store operations and when there is no store, this fallback is never hit.

Fallback logic previous:
If txs.map is empty then this.txs.map(tx => tx.id) resolves to nothing and Math.max(0) resolves to 0.
Next iteration, this.txs.map(tx => tx.id) resolves to 0 and Math.max(0, 0) resolves to 0 again. Collision!

Fallback logic fixed:
If txs.map is empty then this.txs.map(tx => tx.id) resolves to empty and Math.max(-1) + 1 resolves to 0.
Next iteration, this.txs.map(tx => tx.id) resolves to 0 and Math.max(0, -1) + 1 resolves to 1, a unique id.

This is purely a correctness fix, no behavioral changes as the id is only used for store operations and when there is no store, this fallback is never hit.
@danielntmd danielntmd changed the title chore: fix l1 tx utils fallback id logic chore: (A-815) fix l1 tx utils fallback id logic Mar 31, 2026
@AztecBot
Copy link
Copy Markdown
Collaborator

Flakey Tests

🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/cb3a654de7b9dd62�cb3a654de7b9dd628;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_offchain_payment.test.ts (56s) (code: 0)

@PhilWindle PhilWindle merged commit 15a1e21 into merge-train/spartan Mar 31, 2026
14 checks passed
@PhilWindle PhilWindle deleted the danielntmd/l1-utils-id-fallback branch March 31, 2026 15:45
github-merge-queue Bot pushed a commit that referenced this pull request Apr 1, 2026
BEGIN_COMMIT_OVERRIDE
chore: (A-771) remove dead code, verify keypair (#22167)
fix(aes128): validate PKCS#7 padding in decryptBufferCBC (#22179)
chore: (A-815) fix l1 tx utils fallback id logic (#22187)
fix(archiver): always advance L1-to-L2 messages syncpoint to current L1
block (#22154)
chore: (A-832) fix defaultFetch double consuming response on JSON parse
failure (#22194)
fix: indefinite retry for prover node and agent broker communication
(#22202)
fix: remove unused createDispatchFn with no method allowlist (#22219)
chore: fix wallet setup to use NO_FROM instead of ZERO address (#22222)
fix: update aes128 bad-key test for PKCS#7 padding validation (#22190)
END_COMMIT_OVERRIDE
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.

3 participants