fix(escrow): sensible defaults for finish fee and deploy time bound#29
Open
Sanka-D wants to merge 1 commit into
Open
fix(escrow): sensible defaults for finish fee and deploy time bound#29Sanka-D wants to merge 1 commit into
Sanka-D wants to merge 1 commit into
Conversation
Verified with a local smart-escrow round-trip (deploy → finish) on a rippled node with the WASM-escrow amendment. - escrow finish: default --fee scaled with the gas allowance (gas * 10 drops) when omitted. A flat 1 XRP fee is rejected on-chain with telINSUF_FEE_P because the required fee grows with ComputationAllowance. - escrow deploy: XRPL rejects EscrowCreate without CancelAfter/FinishAfter even for a smart (WASM) escrow. When neither flag is given, default CancelAfter to +24h so deploy works out of the box; the WASM FinishFunction still governs when the escrow can be finished. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Two friction points in the smart-escrow lifecycle, found and fixed while running a full deploy → finish round-trip on a local rippled node with the WASM-escrow amendment enabled.
Fixes (
internal/cli/escrow.go)escrow finishfee default is too low. With the default (empty--fee), the JS module falls back to a flat 1 XRP, which the ledger rejects withtelINSUF_FEE_P— the required fee scales withComputationAllowance(the WASM gas). Now, when--feeis omitted, the default is derived from the gas allowance (gas * 10drops, the value that succeeded on-chain). Passing--feestill overrides.escrow deployhard-fails without a time bound. XRPL rejectsEscrowCreateunlessCancelAfterorFinishAfteris set — even for a smart escrow whose release is governed by the WASMFinishFunction(client-side error: "Either CancelAfter or FinishAfter must be specified"). When neither flag is given, deploy now defaultsCancelAfterto +24h so it works out of the box; the WASMfinish()still governs when the escrow can be released.Verification (local node, WASM-escrow amendment)
Before:
escrow deploy --destination … --amount …(no time flags) →EscrowCreate: Either CancelAfter or FinishAfter must be specifiedescrow finish …(no--fee) →telINSUF_FEE_P - Fee insufficientAfter (this branch, rebuilt binary):
escrow deploywith no time flags →✓ Smart escrow created!(autoCancelAfter +24h), validatedescrow finishwith no--fee→tesSUCCESS, "Escrow released"; funds delivered to the destination and the Escrow object consumedScope is limited to defaulting when the flags are omitted; explicit
--fee/--cancel-after/--finish-afterbehave as before.go buildandgo vet ./...pass.🤖 Generated with Claude Code