Overview
TheAcrossConfigStore contract serves as a centralized configuration management system for the Across Protocol. It provides a simple key-value store where protocol administrators can store and update configuration settings that are consumed by off-chain bots and agents.
Location: contracts/AcrossConfigStore.sol
Purpose
Unlike configuration contracts that validate parameters or enforce on-chain logic, AcrossConfigStore is specifically designed for off-chain consumption:- Stores token-specific configuration (e.g., rate models, transfer thresholds)
- Maintains global protocol parameters (e.g., max leaf sizes for merkle trees)
- Provides a transparent, on-chain source of truth for off-chain agents
- Does not perform validation on stored values
Key Features
Two-Tier Configuration
- Token-Specific Config: Parameters associated with individual L1 tokens
- Global Config: Protocol-wide parameters accessible by all agents
Event Emission
All configuration updates emit events, allowing off-chain agents to efficiently track changes without polling storage.Contract Structure
Core Functions
updateTokenConfig
Updates configuration for a specific L1 token.l1Token: The L1 token address to configurevalue: JSON string containing token-specific parameters
- Setting rate models for LP fee calculations
- Configuring token transfer thresholds for pool rebalancing
- Defining token-specific relay parameters
updateGlobalConfig
Updates global protocol configuration.key: Unique identifier for the configuration parametervalue: JSON string containing the configuration value
MAX_POOL_REBALANCE_LEAF_SIZE: Maximum number of entries in pool rebalance merkle treesMAX_RELAYER_REPAYMENT_LEAF_SIZE: Maximum number of entries in relayer refund merkle trees- Protocol-wide timing parameters and thresholds
Configuration Format
Configuration values are stored as JSON-encoded strings, providing flexibility for complex parameter structures:Off-Chain Integration
Off-chain agents (data workers, relayers) interact with AcrossConfigStore by:- Initial Load: Reading current configuration on startup
- Event Monitoring: Listening for
UpdatedTokenConfigandUpdatedGlobalConfigevents - Parameter Parsing: Decoding JSON strings into usable data structures
- Periodic Refresh: Optionally polling for missed updates
Governance Integration
AcrossConfigStore is owned by the Across Protocol governance system. Configuration updates follow the standard governance proposal and execution flow:- Proposal submitted to governance
- Token holders vote on changes
- Approved proposals execute
updateTokenConfigorupdateGlobalConfig - Events emitted notify off-chain agents of changes
Security Considerations
No On-Chain Validation
The contract intentionally does not validate configuration values. This design choice:- Provides maximum flexibility for off-chain parameter tuning
- Reduces gas costs for updates
- Places responsibility on governance to ensure correct values
Access Control
All write functions are protected byonlyOwner modifier, ensuring only governance can modify configuration.
MultiCaller Support
Inherits from MultiCaller, allowing batched configuration updates in a single transaction for gas efficiency.Related Contracts
- HubPool: Consumes configuration for bundle execution parameters
- SpokePool: Off-chain agents use config to determine proper fill behavior
- Chain Adapters: May reference config for bridge-specific parameters