-
Notifications
You must be signed in to change notification settings - Fork 12
feat: x-algokit-byte-length support and block model restructuring for cross-SDK alignment #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
4724db7 to
b75499d
Compare
…ngth byte validation - Add byte_length and list_inner_byte_length fields to TypeInfo in builder.py - Update _build_metadata() to generate fixed-length byte serde helpers - Add encode_fixed_bytes_base64/decode_fixed_bytes_base64 helpers for 32/64 byte validation - Add encode_fixed_bytes_sequence/decode_fixed_bytes_sequence for array validation - Regenerate API clients with fixed-length byte fields (group, lease, signature, etc.) - Update OAS_BRANCH to fix/byte-len-validation for spec generation
b75499d to
9de43f5
Compare
Align Python block model structure with the JavaScript SDK and OpenAPI spec for cross-SDK consistency. Structural changes: - Rename GetBlock -> BlockResponse (matches OAS spec + JS/TS SDKs) - Add TxnCommitments nested type for transaction roots (txn, txn256) - Add RewardState nested type for reward fields (fees, rwd, earn, etc.) - Add UpgradeState nested type for protocol upgrade state - Add UpgradeVote nested type for upgrade vote parameters - Refactor BlockHeader to use flattened nested types - Change BlockEvalDelta.bytes -> bytes_value (avoid Python keyword) - Fix inner_txns type: SignedTxnInBlock -> SignedTxnWithAD - Make previous_block_hash and genesis_hash non-optional with defaults - Fix get_block() to return BlockResponse (typed) instead of Block - Export typed BlockResponse from _block.py instead of untyped version BREAKING CHANGE: - GetBlock removed, use BlockResponse instead - Field access patterns changed in BlockHeader: - header.fee_sink -> header.reward_state.fee_sink - header.current_protocol -> header.upgrade_state.current_protocol - header.upgrade_propose -> header.upgrade_vote.upgrade_propose - header.transactions_root -> header.txn_commitments.transactions_root - Block response structure: result.header -> result.block.header
cf22d18 to
f5d22e5
Compare
daniel-makerx
approved these changes
Dec 16, 2025
f5d22e5 to
426dd6f
Compare
Excludes block models from the generated client code to allow separate handling. This change introduces a mechanism to conditionally include block models during code generation based on a client configuration. It also updates the AVM debugger source map generation by incorporating hashes in the standard AVM debugger format. Skips tests that depend on msgpack handling until mock server is fixed.
426dd6f to
591b4af
Compare
Ensures all block-related types (ApplyData, BlockEvalDelta, BlockStateDelta, SignedTxnWithAD, TxnCommitments, RewardState, UpgradeState, UpgradeVote, etc.) remain publicly exported from algokit_algod_client.models for type hints, isinstance checks, and IDE autocomplete. These types are returned by the public API and must be accessible to users. Aligns with TypeScript SDK behavior.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds fixed-length byte validation using
x-algokit-byte-lengthvendor extension and restructures block models to align with js-algorand-sdk v3.Key Changes
Fixed-Length Byte Validation
x-algokit-byte-lengthOpenAPI vendor extension supportBlock Model Restructuring (Breaking)
GetBlock→BlockResponseBlockHeaderfields reorganized into nested dataclasses:TxnCommitments- transaction roots (SHA256/512)RewardState- fee_sink, rewards_pool, rewards_level, etc.UpgradeState- current/next protocol versionsUpgradeVote- upgrade proposalsBlockEvalDelta.bytes→bytes_value(Python keyword conflict)AVM Debugger Source Map (Bug Fix)
sha512_256→hash(restores standard AVM debugger format compatibility)Wire Format
Migration Example
See
MIGRATION-NOTES.mdfor complete field mapping.