feat(solver_registry): exactly-once settlement writes per intent (#387 #388 #390 #391) - #445
Merged
james2177 merged 3 commits intoSep 30, 2026
Conversation
|
@spotkorner-dot Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
# Conflicts: # solver_registry/src/lib.rs # solver_registry/src/test.rs
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
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.
solver_registry: exactly-once settlement writes per intent (#390)
This PR delivers #390's first two acceptance-criteria items, which only make sense together: the
intent_idparameter and the duplicate check. #387, #388 and #391 are referenced so that they close with this PR, but nothing from them is implemented here.#390 Make registry
slashandrecord_fillidempotent per intentWhat existed:
record_fill,record_failureandslashhad no idempotency key. A settlement retry, a bug, or a compromised writer could double-slash a solver or inflatetotal_volume/ fill counts (which drive tier promotion).Done (AC1 + AC2):
record_fill(caller, solver, intent_id, amount),record_failure(caller, solver, intent_id),slash(caller, solver, intent_id).Error::AlreadyRecorded = 13. The key is a persistentDataKey::Recorded(action, intent_id):record_failureand aslashfor the same intent are independent writes;SolverNotRegistered) does not consume it.is_intent_recorded(action, intent_id)so settlement can check before retrying.docs/solver-registry-interface.md§2.3 signatures, idempotency semantics, and error table updated.slashed_totaland fee-recipient balance unchanged); keys are per action; an intent can't be credited to a second solver; a failed write doesn't consume the intent.intent_idper call.Breaking ABI: the three write functions take a new
intent_idargument.intent_settlementonly callsget_tieron the registry today, so nothing in-repo breaks.Not done in this PR:
#387 Consume proofs on fill
Not done in this PR:
fill_intentso one deposit can't back multiple fills.#388 Dual-bridge quorum mode
Not done in this PR:
#391 Unbonding period for
unstake/deregister_solverNot done in this PR:
request_unstake/claim_unstake, slashable pending unbonds, andget_pending_unbonds.Verification
In
solver_registry:cargo test: 29 passed, 0 failed (23 existing + 6 new).cargo fmt --check: no findings on lines this PR adds or changes.mainalready has fmt drift in these files, left untouched.cargo clippy --all-targets -- -D warnings: fails onmainwith current stable clippy (manual_range_containsinset_tier_threshold, pre-existing). There are no findings on lines this PR adds.Closes #387
Closes #388
Closes #390
Closes #391