Skip to content

Fixes a set of critical and high-confidence bugs#91

Open
Fingerling42 wants to merge 14 commits into
airalab:developmentfrom
Fingerling42:fix-and-update
Open

Fixes a set of critical and high-confidence bugs#91
Fingerling42 wants to merge 14 commits into
airalab:developmentfrom
Fingerling42:fix-and-update

Conversation

@Fingerling42

Copy link
Copy Markdown
Member

What changed

  • Prevented automatic retry from resubmitting extrinsics after a network error.
  • Updated token transfers to use Balances.transfer_allow_death, which exists in the current runtime.
  • Fixed Datalog.get_item() latest lookup for historical reads and ring-buffer wraparound.
  • Fixed zero-based extrinsic lookup in ChainUtils.
  • Preserved RPC errors when reading account nonce instead of silently falling back to 0.
  • Made Subscriber read events from the exact block being processed.
  • Fixed Subscriber address filtering and Liability event handling.
  • Fixed CLI input handling when stdin has no trailing newline.
  • Added validation for IPFS CID helpers, chain hashes, DigitalTwin topic hashes, and Liability crypto types.
  • Fixed RWS day-boundary rounding and missing-device storage handling.

Tests

Adds or updates regression tests for the fixed behavior, including:

  • extrinsic retry safety;
  • Datalog index and latest edge cases;
  • nonce RPC error handling;
  • Subscriber event filtering;
  • hash and CID validation;
  • RWS boundary cases;
  • Liability signature crypto type validation.

Compatibility notes

Most changes preserve the existing public API and make previously broken and error-prone cases explicit.

The main behavioral change is extrinsic retry handling: write operations are no longer automatically resubmitted after an ambiguous network failure, because the node may already have accepted the transaction.

- disable socket retry around ServiceFunctions.extrinsic
- raise AmbiguousExtrinsicSubmissionException on lost submit
response
- expose signed extrinsic hash when available
- keep one-shot retry with backoff for read-only calls
- convert extrinsic resubmission regression into a passing test
- switch transfer_tokens to Balances.transfer_allow_death
- convert transfer call regression tests to passing guards
- add read-only payment_queryInfo smoke coverage for transfer calls
- read DatalogIndex at the requested historical block
- detect empty buffers with start == end
- compute latest index modulo Datalog.WindowSize
- add ServiceFunctions.get_constant for runtime constants
- cover wrapped end=0 and historical latest lookups
- treat None as the only all-extrinsics selector
- return numeric extrinsic indexes without off-by-one adjustment
- reject negative, out-of-bounds, and invalid index types
- add InvalidExtrinsicIndex for block lookup failures
- expand ChainUtils regression coverage
- raise RPCRequestException when nonce RPC returns an error
- reject malformed nonce responses without result
- stop masking failed nonce reads as nonce 0
- cover successful, error, and malformed nonce responses
- query System.Events with the callback block hash
- resolve block hash from header number when hash is absent
- add ServiceFunctions.get_block_hash helper
- cover block-bound Subscriber event reads
- normalize subscribed addresses to exact-match sets
- avoid mutating event attributes during filtering
- add explicit address extractors per supported event type
- handle Liability NewLiability and NewReport payload shapes
- pin Liability event shapes in metadata-contract tests
- replace readline slicing with newline-only rstrip
- add shared stdin line reader for write commands
- cover datalog and launch CLI input with newline, without newline,
and empty input
- require 32-byte hex digests before CID encoding
- validate CID base58 decoding, length, and sha2-256 prefix
- raise clear ValueError messages for invalid IPFS inputs
- cover round-trip and negative IPFS helper cases
- add generic InvalidHash base exception
- keep InvalidExtrinsicHash as a compatible subclass
- require 0x-prefixed 32-byte hex hashes
- reject non-hex, malformed, and non-string hash values
- cover valid and invalid hash validation cases
@Fingerling42 Fingerling42 requested a review from PaTara43 June 8, 2026 15:12
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