{"id":20433893,"url":"https://github.com/flashbots/reorg-monitor","last_synced_at":"2026-01-31T15:01:07.236Z","repository":{"id":176391946,"uuid":"408862988","full_name":"flashbots/reorg-monitor","owner":"flashbots","description":"Ethereum Reorg Monitoring","archived":false,"fork":false,"pushed_at":"2023-09-07T18:38:28.000Z","size":228,"stargazers_count":51,"open_issues_count":1,"forks_count":2,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-04-12T21:11:23.517Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flashbots.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-21T14:56:31.000Z","updated_at":"2025-02-25T13:27:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"900e9943-ca87-4c78-84e9-71ca3787e1c7","html_url":"https://github.com/flashbots/reorg-monitor","commit_stats":null,"previous_names":["flashbots/reorg-monitor"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/flashbots/reorg-monitor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Freorg-monitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Freorg-monitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Freorg-monitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Freorg-monitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flashbots","download_url":"https://codeload.github.com/flashbots/reorg-monitor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Freorg-monitor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28946049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T14:26:55.697Z","status":"ssl_error","status_checked_at":"2026-01-31T14:26:52.545Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T08:22:11.669Z","updated_at":"2026-01-31T15:01:07.221Z","avatar_url":"https://github.com/flashbots.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ethereum Reorg Monitor\n\n[![Goreport status](https://goreportcard.com/badge/github.com/flashbots/reorg-monitor)](https://goreportcard.com/report/github.com/flashbots/reorg-monitor)\n[![Test status](https://github.com/flashbots/reorg-monitor/workflows/Checks/badge.svg)](https://github.com/flashbots/reorg-monitor/actions?query=workflow%3A%22Checks%22)\n\nWatch and document Ethereum reorgs, including miner values of blocks.\n\n* Subscribe to multiple Ethereum nodes for new blocks (via WebSocket or IPC connection)\n* Capture block value (gas fees and smart contract payments) by simulating blocks with [mev-geth](https://github.com/flashbots/mev-geth/)\n* Collect data in a Postgres database (summary and individual block info)\n* Webserver that shows status information and recent reorgs\n\nThis project is work in progress and there may be bugs, although it works pretty stable now.\nPlease open issues if you have ideas, questions or want to contribute :)\n\n---\n\n\u003c!-- TOC --\u003e\n* [Ethereum Reorg Monitor](#ethereum-reorg-monitor)\n  * [Getting started](#getting-started)\n  * [Codebase Overview \u0026 Architecture](#codebase-overview--architecture)\n  * [Notes \u0026 References](#notes--references)\n  * [Maintainers](#maintainers)\n  * [Security](#security)\n\u003c!-- TOC --\u003e\n\n## Getting started\n\n* Clone this repository\n* For database testing, you can use `docker-compose up` to start a local Postgres database and adminer\n* See [`.env.example`](https://github.com/flashbots/reorg-monitor/blob/master/.env.example) for environment variables you can use (eg create `.env.local` and use them with `source .env.local`).\n* Start the monitor:\n\n\n```bash\n# Normal run, print only\n$ go run cmd/reorg-monitor/main.go --ethereum-jsonrpc-uris ws://geth_node:8546\n\n# Simulate blocks in a reorg - note: this requires passing in one or more RPC endpoints that support eth_callBundle API\n# The Flashbots RPC endpoints can be used to simulate blocks, for additional details see: https://docs.flashbots.net/flashbots-auction/searchers/advanced/rpc-endpoint#bundle-relay-urls\n$ go run cmd/reorg-monitor/main.go --simulate-blocks --mev-geth-uri https://relay.flashbots.net --ethereum-jsonrpc-uris ws://geth_node:8546\n\n# Save to database\n$ go run cmd/reorg-monitor/main.go --simulate-blocks --mev-geth-uri https://relay.flashbots.net --postgres-dsn ${POSTGRES_DSN_HERE} --ethereum-jsonrpc-uris ws://geth_node:8546\n\n# Get status from webserver\n$ curl localhost:9094\n```\n\nYou can also install the reorg monitor with `go install`:\n\n```bash\n$ go install github.com/flashbots/reorg-monitor/cmd/reorg-monitor@latest\n$ reorg-monitor -h\n```\n\n---\n\n## Codebase Overview \u0026 Architecture\n\nSee also: [Story of an Ethereum Reorg](https://docs.google.com/presentation/d/1ZHJp2HFOFeZxQAyPETRvcXW0oSOkZHAUhm7G-MoYyoQ/edit?usp=sharing)\n\nCode layout:\n\n* [`cmd/reorg-monitor`](https://github.com/flashbots/reorg-monitor/blob/master/cmd/reorg-monitor/main.go) is the main command-line entrypoint\n* [`cmd/reorg-monitor-test`](https://github.com/flashbots/reorg-monitor/blob/master/cmd/reorg-monitor-test/main.go) is used for local testing and development\n* [`monitor` module](https://github.com/flashbots/reorg-monitor/tree/master/monitor) - block collection: subscription to geth nodes, building a history of as many blocks as possible\n* [`analysis` module](https://github.com/flashbots/reorg-monitor/tree/master/analysis) - detect reorgs by building a tree data structure of all known blocks (blocks with \u003e1 child start a reorg)\n\n---\n\n## Notes \u0026 References\n\n* [https://beaconscan.com/slots-forked](beaconscan.com/slots-forked)\n* [etherscan.io/blocks_forked](https://etherscan.io/blocks_forked)\n* [etherscan.io/chart/uncles](https://etherscan.io/chart/uncles)\n* [Story of an Ethereum Reorg](https://docs.google.com/presentation/d/1ZHJp2HFOFeZxQAyPETRvcXW0oSOkZHAUhm7G-MoYyoQ/edit?usp=sharing)\n* [go-ethereum `WriteBlock` function](https://github.com/ethereum/go-ethereum/blob/525116dbff916825463931361f75e75e955c12e2/core/blockchain.go#L860), which calls the `reorg` method if a block is seen of which the parent is not the current block\n* [Ethereum Whitepaper: Modified GHOST Implementation](https://ethereum.org/en/whitepaper/#modified-ghost-implementation)\n* [Ethereum Yellow Paper](https://ethereum.github.io/yellowpaper/paper.pdf)\n* [Ghost whitepaper](https://eprint.iacr.org/2013/881.pdf)\n* For Ethereum 2.0: [Combining Ghost and Casper](https://arxiv.org/abs/2003.03052)\n\nSee also:\n\n* [An Empirical Analysis of Chain Reorganizations and Double-Spend Attacks on Proof-of-Work Cryptocurrencies](https://static1.squarespace.com/static/59aae5e9a803bb10bedeb03e/t/5f08d13a1cd5592cb330a0d0/1594413374526/LovejoyJamesP-meng-eecs-2020.pdf) (pdf)\n\nTools:\n\n* https://composer.alchemyapi.io - to find out more about non-mainchain blocks ([`eth_getBlockByHash`](https://composer.alchemyapi.io/?composer_state=%7B%22chain%22%3A0%2C%22network%22%3A0%2C%22methodName%22%3A%22eth_getBlockByHash%22%2C%22paramValues%22%3A%5B%22YOUR_BLOCK_HASH_HERE%22%2Ctrue%5D%7D))\n* https://mermaid-js.github.io/mermaid-live-editor\n\n## Maintainers\n\nThis project is currently maintained by:\n\n* [@metachris](https://twitter.com/metachris)\n* [@wazzymandias](https://twitter.com/wazzymandias)\n\n## Security\n\nIf you find a security vulnerability on this project or any other initiative related to Flashbots, please let us know sending an email to security@flashbots.net.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Freorg-monitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflashbots%2Freorg-monitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Freorg-monitor/lists"}