Skip to content

feat: Dynamic OP Stack L1 gas via gas API#6899

Merged
pedronfigueiredo merged 1 commit intomainfrom
pnf/expannd-op-stack-l1-gas-fees
Oct 28, 2025
Merged

feat: Dynamic OP Stack L1 gas via gas API#6899
pedronfigueiredo merged 1 commit intomainfrom
pnf/expannd-op-stack-l1-gas-fees

Conversation

@pedronfigueiredo
Copy link
Contributor

@pedronfigueiredo pedronfigueiredo commented Oct 20, 2025

Explanation

  • fetch the OP Stack supported chain list from the gas API with a static fallback so OptimismLayer1GasFeeFlow can react to remote updates
  • make OracleLayer1GasFeeFlow accept an optional default oracle and throw unless subclasses override getOracleAddressForChain, removing the now-unneeded constructor in the Optimism flow
  • allow Layer1GasFeeFlow.matchesTransaction to be async

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Dynamically detects OP Stack chains via gas API (with static fallback) and refactors the L1 oracle flow with default oracle/signing while making Layer1GasFeeFlow.matchesTransaction async.

  • Gas Flows:
    • OptimismLayer1GasFeeFlow: Fetches supported OP Stack chains from gas.api (/v1/supportedNetworks) with fallback to FALLBACK_OPTIMISM_STACK_CHAIN_IDS; uses base class default oracle; matchesTransaction is async.
    • OracleLayer1GasFeeFlow: Adds default OP Stack oracle address and hooks getOracleAddressForChain and shouldSignTransaction; updates signing to use Uint8Array.
    • ScrollLayer1GasFeeFlow: Overrides new hooks (oracle address, requires signing); matchesTransaction now async.
  • Types/Utils:
    • Layer1GasFeeFlow.matchesTransaction returns Promise<boolean>; update getTransactionLayer1GasFee flow selection to async.
  • Helpers:
    • GasFeePoller tests updated to pass messenger object and expect it in calls.
  • Tests:
    • Add/adjust tests for OP Stack remote list handling, default oracle config, Scroll overrides, and async matching.
  • Changelog:
    • Note change: Identify OP stack chains using gas API.

Written by Cursor Bugbot for commit cc31d4b. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/expannd-op-stack-l1-gas-fees branch 5 times, most recently from b0cf270 to 0e779d8 Compare October 21, 2025 10:47
@pedronfigueiredo pedronfigueiredo force-pushed the pnf/expannd-op-stack-l1-gas-fees branch 4 times, most recently from 7b8c594 to 044c238 Compare October 22, 2025 13:25
@pedronfigueiredo pedronfigueiredo changed the title feat: Dynamic OP Stack L1 gas via gas API + opBNB oracle override feat: Dynamic OP Stack L1 gas via gas API Oct 22, 2025
cursor[bot]

This comment was marked as outdated.

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/expannd-op-stack-l1-gas-fees branch 2 times, most recently from a1e8eea to ba1363d Compare October 24, 2025 16:18
cursor[bot]

This comment was marked as outdated.

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/expannd-op-stack-l1-gas-fees branch 5 times, most recently from 3a3cf8a to 0a8b97b Compare October 28, 2025 11:20
matthewwalsh0
matthewwalsh0 previously approved these changes Oct 28, 2025

matchesTransaction({
protected override shouldSignTransaction(): boolean {
return true;
Copy link
Member

Choose a reason for hiding this comment

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

❤️

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/expannd-op-stack-l1-gas-fees branch from 1c59fbe to cc31d4b Compare October 28, 2025 14:47
@pedronfigueiredo pedronfigueiredo enabled auto-merge (squash) October 28, 2025 15:01
@pedronfigueiredo pedronfigueiredo merged commit fb383d5 into main Oct 28, 2025
255 checks passed
@pedronfigueiredo pedronfigueiredo deleted the pnf/expannd-op-stack-l1-gas-fees branch October 28, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants