fix(jobs): defer terminate to operator when payer is multisig#547
Closed
SgtPooki wants to merge 1 commit into
Closed
fix(jobs): defer terminate to operator when payer is multisig#547SgtPooki wants to merge 1 commit into
SgtPooki wants to merge 1 commit into
Conversation
In session-key mode with a contract payer, dealbot cannot auto-terminate
PDP-terminated datasets: FWSS.terminateService gates on
msg.sender ∈ {payer, payee}, and our signer is the session-key EOA. Any
direct call reverts with CallerNotPayerOrPayee on-chain (and currently
even fails simulation because Lotus rejects eth_call from a contract).
Detect this case in repairTerminatedDataSet and throw a typed
DataSetTerminateRequiresOperatorError. The data_set_creation handler
catches it and emits dataset_terminate_operator_action_required so an
operator can submit terminateService via Safe Transaction Builder. The
existing already-terminated branch still runs the DB cleanup once an
operator's batch lands.
Tracking: #546
Contributor
|
@SgtPooki : I want to make sure any work here is accounting for changes / simplifications that are coming with terminations as outlined in https://www.notion.so/filecoindev/Data-Set-Terminations-Clean-up-360dc41950c1801ebf0aff017a322e7f |
Collaborator
Author
This was exploratory and im not a big fan.. i think we should just close this and wait for the changes you mentioned |
Contributor
|
Closing given #547 (comment) |
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.
What changed
In session-key + multisig payer mode,
repairTerminatedDataSetnow throws a typedDataSetTerminateRequiresOperatorErrorinstead of callingsynapse.storage.terminateDataSet. Thedata_set_creationhandler catches the typed error and emitsdataset_terminate_operator_action_requiredso the operator can submitterminateServicevia Safe (as we did in #545).The existing already-terminated branch in
repairTerminatedDataSetis unchanged. Once an operator's Safe batch lands and FWSS reportspdpEndEpoch != 0, the next tick marks the affectedDealrowscleaned_up=trueautomatically.EOA-mode behavior is unchanged.
Why
FWSS.terminateServicegates onmsg.sender ∈ {payer, payee}. Our session-key EOA is neither, so any direct call would revert withCallerNotPayerOrPayeeon-chain. Pre-flight simulation also fails today because Lotus rejectseth_callwithfromset to a contract address (lotus#13470 still open), andapps/backend/src/common/synapse-factory.ts:safeReadTransportstripsfromto work around that.Full context: #546
How to verify
pnpm testfrom the repo root (362 tests pass).Manual: in staging, after this lands, a
dataset_terminated_detectedevent for a known-terminated dataset is now followed bydataset_terminate_operator_action_required(withpayerAddressin the log) instead of failing onCallerNotPayerOrPayee. After the operator runs a Safe batch like #545, the nextdata_set_creationtick logsdataset_already_terminated+dataset_terminated_repairedand marks the correspondingDealrowscleaned_up=true.Notes / risks
Refs:
data_set_creationrepair handlersafeReadTransportworkaround