LogoLogo
WebsiteTwitterGitHub
  • Introduction
    • Bridge
  • Wallets
    • fWallet
    • Rabby
    • MetaMask
    • Coinbase Wallet
    • Ledger
  • Staking
    • Overview
    • Stake FTM
    • Liquid Staking
    • Governance
  • Build on Opera
    • Overview
    • Tutorials
      • Deploy Contract
      • Verify Contract
      • Unit Test Contract
      • Create Fixed-Cap Asset
      • Create Variable-Cap Asset
      • Proxy Pattern
      • Diamond Proxy Pattern
    • Oracles
      • Chainlink
      • Band Protocol
      • API3
    • API
      • Public Endpoints
      • Transaction Tracing
      • Web3 API
      • GraphQL
        • Getting Started
        • Installation
        • Schema Basics
        • Schema Structure
        • Implementation Details
    • Providers
      • Contracts
        • Chainstack
        • thirdweb
        • GetBlock
      • API
        • The Graph
        • Covalent
        • Moralis
  • Funding
    • Gas Monetization
  • Run a Node
    • Overview
    • Node Providers
    • Mainnet
      • Run Validator Node
      • Run API Node
    • Testnet
      • Run Validator Node
      • Run Read-Only Node
    • Troubleshooting
    • FAQ
  • Technology
    • Overview
    • Consensus
    • Database Storage
    • Proof of Stake
    • Transaction Fees
    • Stablecoin
    • FAQ
  • Security
    • Contract Library
    • Fantom Safe
Powered by GitBook

© 2024 Fantom Foundation

On this page
Export as PDF
  1. Technology

Database Storage

PreviousConsensusNextProof of Stake

Opera uses database storage to store its world state, which includes account information, virtual machine bytecode, smart contract storage, etc. This database has a feature called live pruning, which removes historical data automatically, reducing storage needs for validators as the blockchain grows.

Previously, pruning required validator nodes to go offline, risking financial and operational issues for them. Now, validators can use live pruning without going offline, ensuring continuous operation and saving on disk space and costs by discarding historical data in real-time.

Live pruning works by splitting the database into two types: LiveDB and ArchiveDB. The LiveDB contains the world state of the current block only, whereas the ArchiveDB contains the world states of all historical blocks. Validators use only LiveDB, while archive nodes have both LiveDB and ArchiveDB to handle historical data requests through the RPC interface.

Opera's database storage uses efficient tree-like or hierarchical structures, which simplifies data retrieval. Importantly, it still provides cryptographic signatures for a world state and archive capabilities using an incremental version of a prefix algorithm. Additionally, it utilizes a native disk format instead of storing the world state indirectly through key-value stores like LevelDB or PebbleDB.