Ethanos is Over Protocol’s innovative solution for state management, designed to mitigate the challenges of state bloat in traditional blockchains. By adopting a layered architecture, Ethanos categorizes blockchain data into different states—active, staged, and dormant—ensuring efficient data management and improved network performance.
Active and Staged States
Active states represent current, frequently accessed data, while staged states hold recently used data awaiting transition. This organization helps reduce memory overhead for validators and simplifies storage.
// Example pseudo-code for state transitions
if (epoch > inactiveEpochThreshold) {
state = State.INACTIVE;
moveToNetherLayer(state);
}
Handling Dormant Accounts
Dormant accounts, which haven't been accessed for several epochs, are moved to a secondary layer (Nether Layer). This reduces the main state’s size and optimizes resource usage.
// Tracking epochs for state transitions
struct Account {
bytes32 accountHash;
uint lastActiveEpoch;
}
mapping(address => Account) accounts;
function transitionState(address _addr) internal {
if (currentEpoch - accounts[_addr].lastActiveEpoch > epochThreshold) {
accounts[_addr].state = State.DORMANT;
}
}
Restoration Mechanism
Restoring dormant accounts requires verifying the last active epoch and validating Merkle proofs. This ensures that state reactivation is secure and only legitimate accounts can be restored.
function restoreAccount(address _addr, bytes32 proof) external {
require(verifyMerkleProof(_addr, proof), "Invalid proof");
accounts[_addr].state = State.ACTIVE;
accounts[_addr].lastActiveEpoch = currentEpoch;
}
Ethanos is a groundbreaking approach to blockchain state management, aligning Over Protocol with long-term decentralization and scalability goals. For more technical details, visit the Ethanos Documentation.