Skip to content

fix(rs-dpp): Remove overflows - #818

Closed
qrayven wants to merge 12 commits into
v0.24-devfrom
fix/remove-overflow
Closed

fix(rs-dpp): Remove overflows#818
qrayven wants to merge 12 commits into
v0.24-devfrom
fix/remove-overflow

Conversation

@qrayven

@qrayven qrayven commented Mar 13, 2023

Copy link
Copy Markdown
Contributor

Removes potential overflows and unifies types for common fileds containg numbers

Issue being fixed or feature implemented

What was done?

How Has This Been Tested?

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@qrayven qrayven changed the title Fix/remove-overflow fix(rs-dpp): Remove overflows Mar 14, 2023
@qrayven
qrayven force-pushed the fix/remove-overflow branch from 6502205 to 7ae7c6e Compare March 14, 2023 09:25
@qrayven

qrayven commented Mar 31, 2023

Copy link
Copy Markdown
Contributor Author

Closed due to of too many conflicts

@qrayven qrayven closed this Mar 31, 2023
@shumkov
shumkov deleted the fix/remove-overflow branch August 25, 2024 08:51
bfoss765 added a commit to bfoss765/platform that referenced this pull request Aug 5, 2026
…field

The key-wallet pin bump takes key-wallet dashpay#818, which dropped
`generated_at` / `used_at` from `#[repr(C)] FFIAddressInfo`.
`build_ios.sh` regenerates that crate's cbindgen header into
DashSDKFFI.xcframework, so a fresh framework build left
AddressPool.swift referencing a member the C struct no longer has:

  error: value of type 'FFIAddressInfo' has no member 'generated_at'

`generatedAt` is kept (public API, no in-repo or observable change)
and pinned to the Unix epoch. That is not a substituted value: every
key-wallet `AddressInfo` constructor set `generated_at: 0` ("Should
use actual timestamp"), so the property has always evaluated to the
epoch. Both it and `used` now document the new `AddressState` model,
including that a `Reserved` address reports `used == false` and that
reservation state is not observable across the C surface.

Also settles the persistence round-trip question raised in review.
`generated_at` / `used_at` were never serialized — `CoreAddressEntryFFI`
has no field for them, and `address_info_from_ffi` was the only
producer, from the literals `0` / `Some(0)` — so dropping them is
lossless. `Reserved { at }` genuinely has no slot in that schema and
would reload as `Available`, but nothing in platform reserves
addresses (no caller of `next_receive_address_and_reserve` /
`next_unused_and_reserve` in the workspace), so the loss is
unreachable today rather than live. The emit path now spells the
`Reserved` arm out and warns instead of silently flattening it, the
schema field documents the constraint, and a new test pins the
behavior so a future reserving caller surfaces as a schema decision.

Verified: `cargo check --workspace --all-targets` clean; platform-wallet
513 passed, platform-wallet-ffi 221 passed; rustfmt clean; scoped clippy
(the CI invocation) clean. Swift verified by type-checking the whole
SwiftDashSDK module under -swift-version 6 -warnings-as-errors against
the cbindgen headers regenerated from the new pin — clean, and the
pre-fix source reproduces the reviewer's exact error against the same
headers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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