Skip to content

fix: Add Scroll and zkSync chain adapters#9

Open
ledgerpilot wants to merge 6 commits intokcolbchain:mainfrom
ledgerpilot:ledgerpilot/fix-6
Open

fix: Add Scroll and zkSync chain adapters#9
ledgerpilot wants to merge 6 commits intokcolbchain:mainfrom
ledgerpilot:ledgerpilot/fix-6

Conversation

@ledgerpilot
Copy link
Copy Markdown
Contributor

Closes #6

What changed

The Scroll adapter appears to be fully integrated already, so this fix focuses on adding the zkSync Era chain adapter and updating relevant configurations.

Files modified

  • src/chains/zksync.ts
  • src/types.ts
  • src/oracle.ts
  • src/cli.ts
  • README.md
  • package.json

Draft PR — please review before merging.

@ledgerpilot ledgerpilot marked this pull request as ready for review April 9, 2026 05:40
@abhicris
Copy link
Copy Markdown
Contributor

This PR has merge conflicts after recent merges to main. Could you rebase against main and resolve the conflicts? The changes look good and we'd like to merge once conflicts are resolved. Thanks!

@abhicris
Copy link
Copy Markdown
Contributor

Thanks — direction is right, want to land this. Two things before merge:

  1. Rebase needed. The PR is based on commit 01b8b0f, but main has since landed the ;-style change in src/types.ts and already includes the scroll adapter wiring, so GitHub is showing this as CONFLICTING. Please git rebase origin/main — once that's done the diff should collapse to just src/chains/zksync.ts plus the one-line additions to adapters, ChainName, the CLI chain list, and VALID_CHAINS.
  2. L1 cost formula in src/chains/zksync.ts. The current approximation is:
    const typicalDataUnits = 1000n
    const l1Component = (blobBaseFee * typicalDataUnits) / 16n
    This baked-in 1000 bytes + /16 doesn't reflect how zkSync Era's L1 data fee actually works. Era charges per pubdata byte, and the pubdata price is gas_per_pubdata_byte_limit * L1 gas price (not blob base fee). For a first pass I'd suggest mirroring what src/chains/scroll.ts does — keep the signature honest about being an approximation and comment the assumption, rather than hard-coding 1000 bytes.

A matching adjustment in the comment ("approximating pubdata cost" rather than "using blobBaseFee as a proxy for overall L1 data expense") would also help the next reader.

Happy to merge once rebased + the formula note is addressed. Don't need a full rewrite — a one-liner that points at the right cost input is fine.

kcolbchain / Abhishek Krishna

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.

Add Scroll and zkSync chain adapters

2 participants