refactor(sync): use deque(maxlen=N) for pending attestation buffers (… #410
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Production Test Vectors | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: prod-vectors-latest | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| name: Check key availability | |
| runs-on: ubuntu-latest | |
| outputs: | |
| scheme-changed: ${{ steps.scheme-diff.outputs.changed }} | |
| cache-hit: ${{ steps.key-cache.outputs.cache-hit }} | |
| steps: | |
| - name: Checkout leanSpec | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Check if scheme changed | |
| id: scheme-diff | |
| run: | | |
| if git diff HEAD~1 --name-only | grep -qE '^src/lean_spec/subspecs/(xmss|poseidon1)/'; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Check prod key cache | |
| id: key-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: /tmp/prod-keys-probe | |
| key: prod-keys-${{ hashFiles('src/lean_spec/subspecs/xmss/**', 'src/lean_spec/subspecs/poseidon1/**') }} | |
| lookup-only: true | |
| keygen: | |
| name: Generate keys | |
| needs: check | |
| if: needs.check.outputs.cache-hit != 'true' && needs.check.outputs.scheme-changed == 'true' | |
| uses: ./.github/workflows/generate-keys.yml | |
| secrets: inherit | |
| fill: | |
| name: Fill production test fixtures | |
| needs: [check, keygen] | |
| # Trick to run even when keygen was skipped, but not on failure or cancel. | |
| if: always() && !failure() && !cancelled() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout leanSpec | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.14 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "pyproject.toml" | |
| - name: Install just | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: just | |
| - name: Restore prod key cache | |
| id: key-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: packages/testing/src/consensus_testing/test_keys/prod_scheme | |
| key: prod-keys-${{ hashFiles('src/lean_spec/subspecs/xmss/**', 'src/lean_spec/subspecs/poseidon1/**') }} | |
| - name: Download keys | |
| if: steps.key-cache.outputs.cache-hit != 'true' | |
| run: uv run python -m consensus_testing.keys --download --scheme prod | |
| - name: Save key cache | |
| if: steps.key-cache.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: packages/testing/src/consensus_testing/test_keys/prod_scheme | |
| key: prod-keys-${{ hashFiles('src/lean_spec/subspecs/xmss/**', 'src/lean_spec/subspecs/poseidon1/**') }} | |
| - name: Fill production test fixtures | |
| run: just fill-ci --scheme=prod | |
| - name: Bundle keys with fixtures | |
| run: | | |
| mkdir -p fixtures/keys | |
| cp -r packages/testing/src/consensus_testing/test_keys/prod_scheme fixtures/keys/ | |
| - name: Create reproducible fixture archive | |
| run: | | |
| tar \ | |
| --sort=name \ | |
| --owner=0 \ | |
| --group=0 \ | |
| --numeric-owner \ | |
| --mtime='UTC 2020-01-01' \ | |
| -cf - fixtures | gzip --no-name > fixtures-prod-scheme.tar.gz | |
| sha256sum fixtures-prod-scheme.tar.gz > fixtures-prod-scheme.tar.gz.sha256 | |
| - name: Upload fixture archive | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fixtures-prod-scheme | |
| path: | | |
| fixtures-prod-scheme.tar.gz | |
| fixtures-prod-scheme.tar.gz.sha256 | |
| if-no-files-found: error | |
| - name: Publish latest release | |
| run: | | |
| gh release delete latest --cleanup-tag --yes || true | |
| gh release create latest \ | |
| fixtures-prod-scheme.tar.gz \ | |
| fixtures-prod-scheme.tar.gz.sha256 \ | |
| --target "${{ github.sha }}" \ | |
| --title "Latest production fixtures" \ | |
| --notes "Auto-generated from leanSpec@${{ github.sha }}" | |
| env: | |
| GH_TOKEN: ${{ github.token }} |