Skip to content

Spec 0.4.0-rc.3: get_bootstrap_status and get_transaction_pool_status (daemon 4.0.4) - #35

Open
dkijania wants to merge 1 commit into
masterfrom
spec-0.4.0-rc.3
Open

dkijania wants to merge 1 commit into
masterfrom
spec-0.4.0-rc.3

Conversation

@dkijania

Copy link
Copy Markdown
Collaborator

Implements the two operations that o1-labs/mina-sdk-spec#7 adds for mina 4.0.4. spec/ is set to v0.4.0-rc.3; the spec CI job passes once that tag exists on the spec repository.

What changes

  • get_bootstrap_status() → BootstrapStatus: the daemon's bootstrap phase, when it began, attempts, the last failure, and one LedgerSync per ledger with its LedgerSyncProgress. Tells a stalled ledger sync from a slow one.
  • get_transaction_pool_status() → TransactionPoolStatus: pool size, capacity and minimum_fee_per_weight_unit (kept a str | None: a decimal integer or a fraction n/d, None when the pool is empty).
  • Both need daemon 4.0.4. An older daemon answers Cannot query field, which is a GraphQLError and not retried, like every GraphQL error. A test covers that.
  • Frozen dataclasses with X | None = None for nullable fields, as DaemonStatus. phase and ledger are plain str like DaemonStatus.sync_status, with the allowed values in the docstrings.
  • Query strings copied verbatim from the spec; tests/test_spec.py now covers 24 documents.
  • README rows, CHANGELOG under Unreleased. No version bump.

Verification

ruff check, ruff format --check, mypy src/, bandit, and the CI pytest set (79 passed, coverage 92.9%) all pass. Integration tests skipped (no daemon).

Note for maintainers: uv run in project mode cannot resolve the dev dependencies because requires-python = ">=3.8" while bandit>=1.8 needs 3.9. Pre-existing; the checks above were run with uv run --no-project --with-editable ..

🤖 Generated with Claude Code

https://claude.ai/code/session_01FPK7KVU2LzZ8WtexqTg5Zm

…et_transaction_pool_status

mina 4.0.4 adds the bootstrapStatus and transactionPoolStatus root
fields; the specification's BootstrapStatus and TransactionPoolStatus
operations read them. get_bootstrap_status returns BootstrapStatus
(phase, attempts, and the LedgerSync list with each sync's
LedgerSyncProgress); get_transaction_pool_status returns
TransactionPoolStatus (size, max size, and the minimum fee per weight
unit as the daemon's string, None when the pool is empty). Both need
daemon 4.0.4; an older daemon answers with a GraphQLError, as the
specification says.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FPK7KVU2LzZ8WtexqTg5Zm

This branch has not been deployed

No deployments
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