feat(gas): add tornado cash unshield + railgun unshield + transfer#10
Merged
NicoSerranoP merged 1 commit intomainfrom Feb 16, 2026
Merged
feat(gas): add tornado cash unshield + railgun unshield + transfer#10NicoSerranoP merged 1 commit intomainfrom
NicoSerranoP merged 1 commit intomainfrom
Conversation
Member
NicoSerranoP
commented
Feb 13, 2026
- Added railgun unshield + transfer benchmarks
- Added tornado cash unshield (there is no internal transfer available)
- Added privacy pools unshield (there is no internal transfer available)
09c1d27 to
a55ac85
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends the gas benchmarking capabilities by adding unshield and transfer operation benchmarks for privacy-preserving protocols (Tornado Cash, Railgun, and Privacy Pools). The changes include a safeguard to prevent infinite RPC loops when insufficient historical events exist, and follow the established benchmarking patterns consistently across all three protocols.
Changes:
- Added
MAX_NUMBER_OF_RPC_TRIESconstant and retry limit logic ingetEventLogsto prevent infinite loops when insufficient events are available - Implemented
benchmarkUnshieldfor Tornado Cash, Railgun, and Privacy Pools protocols - Implemented
benchmarkTransferfor Railgun protocol (internal private transfers) - Added event ABIs and constants for unshield and transfer operations across all protocols
- Updated Tornado Cash Router documentation reference URL
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| gas-benchmarks/src/utils/rpc.ts | Added retry counter and MAX_NUMBER_OF_RPC_TRIES limit to prevent infinite RPC calls |
| gas-benchmarks/src/utils/constants.ts | Added MAX_NUMBER_OF_RPC_TRIES constant (set to 10) |
| gas-benchmarks/src/tornado-cash/index.ts | Added benchmarkUnshield method following established pattern |
| gas-benchmarks/src/tornado-cash/constants.ts | Added STAKE_BURNED_EVENT_ABI, TORNADO_CASH_RELAYER_REGISTRY, NUMBER_OF_UNSHIELD_EVENTS, and updated Router URL reference |
| gas-benchmarks/src/railgun/index.ts | Added benchmarkUnshield and benchmarkTransfer methods |
| gas-benchmarks/src/railgun/constants.ts | Added UNSHIELD_EVENT_ABI, NULLIFIED_EVENT_ABI, NUMBER_OF_UNSHIELD_EVENTS, and NUMBER_OF_TRANSFER_EVENTS |
| gas-benchmarks/src/privacy-pools/index.ts | Added benchmarkUnshield method |
| gas-benchmarks/src/privacy-pools/constants.ts | Added WITHDRAWAL_RELAYED_EVENT_ABI and NUMBER_OF_UNSHIELD_EVENTS |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
JohnGuilding
approved these changes
Feb 16, 2026
a55ac85 to
e01a056
Compare
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.