Skip to content

OpenAPI and improvements#4034

Draft
vsuharnikov wants to merge 48 commits intoversion-1.6.xfrom
openapi-and-fixes
Draft

OpenAPI and improvements#4034
vsuharnikov wants to merge 48 commits intoversion-1.6.xfrom
openapi-and-fixes

Conversation

@vsuharnikov
Copy link
Contributor

@vsuharnikov vsuharnikov commented Feb 17, 2026

OpenAPI & Finalization, BLS, Core Logic Improvements, and Cleanup

TL;DR

  • Refactors NgState and fixes multiple liquid block / microblock edge cases
  • Adds BLS-related types, validation improvements, and API exposure
  • Improves OpenAPI + Swagger UI (accurate schemas, new endpoints, better UX)
  • Fixes rollback, block duplication, and mining stability issues
  • Adds extensive tests and removes obsolete code

Finalization & Core Logic

Finalization

  • Correct finalization height and voting derived from the right liquid block
  • Fixed block appending after finalization
  • Added safeguards against applying the same block twice

NG State Refactoring

Refactored NgState:

  • Cleanup and simplification
  • Replaced Vector + List with VectorMap for microblocks
  • Improved correctness of liquid block handling

Mining & Block Processing Fixes

  • Fixed liquid block forging logic
  • Miner now correctly forges after the right liquid block
  • Fixed key block validation against latest removed microblock
  • Prevented invalid states during microblock rollback
  • Improved handling of endorsement-related mining issues

BLS & Cryptography

  • BLS validation fixes and improvements
  • Improvements to signature validation logic (including P-256 context where applicable)

Logging & Diagnostics

  • Improved logging order and clarity
  • Added additional logging
  • Added filters for endorsements (excluding miner endorsements)

HTTP API

Fixed route matching: prevented fallback by throwing in TransactionId and BlockId matchers.

OpenAPI Updates

Added:

  • Endpoints:
    • GET /blocks/height/finalized
    • GET /blocks/headers/finalized
    • GET /blocks/finalized/at/{height}
    • GET /generators/at/{height}
    • GET /addresses/bls/{address}
  • Transactions & Types: CommitToGenerationTransaction, AssetPair, DebugStateHashes, BLS-related schemas
  • Components: BlsPublicKey, BlsSignature, GeneratorIndex, BlockEndorsement, FinalizationVoting

Block & Snapshot Fields

Added:

  • finalizationVoting to block headers
  • nextCommittedGenerators to TransactionSnapshot

Debug State Hash Fields

Added:

  • nextCommittedGeneratorsHash
  • committedGeneratorBalancesHash

to:

  • /debug/stateHash/last
  • /debug/stateHash/{height}

Transaction Schema Improvements

  • Refined transaction schemas to display precise types in Swagger UI (instead of generic object)
  • Limited feeAssetId to:
    • InvokeExpressionTransaction
    • InvokeScriptTransaction
    • TransferTransaction
    • UpdateAssetInfoTransaction
  • Corrected assetId-like field types
  • Eliminated deprecated nullable
  • Added documentation for /transactions/sign (new fields)
  • General schema fixes and cleanup

Swagger UI Improvements

  • Updated Swagger UI to 5.31.1
  • Disabled server selection
  • Disabled "Explore" functionality
  • Enabled "Try it" mode by default
  • Hide "Try it out" button

Tests

  • Added extensive new tests:
    • Finalization scenarios
    • Miner behavior
    • Microblock handling
    • Balance validation
  • Updated existing tests
  • Backported MiningFailuresSuite
  • Added multiple edge-case checks

Cleanup

  • Removed obsolete code
  • General refactoring and comments

- /transactions/sign: added an info about new fields to description
- New components: BlsPublicKey, BlsSignature, GeneratorIndex, BlockEndorsement, FinalizationVoting
- Added finalizationVoting to block headers
- GET /blocks/height/finalized
- GET /blocks/headers/finalized
- GET /blocks/finalized/at/{height}
…atorBalancesHash" in `/debug/stateHash/last` and `/debug/stateHash/{height}` after finality feature activation
…nTransaction, InvokeScriptTransaction, TransferTransaction, UpdateAssetInfoTransaction
- Added WavesOrAssetId and DebugStateHashes schemas
- Eliminate deprecated "nullable"
- Right types for assetId-like fields
- Chores
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