Skip to content

Ushuaia protocol support (025) β€” PyTezos 3.19.0#400

Merged
Wizard1209 merged 12 commits into
masterfrom
aux/3.19.0
Jun 29, 2026
Merged

Ushuaia protocol support (025) β€” PyTezos 3.19.0#400
Wizard1209 merged 12 commits into
masterfrom
aux/3.19.0

Conversation

@Wizard1209

Copy link
Copy Markdown
Member

Summary

Bumps PyTezos to 3.19.0 with support for the Ushuaia (025) protocol (PsUshuai9QapM5TGj1JpuVGkdxz5GykdnEvS6Rh8SUVrARvZLCY, Octez v25.0).

Verified end-to-end against a live Ushuaia node (rpc.ushuaianet.teztnets.com, v25.0 / commit 187a915b): protocol hash matches, full make all green (lint + 1124 unit/contract/integration tests + 17 sandbox tests on the v25.0 node + docs build).

Changes

Protocol

  • Add USHUAIA hash, set LATEST, register in protocol_hashes / protocol_version (25)
  • DOCKER_IMAGE = bakingbad/sandboxed-node:v25.0; Makefile sandbox-params path β†’ 025-PsUshuai-parameters
  • Drop 025-PsUshuai-parameters/ JSONs (mainnet / mainnet-with-chain-id / sandbox / test)
  • Block-header protocol_version >= 24 gate already covers 025 (header byte-identical to 024) β€” no change needed

tz5 / ML-DSA-44

  • New base58 prefixes: tz5, mdpk, mdsk, mdesk, mdsig (verified against Octez v25.0 base58.ml)
  • is_pkh recognizes tz5
  • forge_address/unforge_address tz5 address tag \x04
  • forge_public_key/unforge_public_key mdpk pubkey tag \x04 (needed for tz5 reveals)
  • tz5 signing (ML-DSA-44 in crypto/key.py) is deferred β€” forge/parse does not require it

Other

  • Modern Tenderbake consensus operations: attestation, preattestation, attestation_with_dal, attestations_aggregate / preattestations_aggregate, with DAL bitset forging
  • Doc/link fixes (Binder image, stale references)
  • Regenerated src/pytezos/rpc/docs.py from the Ushuaia node (sTEZ, DAL, BLS-aggregate RPCs)
  • Dependency bump (uv lock --upgrade, 37 packages) β€” changelogs reviewed, no breaking changes reachable; min-Python stays 3.10
  • CHANGELOG.md entry for 3.19.0

Test plan

  • make all green (lint, unit/contract/integration, sandbox vs live v25.0, docs)
  • Protocol hash confirmed against live Ushuaia node
  • tz5 address + mdpk pubkey forge/parse round-trips; tz5 reveal forging

πŸ€– Generated with Claude Code

Wizard1209 and others added 11 commits June 28, 2026 19:07
- Add Ushuaia protocol hash (PsUshuai9QapM5TGj1JpuVGkdxz5GykdnEvS6Rh8SUVrARvZLCY)
- Update LATEST to Ushuaia, add to protocol_hashes and protocol_version dicts
- Update Docker image to bakingbad/sandboxed-node:v25.0
- Add 025-PsUshuai-parameters with mainnet/sandbox/test JSON files
- Add tz5 / ML-DSA-44 forge & parse support:
  - tz5 + mdpk/mdsk/mdesk/mdsig base58 prefixes in crypto/encoding.py
  - is_pkh accepts tz5
  - forge_address/unforge_address tz5 address tag \x04
- Update Makefile sandbox-params target to 025-PsUshuai-parameters

tz5 signing (ML-DSA-44) is deferred; forge/parse does not require it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- binder/Dockerfile: python:3.8-slim-buster -> python:3.12-slim-bookworm.
  requires-python is >=3.10, so the 3.8 base made `pip install /tmp/pytezos`
  fail on every Binder build of the Labs site. Earlier "Fix Binder
  workflow" commits only changed the trigger, never the failing image --
  this is the actual root cause of that churn.
- README.md, docs/source/quick_start.rst: bump documented Python from
  3.8/3.9 to 3.10+ to match requires-python.
- docs/source/quick_start.rst: replace dead mainnet-tezos.giganode.io RPC
  (host shut down, returns HTTP 526) with rpc.tzkt.io/mainnet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Tezos renamed endorsement->attestation in Oxford and reworked consensus
ops across Tenderbake/Paris/Seoul, but pytezos still only emitted the
legacy Emmy `endorsement` (tag 0) and `endorsement_with_slot` (tag 10).
Add the modern ops so pytezos can forge consensus operations for current
protocols (through 025 Ushuaia):

- rpc/kind.py: preattestation=20, attestation=21, attestation_with_dal=23,
  preattestations_aggregate=30, attestations_aggregate=31, and
  double_consensus_operation_evidence=2 (consensus ops in validation pass
  0, evidence in pass 2).
- operation/forge.py: forgers for the consensus content
  (slot|level|round|block_payload_hash [+ DAL]), the inlined consensus op,
  the BLS (pre)attestation aggregates, and the merged double-consensus
  evidence. The DAL bitset is signed Zarith (Data_encoding.z, per
  src/lib_base/bitset.ml in octez-v25.0) => forge_int, NOT forge_nat;
  for values >= 64 the two encodings diverge.
- operation/content.py: attestation()/preattestation()/
  double_consensus_operation_evidence() builders.

Legacy endorsement* ops are kept for pre-Oxford protocols: no tag
collision (0/10 vs 20/21/23/30/31), and tag 2 is reused only under the
distinct double_consensus_operation_evidence kind.

Adds tests/unit_tests/test_operation/test_consensus.py (14 tests),
including a boundary test pinning the signed-Zarith DAL bitset
(64 -> \x80\x01, not the unsigned \x40).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Bump version 3.18.0 -> 3.19.0
- Add CHANGELOG entry for 3.19.0 (Ushuaia 025, tz5 forge/parse, modern
  attestation consensus ops, v25.0 binaries)
- Regenerate src/pytezos/rpc/docs.py from a live Ushuaia v25.0 node
  (rpc.ushuaianet.teztnets.com): adds sTEZ, DAL and BLS-aggregate RPCs
- uv.lock refreshed for the new version

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Step 2a added tz5 to forge_address/unforge_address but NOT to
forge_public_key/unforge_public_key, which stop at BLpk (tag \x03) and
raise on `mdpk`. A tz5 reveal embeds an ML-DSA-44 public key (mdpk,
1312 B, tag \x04), so forge_reveal -> forge_public_key crashes for any
tz5 account's first operation.

These tests are intentionally RED until the forge_public_key /
unforge_public_key fix (add `mdpk` -> tag \x04 + reverse-map entry) lands:
- test_forge_address.py::TestForgePublicKey β€” mdpk round-trip + tag \x04.
- test_forging.py::test_forge_reveal_with_tz5_account β€” full reveal forge.

The suite is red on purpose (TDD red-first); the fix makes it green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Refresh uv.lock to latest compatible versions (37 packages, incl.
cryptography 49, rpds-py CalVer, pytest 9.1.1, ruff 0.15.20, jupyter
stack). Changelogs reviewed: no breaking changes reachable from pytezos;
min-Python floor stays 3.10 (rpds-py 3.10 kept via marker split).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
forge_public_key/unforge_public_key stopped at BLpk (tag \x03), so a tz5
reveal (which embeds an mdpk ML-DSA-44 public key) raised
"Unrecognized key type: #mdpk". Add the mdpk <-> tag \x04 branch,
matching the tz5 public-key-hash tag scheme. Greens the GAP-1 tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the now-false "RED until the fix lands" / "currently stop at BLpk"
status notes from the tz5/mdpk forging tests (the fix has landed; they
are green). Keep the evergreen "why" (reveals embed an mdpk pubkey
forged via forge_public_key, tag \x04).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kind.py and test_consensus.py pointed at docs/notes/attestation-mental-model.md,
a dev note that was never committed (does not ship, file absent). Remove the
dangling reference; keep the evergreen explanation of the Tenderbake/Oxford+
consensus-op rename.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

Test Results

β€‡β€ˆβ€‡β€‡4 files  ± 0β€‚β€ƒβ€‡β€ˆβ€‡β€‡4 suites  Β±0   2m 17s ⏱️ -11s
1β€ˆ154 tests +29  1β€ˆ141 βœ… +29  13 πŸ’€ Β±0  0 ❌ Β±0 
1β€ˆ178 runsβ€Š +29  1β€ˆ165 βœ… +29  13 πŸ’€ Β±0  0 ❌ Β±0 

Results for commit 02bc467. ± Comparison against base commit 799f9fb.

♻️ This comment has been updated with latest results.

The "Publish results" step (EnricoMi/publish-unit-test-result-action)
fails the whole job when GitHub throttles its PR-lookup endpoint (HTTP
429), even though lint and tests passed. Mark it continue-on-error and
grant the action the checks/pull-requests permissions it needs to use
the API instead of falling back to unauthenticated scraping.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Wizard1209 Wizard1209 merged commit 10c7b49 into master Jun 29, 2026
5 checks passed
@Wizard1209 Wizard1209 deleted the aux/3.19.0 branch June 29, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant