Skip to content

Add PausableSapient support to Trails intents - #367

Draft
ScreamingHawk wants to merge 2 commits into
masterfrom
pausable
Draft

Add PausableSapient support to Trails intents#367
ScreamingHawk wants to merge 2 commits into
masterfrom
pausable

Conversation

@ScreamingHawk

Copy link
Copy Markdown
Contributor

Summary

  • Adds an optional payloadGateLeafNode param to CreateIntentTree/CreateIntentConfiguration: when set, wallet execution requires [calls && payloadGateLeafNode] to sign together (a 2-of-2 subtree that caps the calls' otherwise-uncapped any-address-subdigest weight), while sapientSignerLeafNode (e.g. a timed-refund signer) stays untouched. Passing nil keeps the exact legacy tree shape.
  • Removes the unused CreateIntentConfigurationWithTimedRefundSapient wrapper (hardcoded checkpoint=0, no production callers anywhere in the workspace — only test-only usage in this repo and in trails-watchtower).

Intended consumer: gating v1.5 intent wallet execution behind the PausableSapient contract, so pausing it blocks execution while owner recovery (and other ungated leaves like timed-refund) keep working.

Test plan

  • go build ./...
  • go test . (intent-config tests, full local suite against anvil) — all pass except a pre-existing, unrelated TestWalletDeploy/v1 failure (confirmed present on master too)
  • trails-api integration (in progress, separate branch)

WIP — draft while trails-api integration is validated against this branch.

The wrapper hardcodes checkpoint=0, which no real caller can use (intent
wallets need a salt-derived checkpoint), and has no production callers
anywhere in the workspace — only its own test and two trails-watchtower
test files exercise it. Callers build the timed-refund sapient leaf
directly via TimedRefundSapientImageHash and pass it to
CreateIntentConfiguration, which remains unchanged.
…Configuration

CreateIntentTree and CreateIntentConfiguration take a new payloadGateLeafNode
parameter: when set, the wallet is satisfied by [calls && payloadGateLeafNode]
signing together (a 2-of-2 subtree that caps the calls' any-address-subdigest
leaves' own, otherwise uncapped, weight) OR by sapientSignerLeafNode,
untouched. This lets a caller gate payload execution behind a revocable
signer (e.g. a pausable contract) while leaving other leaves (e.g. a
timed-refund signer) unaffected. Passing nil preserves the exact legacy tree
shape, so already-derived counterfactual addresses do not change.
@ScreamingHawk

Copy link
Copy Markdown
Contributor Author

Confirming we only want the calls to be pausable (current implementation).

I think making the the deposit pausable under the same lock makes sense. If execution is blocked, there is no reason we should have deposits enabled too.

Locking the timed refund sapient with the same lock, I'm less sure about. If the argument for using the lock is "Polygon contracts may be exploitable" then it makes sense. But blocking automated refund capability is iffy. Note that in either case the owner will still have 1/1 signing power and can do whatever they want with the intent.

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