Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion .github/workflows/sanitycheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ on:
permissions:
contents: read

# Runs on a branch go one at a time, so an older run on main never deploys over a newer one.
# A newer push to a pull request cancels its superseded run.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
sanity-check:
runs-on: ubuntu-latest
Expand All @@ -29,13 +35,14 @@ jobs:
path: .cache/prevouts
key: prevouts-v2-${{ hashFiles('blocks/*.bin', 'proofs/*.json') }}
restore-keys: prevouts-v2-
- name: validate data and test validator
- name: validate data, test validator and generate website
run: |
python -m venv .venv
. .venv/bin/activate
python -m pip install -r requirements.txt
python ci/sanity-check.py --fetch-prevouts
python -m unittest discover -s ci -p 'test_*.py'
python ci/generate-website.py
# Save once per block set, after validation and tests pass on the default branch.
- name: save verified previous transactions
if: >-
Expand All @@ -46,3 +53,23 @@ jobs:
with:
path: .cache/prevouts
key: ${{ steps.prevouts-cache.outputs.cache-primary-key }}
# Every validated run uploads the site; only the deploy job publishes it.
- name: upload website
uses: actions/upload-pages-artifact@v5
with:
path: site

deploy-website:
needs: sanity-check
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- id: deployment
uses: actions/deploy-pages@v5
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.venv/
__pycache__/
.cache/prevouts/
site/
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ This dataset covers blocks that fail those rules, including failures that can be

Merge-mined recoveries generally provide a header and coinbase rather than a full Bitcoin block.

## Website

[bitcoin-data.github.io/invalid-blocks](https://bitcoin-data.github.io/invalid-blocks/) is generated from this repository and deployed once validation passes on `main`.
It has a page for each block at `block/{hash}/`, the rendered [notes](docs/notes.md) and the reported blocks.
`python ci/generate-website.py` writes it to `site/`; CI runs the same command on pull requests, so a change that breaks the site fails before merge.

## Contributing

Add one record to [`data/invalid-blocks.jsonl`](data/invalid-blocks.jsonl), sorted by height then hash.
Expand Down
Loading
Loading