# Pessimism for better Optimism **Published by:** [Base Daily](https://paragraph.com/@baseecosystem/) **Published on:** 2023-09-21 **URL:** https://paragraph.com/@baseecosystem/pessimism-for-better-optimism ## Content Key takeawaysPessimism is an open-source monitoring system created by Coinbase to enhance security for the OP Stack and EVM-compatible chains, addressing protocol threats on the Base mainnet.The system optimizes network performance and security by assessing response times, transaction processing speeds, and spotting security vulnerabilities.It operates through an ETL subsystem for data processing, a Risk Engine for threat assessing, and an alerting mechanismIntroductionPessimism is a monitoring systems built to support the security of all OP Stack and EVN-compatible chain by detecting and countering protocol threats. It have been created by Coinbase team internally to monitor Base since mainnet. At the time of writing, Base have open-sourced Pessimism, make it to be a free and permissionless software.Monitoring system and its importanceThe goal of monitoring is to ensure the network’s security and tracking fraud transaction. Monitoring is crucial on Base for the following reasons:Performance EvaluationNetwork’s performance is assessed by:Response times: The time between when we give the order and the time when the blockchain receive itTransaction processing speed: How low it take from receiving transaction order to executing itError rates: Fail transactions over total transactionsSecurityDentify and mitigate security threats and vulnerabilitiesDetecting unauthorized access attempts, unusual behavior, and potential breaches.How Pessimism Works?Subsystem WorkflowPessimism is structured around three main subsystems that monitor, assess and alert3 subsystems to operate PessimismETL (Monitor): The ETL standing for extract, transform and load. This subsystem is responsible for checking and transforming blockchain data into into formats that can be used by applications.Risk Engine (Assess): This subsystem examines heuristics using data from the ETL to determine potential alert scenarios.Alerting: Propagating alerts to downstream dependency systems (i.e. Slack, Pagerduty).REST API: Pessimism also enables users to create, delete, and modify monitoring heuristics.When an abnormal activity or event perceived as a security threat is detected, Pessimism alerts the team to swiftly address any potential risks.Pessimism Use casesOP StackWithdrawal Safety: Due to many critical exploits happened on bridges, withdrawal safety is the first use case were built on Opstack. It prevents potential exploit by determines whether a proven OP Stack bridge withdrawal on L1 has a corresponding initiation event on the L2 chain.Fraud Detection: The fault-detector acts as a verifier. When there's a shift of data from L2 to L1, represented by a unique code (output root), Pessimism double-checks its authenticity. It does this by making a similar code on its own and comparing them. This step is essential to make sure the data shift is genuine and the unique codes being provided are trustworthy.EVM CompatibleBalance Enforcement: The balance-enforcement heuristic checks that the ETH balance in an address is either above or below certain limits set by the user. This is vital for keeping an eye on important accounts (like proposer or batcher) in the OP Stack system to ensure they don't run out of funds.Smart contract events: The contract-event heuristics keeps an eye on activities related to smart contracts. It needs the address of the smart contract and specific event signatures to function. This is essential for identifying possible changes in access rights (like updating limits for a gnosis safe multisig) and unexpected actions by high-level users (like an OP Stack Guardian suddenly stopping the native bridge).PerformancePessimism boasts quick data processing times, with ETL processing in under 100 ms and overall processing in about 200 ms.Modularity and Testing: The OP Stack's modular design allows for thorough end-to-end testing of each heuristic implementation using the op-e2e testing framework.Alert Routing: Defines global alerting policies and supports Slack and PagerDuty as alert destinationsWhat’s Next?Comprehensive Bridge Coverage: Plans to monitor all potential threats and failures of the native bridge that facilitates L2 to Ethereum fund transfers.Emerging Threat Detections: As the OP Stack continues to upgrade, Pessimism will introduce new features to cover the evolving threat landscape.Community CallPessimism is community-driven and encourages users to submit feature requests and contribute to its development on GitHub. ## Publication Information - [Base Daily](https://paragraph.com/@baseecosystem/): Publication homepage - [All Posts](https://paragraph.com/@baseecosystem/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@baseecosystem): Subscribe to updates - [Twitter](https://twitter.com/BaseDailyMM): Follow on Twitter