Skip to content

Conversation

0x1NotMe
Copy link
Contributor

@0x1NotMe 0x1NotMe commented Aug 25, 2025

Summary

  • Implements Consolidate chain-specific deployment parameters #502 by consolidating all chain-specific deployment parameters into a single source of truth
  • Introduces ChainConfig library to manage chain parameters centrally
  • Adds automatic L2 Gas Calculator deployment for L2 chains

Changes

New ChainConfig Library

  • Created src/contracts/libraries/ChainConfig.sol as the central repository for chain parameters
  • Stores escrow duration, L2 gas calculator addresses, and surcharge rates per chain
  • Provides helper functions for chain identification and L2 requirements

Deployment Script Updates

  • Modified deploy-atlas.s.sol to use ChainConfig and auto-deploy L2 Gas Calculator when needed
  • Updated deploy-base.s.sol to fetch parameters from ChainConfig
  • Renamed deploy-gas-calculator-base.s.sol to deploy-gas-calculator-op-stack.s.sol for broader OP Stack support
  • Updated deploy-gas-calculator-arbitrum.s.sol to properly deploy ArbitrumGasCalculator
  • Removed obsolete deploy-atlas-hyperliquid.s.sol (unified deployment now handles all chains)

L2 Gas Calculator Auto-Deployment

  • Automatically deploys appropriate gas calculator for L2 chains:
    • ArbitrumGasCalculator for Arbitrum chains
    • BaseGasCalculator for OP Stack chains (Base, Optimism, Unichain)

Documentation

  • Added comprehensive docs/CHAIN_CONFIG.md documenting the new system
  • Includes chain parameters, L2 requirements, and deployment instructions

Supported Chains

  • Mainnet: Ethereum, Polygon, BSC, Base, Optimism, Arbitrum, Hyperliquid, Unichain, Berachain
  • Testnet: Sepolia, Amoy, BSC Testnet, Base Sepolia, Optimism Sepolia, Arbitrum Sepolia, Hyperliquid Testnet, Unichain Sepolia, Berachain Bartio

Testing

  • Successfully tested deployment simulation on Base without broadcasting
  • Successfully tested deployment simulation on Arbitrum without broadcasting
  • All chain configurations verified

@0x1NotMe 0x1NotMe force-pushed the consolidate-chain-params branch from cd96c07 to 64e6875 Compare August 25, 2025 06:58
- Add ChainConfig library as single source of truth for chain parameters
- Remove hardcoded values from deployment scripts
- Support automatic L2 Gas Calculator deployment for OP Stack chains
- Add comprehensive documentation for chain configuration system
- Redirect Arbitrum deployments to dedicated branches
- Rename gas calculator script to reflect OP Stack support

Implements #502
@0x1NotMe 0x1NotMe force-pushed the consolidate-chain-params branch from 64e6875 to 1dd3668 Compare August 25, 2025 06:59
Copy link
Contributor

@BenSparksCode BenSparksCode left a comment

Choose a reason for hiding this comment

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

General direction with the lib looks good. But we definitely need to support Arbitrum natively in Atlas v1.6.2, and should not direct anyone to v1.7-exp because its not ready yet (and unclear if we'll finalize those changes or drop them)

- Add native support for Arbitrum mainnet (42161) and Sepolia (421614)
- Remove references to v1.7-exp branch (not ready for use)
- Update deploy-gas-calculator-arbitrum.s.sol to properly deploy ArbitrumGasCalculator
- Update deploy-atlas.s.sol to handle both OP Stack and Arbitrum gas calculators
- Update requiresL2GasCalculator to include Arbitrum chains
- Update documentation to reflect native Arbitrum support

Addresses review feedback
@0x1NotMe 0x1NotMe force-pushed the consolidate-chain-params branch from eb37e4c to 1b00ba7 Compare August 26, 2025 02:12
@0x1NotMe 0x1NotMe requested a review from BenSparksCode August 26, 2025 02:14
- Ethereum: Reduced escrow from 768s to 120s (10 blocks × 12s)
- Berachain: Updated block time from 5s to 2s (15 blocks × 2s = 30s)
- Hyperliquid: Kept at 1s block time (30 blocks × 1s = 30s)
- OP Stack (Optimism/Base): Updated to 200ms flashblocks (150 blocks × 200ms = 30s)
- Unichain: Kept at 1s block time as confirmed (30 blocks × 1s = 30s)

All escrow durations now target ~30 seconds consistently
@0x1NotMe 0x1NotMe force-pushed the consolidate-chain-params branch 2 times, most recently from 55a181b to 57a5ce3 Compare August 26, 2025 10:47
@0x1NotMe 0x1NotMe requested a review from BenSparksCode August 27, 2025 01:19
@BenSparksCode
Copy link
Contributor

Hyperliquid info is still wrong. I'm pretty sure its not 1s blocks

} else if (chainId == 999) {
// Hyperliquid
return ChainParameters({
escrowDuration: 30, // ~1 second * 30 blocks = 30 seconds
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be larger. See how fast blocks are added here: https://app.hyperliquid.xyz/explorer definitely not 1s

Copy link
Contributor

@BenSparksCode BenSparksCode left a comment

Choose a reason for hiding this comment

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

I think its just the Hyperliquid info that needs to change. Otherwise lgtm

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.

2 participants