Add PausableSapient support to Trails intents - #367
Draft
ScreamingHawk wants to merge 2 commits into
Draft
Conversation
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.
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. |
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.
Summary
payloadGateLeafNodeparam toCreateIntentTree/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), whilesapientSignerLeafNode(e.g. a timed-refund signer) stays untouched. Passingnilkeeps the exact legacy tree shape.CreateIntentConfigurationWithTimedRefundSapientwrapper (hardcodedcheckpoint=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
PausableSapientcontract, 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, unrelatedTestWalletDeploy/v1failure (confirmed present onmastertoo)WIP — draft while trails-api integration is validated against this branch.