Skip to content

perf: pack supported chain identifiers into low-gas bitmap words - #866

Merged
mijinummi merged 3 commits into
MDTechLabs:mainfrom
Godfrey-Delight:perf/chain-bitmap-registry
Aug 1, 2026
Merged

perf: pack supported chain identifiers into low-gas bitmap words#866
mijinummi merged 3 commits into
MDTechLabs:mainfrom
Godfrey-Delight:perf/chain-bitmap-registry

Conversation

@Godfrey-Delight

Copy link
Copy Markdown
Contributor

Adds ChainBitmapRegistry.sol, packing chain support flags for chain IDs 0–255 into a single uint256 storage slot with Yul inline assembly for isChainSupported, setChainSupport, toggleChainSupport, areAllChainsSupported (multi-hop route mask validation), and setBatchChainSupport, plus a custom InvalidChainId revert for out-of-range chain IDs. Adds ChainBitmapRegistry.test.ts covering Yul instruction validation, boundary bit operations, out-of-bounds errors, multi-hop mask checks, and batch updates, with gas benchmarks showing an 80% SLOAD reduction on 5-chain lookups versus standard mapping.
Closes #843

Adds ChainBitmapRegistry.sol, packing chain support flags for chain IDs 0–255 into a single uint256 storage slot with Yul inline assembly for isChainSupported, setChainSupport, toggleChainSupport, areAllChainsSupported (multi-hop route mask validation), and setBatchChainSupport, plus a custom InvalidChainId revert for out-of-range chain IDs. Adds ChainBitmapRegistry.test.ts covering Yul instruction validation, boundary bit operations, out-of-bounds errors, multi-hop mask checks, and batch updates, with gas benchmarks showing an 80% SLOAD reduction on 5-chain lookups versus standard mapping.
Closes MDTechLabs#843
@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@Godfrey-Delight Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mijinummi

Copy link
Copy Markdown
Collaborator

Hi @Godfrey-Delight kindly resolve conflict

@mijinummi
mijinummi merged commit 70ffe80 into MDTechLabs:main Aug 1, 2026
1 check failed
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.

[PERF] Pack Supported Chain Identifiers into Low-Gas Bitmap Words

2 participants