Skip to content

feat/consider eth erc20#15

Merged
NicoSerranoP merged 3 commits intomainfrom
feat/consider-eth-erc20
Feb 18, 2026
Merged

feat/consider eth erc20#15
NicoSerranoP merged 3 commits intomainfrom
feat/consider-eth-erc20

Conversation

@NicoSerranoP
Copy link
Copy Markdown
Member

@NicoSerranoP NicoSerranoP commented Feb 17, 2026

Two main features:

  1. Better tx selection guided by comments in Event selection improvements #11. It is worth pointing out that we still have a fragile tx selection (e.g. if a txs has wrap before the private transfer execution then it will be discarded. This is because txs with more than the minimal private transfer logs will have higher gas than the ones with the minimal logs. We will have better metrics if we compare txs with the same number of logs). Closes Event selection improvements #11

  2. native ETH should be the target for the benchmarks MVP and v1. Some projects (e.g. Railgun) do not support native ETH. I changed the constant names to allow for independent comparisons of native ETH and ERC20 transfers. Closes Consider ETH and ERC-20 shield/unshield/transfer #14

Copilot AI review requested due to automatic review settings February 17, 2026 07:20
@NicoSerranoP NicoSerranoP requested review from 0xmad and JohnGuilding and removed request for Copilot February 17, 2026 07:21
Copilot AI review requested due to automatic review settings February 17, 2026 07:22
@NicoSerranoP NicoSerranoP force-pushed the feat/consider-eth-erc20 branch from c3c317c to 4044f30 Compare February 17, 2026 07:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the gas-benchmarks adapters to (a) move transaction selection from “N logs” to “required events” matching, and (b) split benchmark method labels to distinguish native ETH vs ERC20 flows across protocols.

Changes:

  • Replace getTransactionsWithNEvents with getTransactionsWithEvents, passing explicit ABI event lists per protocol/method.
  • Update Tornado Cash, Privacy Pools, and Railgun benchmark adapters to use the new selection and to write metrics under *_eth / *_erc20 method keys.
  • Expand protocol constants from single-event ABIs/counts into ordered event ABI arrays with richer documentation links.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
gas-benchmarks/src/utils/rpc.ts Introduces event-list-based receipt filtering for transaction selection.
gas-benchmarks/src/tornado-cash/index.ts Switches Tornado adapter to event-list selection and renames output method keys to *_eth.
gas-benchmarks/src/tornado-cash/constants.ts Replaces single-event/count constants with SHIELD_ETH_EVENTS / UNSHIELD_ETH_EVENTS arrays and adds references.
gas-benchmarks/src/railgun/index.ts Switches Railgun adapter to event-list selection and renames output method keys to *_erc20.
gas-benchmarks/src/railgun/constants.ts Replaces ABIs/count constants with ERC20-focused event arrays and notes Railgun’s lack of native ETH support.
gas-benchmarks/src/privacy-pools/index.ts Switches Privacy Pools adapter to event-list selection and renames output method keys to *_eth.
gas-benchmarks/src/privacy-pools/constants.ts Replaces ABIs/count constants with SHIELD_ETH_EVENTS / UNSHIELD_ETH_EVENTS arrays and adds references.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gas-benchmarks/src/privacy-pools/constants.ts
Comment thread gas-benchmarks/src/utils/rpc.ts
Comment thread gas-benchmarks/src/utils/rpc.ts Outdated
Comment thread gas-benchmarks/src/tornado-cash/index.ts
Comment thread gas-benchmarks/src/railgun/index.ts
Comment thread gas-benchmarks/src/privacy-pools/index.ts
Comment thread gas-benchmarks/src/railgun/constants.ts
Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 17, 2026

@NicoSerranoP I've opened a new pull request, #16, to work on those changes. Once the pull request is ready, I'll request review from you.

@NicoSerranoP NicoSerranoP changed the title Feat/consider eth erc20 feat/consider eth erc20 Feb 17, 2026
Comment thread gas-benchmarks/src/privacy-pools/index.ts
Comment thread gas-benchmarks/src/railgun/index.ts
Copy link
Copy Markdown
Contributor

@JohnGuilding JohnGuilding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvements. I'm thinking of adding some additional changes for #11, so will mark it as complete, but might make some more changes later once this is in.

native ETH should be the target for the benchmarks MVP and v1

So yeah, initial MVP could be ETH transfers by default, then ERC20 token transfers as replacement. Then in the dashboard we could show both separately as they would have different gas costs. If we find out that many protocols don't support native token transfers, then maybe we can reassess.

Comment thread gas-benchmarks/src/privacy-pools/index.ts
* Initial plan

* Optimize encodeEventTopics by precomputing event topics

Co-authored-by: NicoSerranoP <38594836+NicoSerranoP@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NicoSerranoP <38594836+NicoSerranoP@users.noreply.github.com>
@NicoSerranoP NicoSerranoP force-pushed the feat/consider-eth-erc20 branch from 5ae1f7a to 3c42f68 Compare February 18, 2026 18:43
@NicoSerranoP NicoSerranoP merged commit 5aef8a2 into main Feb 18, 2026
1 check passed
@NicoSerranoP NicoSerranoP deleted the feat/consider-eth-erc20 branch February 18, 2026 18:57
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.

Consider ETH and ERC-20 shield/unshield/transfer Event selection improvements

4 participants