feat(tron): add TRC20 approval resource sponsoring extension - #84
feat(tron): add TRC20 approval resource sponsoring extension#84boboliu-1010 wants to merge 34 commits into
Conversation
Will-Guan
left a comment
There was a problem hiding this comment.
Request changes. The sponsorship architecture is directionally sound, but these six confirmed issues should be addressed before release:
- CR-001 allows the Permit2 authorization to expire after sponsorship side effects but before payment settlement, creating a direct Resource Owner cost-without-payment path.
- CR-002 makes the stock Client incompatible with the Facilitator's
solidifiedmode because Approval lifetime is neither negotiated nor configurable end to end. - CR-003 permanently caches a transient permission RPC rejection, disabling both new sponsorships and potentially required recovery until the process is rebuilt.
- CR-010 exposes an unbroadcast Approval identity as the failed settlement transaction, violating the response contract and misleading downstream tracking.
- CR-013 lets a network-bound signer registered under
tron:*process another network's requirements without an explicit network equality check. - CR-020 is a lower-severity design correction: Approval update behavior should be an explicit per-token policy shared by sponsored and self-funded paths. The current v1
approval_reset_requiredfail-closed behavior is reasonable and should not be replaced with an implicit reset transaction.
I also recommend holding the release until TRON Upto and Batch Settlement support is implemented. Resource Sponsoring should be integrated through shared scheme-neutral hooks rather than remaining an Exact-only special path, and release coverage should demonstrate the same admission, deadline, network binding, Approval policy, response semantics, idempotency, and recovery invariants across Exact, Upto, and Batch Settlement.
Before release, please add end-to-end matrices for Exact/Upto/Batch × packed/solidified, token Approval strategies with zero/partial/sufficient allowance, cross-network signer rejection, transient permission RPC recovery, pre-Approval failures, and deadline expiry at each sponsorship stage. This release recommendation is a scope/readiness recommendation, not an additional confirmed defect.
| @@ -0,0 +1,5 @@ | |||
| # Copy this file to .env. Use the payer wallet here, never the Resource Owner wallet. | |||
There was a problem hiding this comment.
参考原有设计,env文件就放一个好了,不要区分client,server,facilitator
|
|
||
| import { resolveTronFacilitatorWallet } from './env.js' | ||
|
|
||
| const USDT_NILE = 'TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf' |
| @@ -0,0 +1,65 @@ | |||
| import Ajv from "ajv/dist/2020.js"; | |||
There was a problem hiding this comment.
整个流程耗时对比原有会增加多少,考虑一般和最坏情况
| } | ||
| }, | ||
| sponsor: executeNewOrExisting, | ||
| async reconcile(limit = 100) { |
There was a problem hiding this comment.
整个reconcile机制是基于持久化的,假如持久化出问题怎么办
Description
Adds the TRC20 Approval Resource Sponsoring extension on top of the released v1.1.0 baseline, targeting the v1.2.0 release of the TypeScript Extensions and TRON packages.
This PR:
Tests
Checklist