Skip to content

chore(bindings): regen v0.17.0 against main#137

Merged
drewstone merged 1 commit into
mainfrom
chore/bindings-v0.17.0
May 16, 2026
Merged

chore(bindings): regen v0.17.0 against main#137
drewstone merged 1 commit into
mainfrom
chore/bindings-v0.17.0

Conversation

@tangletools
Copy link
Copy Markdown
Contributor

Regenerates tnt-core-bindings + fixtures against current main (f64a4e4) and bumps to v0.17.0. Covers PRs #133, #134, #136 since the v0.16.0 release pin.

Summary

Diamond ABI from the proxy's perspective is unchanged — every external selector still routes to Tangle. The only binding-level surface addition is one new diamond self-call on ITanglePaymentsInternal.

Added (binding surface)

  • ITanglePaymentsInternal.distributeBillWithKeeper((uint64,uint64,address,uint256,address[],uint256[],uint256,bool,address)) selector 0x68cdf660. Diamond self-call used by billSubscription to hand per-operator weights computed during accrual directly to the distribution facet, so the keeper rebate and per-asset stake-time weighting agree across the bill and the distribute steps.
  • ITanglePaymentsInternal.BillDistribution struct exposing the self-call payload shape: serviceId, blueprintId, token, amount, operators, weights, totalWeight, hasSecurityCommitments, keeper.

Behavior changes (no binding ABI delta; same selectors, new semantics)

  • RFQ quote redemption is now requester-bound, freshness-checked, and cumulative-TTL-capped. New errors: JobQuoteRequesterMismatch, QuoteTimestampStale, CumulativeTtlExceeded.
  • Subscription bills weight by Σ_op Σ_asset (cumStakeSeconds_delta × commitmentBps × price) across every asset the service requires, replacing the bond-asset-only TWAP. Per-asset fallback preserves legacy semantics for services without commitments.
  • claimRewardsAll is griefing-resilient: a single token whose transfer reverts is skipped via self-call try/catch and RewardsClaimSkipped(account, token) is emitted; remaining tokens still claim. Single-token paths unchanged.
  • ValidatorPodManager._slash(operator, slashBps) is O(1) regardless of delegator count via per-operator DelegationPool { totalAssets, totalShares } with virtual-share inflation defenses. Per-delegator DelegatorSlashed loop replaced by a single OperatorPoolSlashed(operator, slashAmount, newTotalAssets, totalShares).
  • _getOperatorDelegatedStakeForAsset is a single SLOAD; running aggregate updated at every pool-totalAssets mutation. Was O(B) per blueprint, on every TWAP accrual.

Storage layout (no slot reordering)

  • DelegationStorage.__gap 44 → 43 to make room for _operatorDelegatedAggregate. All pre-existing slots preserved.
  • ValidatorPodManager appends _operatorDelegationPools and _delegationShares at the end; no existing slot reordered.

Facet split

  • TanglePaymentsFacet / TangleServicesFacet / TanglePaymentsDistributionFacet each fit under EIP-170 now (24,160 / 21,741 / 18,144 runtime bytes). Payments split into PaymentsCore / PaymentsEscrow / PaymentsBilling / PaymentsDistribution / PaymentsRewards. ServiceValidationLib (~3.8 KB) is linked at deploy time. Same selectors, routed to different physical facet contracts.

Facet-only events (decode by topic against facet ABIs)

These live on Payments* / ValidatorPodManager and are NOT surfaced on ITangle* interfaces, so they are not in the generated bindings. Indexers should decode by topic hash from the facet source ABIs:

  • OperatorPoolSlashed(address operator, uint256 slashAmount, uint256 newTotalAssets, uint256 totalShares)
  • RewardsClaimSkipped(address account, address token)
  • KeeperRebateAccrued(uint64 serviceId, address keeper, address token, uint256 amount)
  • TntPaymentDiscountApplied(uint64 serviceId, address recipient, address token, uint256 amount)
  • StakerShareRefundedToEscrow(uint64 serviceId, address operator, address token, uint256 amount, bytes reason)
  • SubscriptionBaselineInitialized(uint64 serviceId, uint256 baselineStake, uint256 operatorCount)
  • SubscriptionBillSkippedNoOperators(uint64 serviceId, uint64 period)
  • SubscriptionBillAdjustedByManager(uint64 serviceId, uint256 preAdjustmentAmount, uint256 adjustedAmount, uint16 adjustmentBps)

Files

15 files, +788 / -22:

  • bindings/TNT_CORE_VERSIONf64a4e4d4db761b8a5f2aafc3e87ed588797f88c
  • bindings/Cargo.toml, fixtures/Cargo.toml, Cargo.lock0.17.0 (lockfile on main was still pinning 0.15.0; v0.16.0 release commit did not refresh it)
  • bindings/CHANGELOG.md — full v0.17.0 entry
  • 7 ABIs regenerated (only ITanglePaymentsInternal has a .abi delta — distributeBillWithKeeper added; the others differ only in solc metadata)
  • 3 Rust binding files refreshed (i_tangle_payments_internal.rs +664 lines for BillDistribution + new call; multi_asset_delegation.rs and operator_status_registry.rs are bytecode-hex-only deltas from solc metadata).

DO NOT publish until

  • dApp sync verified green against the new bindings
  • indexer schema PR merged (facet-only events need topic-hash decoders wired)
  • at least one downstream blueprint compiles green against tnt-core-bindings = "0.17.0"

Test plan

  • cargo build -p tnt-core-bindings green (verified locally)
  • cargo check -p tnt-core-fixtures green (verified locally)
  • dApp consumer rebuilds against 0.17.0 without compile errors
  • Indexer adds topic-hash decoders for the eight facet-only events listed above
  • Downstream blueprint smoke compile

Regenerates tnt-core-bindings + fixtures against current main (f64a4e4) and
bumps to v0.17.0. Covers PRs #133, #134, #136 since the v0.16.0 release pin.

Binding-surface delta is small: ITanglePaymentsInternal gains
distributeBillWithKeeper(BillDistribution) selector 0x68cdf660 — the diamond
self-call used by billSubscription to hand per-operator weights computed
during accrual directly to the distribution facet. Every other facet selector
still routes to the Tangle diamond unchanged.

Most of the behavioral changes (RFQ requester binding + freshness +
cumulative-TTL caps, multi-asset bill weighting, EIP-170 facet split, O(1)
operator stake aggregate, VPM share-pool slashing, claimRewardsAll griefing
isolation) are observable to indexers via events emitted from the facet
contracts. Those event ABIs (OperatorPoolSlashed, RewardsClaimSkipped,
KeeperRebateAccrued, TntPaymentDiscountApplied, StakerShareRefundedToEscrow,
SubscriptionBaseline*, SubscriptionBill*) are not surfaced on the ITangle /
ITangleFull interfaces and therefore are not present in the generated
bindings; the changelog enumerates them so indexer consumers can decode by
topic hash against the facet source ABIs.

Cargo.lock is updated to 0.17.0 — the lockfile on main was still pinning
0.15.0 (the v0.16.0 release commit did not refresh it).

DO NOT publish to crates.io until: dApp sync verified green, indexer schema
PR merged, at least one downstream blueprint compiles green.
@drewstone drewstone merged commit 45774a4 into main May 16, 2026
2 checks passed
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.

2 participants